fail to program SAMA5D27-SOM1-ek1 qspi flash by sam-ba

Moderator: nferre

ryback
Posts: 2
Joined: Tue Jan 23, 2018 4:35 am

fail to program SAMA5D27-SOM1-ek1 qspi flash by sam-ba

Wed Feb 21, 2018 11:54 am

Here is my steps to program the board. I try to boot from qspi flash but fail...
1. I change the backup register as below,
>sam-ba -p j-link -d sama5d2 -a bootconfig -c writecfg:bscr:valid,bureg0 -c writecfg:bureg0:QSPI0_DISABLED,QSPI1_IOSET2,SPI0_DISABLED,SPI1_DISABLED,NFC_DISABLED,SDMMC0,SDMMC1,EXT_MEM_BOOT
Opening J-Link with S/N '483029471'
Found Atmel SAMA5D2x device
Disabling watchdog
Connection opened.
Executing command 'writecfg:bscr:valid,bureg0'
Setting BSCR to 0x00000004 (BUREG0,VALID)
Executing command 'writecfg:bureg0:QSPI0_DISABLED,QSPI1_IOSET2,SPI0_DISABLED,SPI1_DISABLED,NFC_DISABLED,SDMMC0,SDMMC1,EXT_MEM_BOOT'
Setting BUREG0 to 0x000403f7 (QSPI0_DISABLED,QSPI1_IOSET2,SPI0_DISABLED,SPI1_DISABLED,NFC_DISABLED,SDMMC0,SDMMC1,UART1_IOSET1,JTAG_IOSET1,EXT_MEM_BOOT)
Connection closed.


2. I update the bootstrap and uboot and zImage by sam-ba as well, after reboot, it shows as below and stop,
AT91Bootstrap 3.8.9-00026-gd7a52fb (四 2月 1 14:12:51 CST 2018)
SF: Got Manufacturer and Device ID: bf2643
SF: Copy 0xa0000 bytes from 0x10000 to 0x23f00000
SF: Done to load image


3. Then I can't program any more, it always shows,
Opening J-Link with S/N '483029471'
Error: Unsupported device
blue_z
Location: USA
Posts: 2103
Joined: Thu Apr 19, 2007 10:15 pm

Re: fail to program SAMA5D27-SOM1-ek1 qspi flash by sam-ba

Thu Feb 22, 2018 10:52 pm

ryback wrote:2. I update the bootstrap and uboot and zImage by sam-ba as well, after reboot, it shows as below and stop,
AT91Bootstrap 3.8.9-00026-gd7a52fb (四 2月 1 14:12:51 CST 2018)
That does not look like a prebuilt binary from Linux4SAM.
Seems like there are a plethora of salient details that you have neglected to mention.
Did you even verify what was written before trying to execute it?

ryback wrote:3. Then I can't program any more, it always shows,
Opening J-Link with S/N '483029471'
Error: Unsupported device
That's insufficient context.
What did you do to get this message?

Regards
ryback
Posts: 2
Joined: Tue Jan 23, 2018 4:35 am

Re: fail to program SAMA5D27-SOM1-ek1 qspi flash by sam-ba

Fri Feb 23, 2018 4:34 am

ryback wrote:
2. I update the bootstrap and uboot and zImage by sam-ba as well, after reboot, it shows as below and stop,
AT91Bootstrap 3.8.9-00026-gd7a52fb (四 2月 1 14:12:51 CST 2018)
That does not look like a prebuilt binary from Linux4SAM.
Seems like there are a plethora of salient details that you have neglected to mention.
Did you even verify what was written before trying to execute it?
I follow the process from this website, www.at91.com/linux4sam/bin/view/Linux4S ... EKMainPage
I have done test for SD card and it works. However I would like to try boot from QSPI but never success.
After install the toolchain, I get bootstrap by doing this, $ git clone git://github.com/linux4sam/at91bootstrap.git
then try to build the image,
$ cd at91bootstrap/
$ make mrproper
$ make sama5d27_som1_ekqspi_uboot_defconfig
$ make CROSS_COMPILE=arm-linux-gnueabi-
and I got the image in binaries/at91bootstrap.bin.
The same way I did for u-boot and linux kernel.
After I change the backup register by step. 1 which I did last time, I use sam-ba to program it,
$ sam-ba -p j-link -b sama5d27-som1-ek -a qspiflash -c writeboot:at91bootstrap.bin -c write:u-boot.bin:0x10000 -c write:zImage:0x200000
while all done, I press reset button, and that message shows up.
AT91Bootstrap 3.8.9-00026-gd7a52fb (四 2月 1 14:12:51 CST 2018)
SF: Got Manufacturer and Device ID: bf2643
SF: Copy 0xa0000 bytes from 0x10000 to 0x23f00000
SF: Done to load image

I attached the sceenshot for this.
ryback wrote:
3. Then I can't program any more, it always shows,
Opening J-Link with S/N '483029471'
Error: Unsupported device
That's insufficient context.
What did you do to get this message?
I got the message because I cannot boot normaly from step.2, so I tried to program again by sam-ba. However every command will return the message back.
$sam-ba -p j-link -d sama5d2 -a bootconfig -c readcfg:bscr -c readcfg:bureg0 -c readcfg:bureg1 -c readcfg:bureg2 -c readcfg:bureg3 -c readcfg:fuse
Opening J-Link with S/N '483029471'
Error: Unsupported device
friesen
Posts: 14
Joined: Fri Sep 28, 2018 2:51 pm

Re: fail to program SAMA5D27-SOM1-ek1 qspi flash by sam-ba

Fri Sep 28, 2018 7:03 pm

I think this is either a license restriction or a bug, it appears that any non 0 BUREGx register causes the OB J-link to have issues.
blue_z
Location: USA
Posts: 2103
Joined: Thu Apr 19, 2007 10:15 pm

Re: fail to program SAMA5D27-SOM1-ek1 qspi flash by sam-ba

Tue Oct 02, 2018 12:05 am

ryback wrote: 1. I change the backup register as below,
>sam-ba -p j-link -d sama5d2 -a bootconfig -c writecfg:bscr:valid,bureg0 -c writecfg:bureg0:QSPI0_DISABLED,QSPI1_IOSET2,SPI0_DISABLED,SPI1_DISABLED,NFC_DISABLED,SDMMC0,SDMMC1,EXT_MEM_BOOT
Opening J-Link with S/N '483029471'
...
Setting BUREG0 to 0x000403f7 (QSPI0_DISABLED,QSPI1_IOSET2,SPI0_DISABLED,SPI1_DISABLED,NFC_DISABLED,SDMMC0,SDMMC1,UART1_IOSET1,JTAG_IOSET1,EXT_MEM_BOOT)
Connection closed.
The problem appears to be an unintended reconfiguration of the JTAG interface (that takes effect after the next reboot).
The SAMA5D27-SOM1-Kit1 is wired to use JTAG I/O set 3.
Your write of BUREG0 (inadvertently) reconfigured the JTAG interface to use I/O set 1 (which is the default value), and effectively disconnected the J-Link from the SoM after you rebooted.

Regards
spastor
Posts: 2
Joined: Mon Sep 23, 2019 12:59 pm

Re: fail to program SAMA5D27-SOM1-ek1 qspi flash by sam-ba

Tue Sep 24, 2019 10:44 am

Thank you very much to all of you, specially blue_z.
I had a similar problem: flashed AT91 bootstrap in the SOM's QSPI and configured to boot from it on my SAMA5D27-SOM-EK. Then I was unable to boot from SD nor change BUREG0 with sam-ba because it was booting into QSPI's bootstrap (and nothing else!) and using jlink as port didn't work because I had also configured it with the wrong IOSET (ouch).
So, what I did to fix it was to put jumper J13 to disable the SOM's QSPI, this allowed sam-ba to communicate through the USB CDC serial port, so I reconfigured BUREG to its original value:

Code: Select all

sam-ba -p serial:COM17 -b sama5d27-som1-ek -a bootconfig -c writecfg:bureg0:QSPI0_IOSET1,QSPI1_IOSET1,SPI0_IOSET1,SPI1_IOSET1,NFC_IOSET1,SDMMC0,SDMMC1,UART1_IOSET1,JTAG_IOSET3
And then, after de-populating J13 and reset the board, I was able to erase the QSPI using jlink:

Code: Select all

sam-ba.exe --port j-link -b sama5d27-som1-ek -a qspiflash -c erase
And now it can boot from SDCard again :-)
mbonaldi
Posts: 6
Joined: Mon Dec 03, 2018 4:50 pm

Re: fail to program SAMA5D27-SOM1-ek1 qspi flash by sam-ba

Mon Jun 22, 2020 12:07 pm

Hi,
I have a similar problem.

I am trying to boot SAMA5D27-SOM1 from qspi-flash in the SOM.
I was able to compile and write correctly in the qspi flash at91bootstrap and U-Boot.
Then, I did the mistake: I changed the bureg0 configuration selecting JTAG_IOSET1, and I am not able now to select JTAG_IOSET3 again.
The last successful command I gave is
$ sudo ./sam-ba -p j-link -b sama5d27-som1-ek -a bootconfig -c writecfg:bureg0:ext_mem_boot,sdmmc1_disabled,sdmmc0_disabled,nfc_disabled,spi1_disabled,spi0_disabled,qspi1_disabled,qspi0_ioset3
Opening J-Link with S/N '483082692'
Found Atmel SAMA5D2 device
Disabling watchdog
Connection opened.
Executing command 'writecfg:bureg0:ext_mem_boot,sdmmc1_disabled,sdmmc0_disabled,nfc_disabled,spi1_disabled,spi0_disabled,qspi1_disabled,qspi0_ioset3'
Setting BUREG0 to 0x00040ffe (QSPI0_IOSET3,QSPI1_DISABLED,SPI0_DISABLED,SPI1_DISABLED,NFC_DISABLED,SDMMC0_DISABLED,SDMMC1_DISABLED,UART1_IOSET1,JTAG_IOSET1,EXT_MEM_BOOT)
Connection closed.
I think I need the jtag interface to change the configuration, so I am stuck.

The steps I am performing are:
1) Close DBOOT jumper
2) Power on the board
3) Open DBOOT jumper
4) Try to change bureg0 with
$ sudo ./sam-ba -p j-link -b sama5d27-som1-ek -a bootconfig -c writecfg:bureg0:QSPI0_DISABLED,QSPI1_IOSET2,SPI0_IOSET1,SPI1_IOSET1,NFC_IOSET1,SDMMC0_DISABLED,SDMMC1_DISABLED,UART1_IOSET1,JTAG_IOSET3,EXT_MEM_BOOT
But I obtain
Opening J-Link with S/N '483082692'
Error: Unsupported device[/code]
which is the same error I have when I forget to open the jumper.
It seems that SAM-BA is no more able to connect to the board.
Meanwhile, the board is performing "RomBOOT" forever, so it seems that I am never reaching the SAM-BA monitor.

What can I do to restore jtag?

Thanks
blue_z
Location: USA
Posts: 2103
Joined: Thu Apr 19, 2007 10:15 pm

Re: fail to program SAMA5D27-SOM1-ek1 qspi flash by sam-ba

Mon Jun 22, 2020 11:07 pm

mbonaldi wrote: I have a similar problem.
...
What can I do to restore jtag?
You have a similar problem to spastor, and can solve it the same way.
Instead of J-Link, use a USB CDC ACM connection between your PC host and the target board.

Use J17, the USB-A MicroAB connector, on the SAMA5D27-SOM1-EK1.
After the target board boots into SAM-BA Monitor mode, the USB connection should create a /dev/ttyACM0 device node on your host PC.
In your SAM-BA comand(s) specify a serial port (i.e. '-p serial') instead of the J-Link.

OR

Open jumper J4 (VDDBU current measurement) momentarily while the board is not powered.
That will clear the BSC_CR and BUREGs to zero values, and you can start fresh (assuming you haven't clobbered the fuses).

Regards
mbonaldi
Posts: 6
Joined: Mon Dec 03, 2018 4:50 pm

Re: fail to program SAMA5D27-SOM1-ek1 qspi flash by sam-ba

Wed Jul 01, 2020 4:10 pm

Thank you, very kind!!
In the end I could fix the damage by myself, but I really appreciate you help and explanation!!

Marta

Return to “SAMA5-based”

Who is online

Users browsing this forum: No registered users and 2 guests