Serious Issues Using SAM-BA

All design tool related questions: compiler, assembler, linker. Embedded programming questions: assembler, C code.

Moderator: nferre

PeterT
Posts: 17
Joined: Tue Jun 21, 2016 12:03 am

Serious Issues Using SAM-BA

Thu Oct 06, 2016 10:31 pm

I'm using linux on my host machine and trying to use SAM-BA with the SAMA5D2 XPLAINED (rev B). Initially, any command I tried to failed with

Code: Select all

"Opening serial port 'ttyACM0'
Error: Could not switch monitor on port 'ttyACM0' to binary mode
Connection closed.
I finally used a terminal program (C-Kermit) to manually connect to the port (had to set the baud rate to 57600 instead of 115200 as stated in the datasheet) and use the N# command. Then my commands at least got farther.

No any time I try to use an applet, I get the following

Code: Select all

sam-ba --port serial:ttyACM0:57600 --board sama5d2-xplained --applet bootconfig
Connection opened.
<path>/tools/sam-ba_3.1.4/qml/SAMBA/Applet.qml:96: Error: Could not initialize applet (status: undefined)
Connection closed.
It's the same for any applet. This has been ridiculously frustrating. Please, someone help me out with this.
elyask
Posts: 2
Joined: Mon Jul 01, 2019 6:41 am

Re: Serious Issues Using SAM-BA

Tue Jul 02, 2019 6:21 am

Hi Peter,

I am having the same issue. I would like to know if you have solved your problem. If yes how?

Thanks
Elyas
uaraz
Posts: 3
Joined: Tue Oct 01, 2019 6:04 am

Re: Serious Issues Using SAM-BA

Tue Oct 01, 2019 6:13 am

Hi all,

I'm having the same problem as OP. Actually it was working the first time, but it would not work at all. Seems like microchip is not helping.
nferre
Site Admin
Posts: 208
Joined: Wed Feb 14, 2007 11:17 am

Re: Serious Issues Using SAM-BA

Tue Oct 01, 2019 2:47 pm

Hi,

You may access the chip with serial line instead of USB gadget. Using only one USB-microUSB cable will help you to make sure and get used to the way to use SAM-BA tool.
uaraz
Posts: 3
Joined: Tue Oct 01, 2019 6:04 am

Re: Serious Issues Using SAM-BA

Thu Oct 03, 2019 6:16 am

Hi nferre,

Do you mind to elaborate more?

I tried 2 methods:
1. USB-UART adapter connected to target board uart debug port, and run "demo_linux_serialflash_ttyUSB0.sh":
-> Error: Could not switch monitor on port 'ttyUSB0' to binary mode

2. micro usb cable connected to target board and run "demo_linux_serialflash.sh":
-> Error: could not initialize applet (status: undefined)

appreciate if someone could help.
blue_z
Location: USA
Posts: 2007
Joined: Thu Apr 19, 2007 10:15 pm

Re: Serious Issues Using SAM-BA

Fri Oct 04, 2019 10:56 pm

uaraz wrote: Do you mind to elaborate more?
You could do the same.
What version of the SoC do you have?
What board connections and jumper settings are you using?
Just one line of the error message provides no context. Were there other messages displayed?


The SAM-BA utility is guaranteed to fail if the SAM target board is not already executing the SAM-BA Monitor from ROM.
You can confirm that the board is executing the SAM-BA Monitor by using on the PC a terminal emulator program for the serial connection, e.g. ttyACM0 or ttyUSB0.
Type the "V#" command to retrieve the version string.
If there's no response, then the SAM board is not ready on that interface for the SAM-BA utility.
IOW seeing the "RomBOOT" text in response to a reset is not sufficient confirmation for a SAM-BA Monitor connection.

uaraz wrote: I tried 2 methods:
1. USB-UART adapter connected to target board uart debug port,
A SAM-BA connection using the J1 DBGU connector requires proper connections.
Of course JP2 (DEBUG_DIS) has to be left open.
You can power the board in one of three ways for a functional SAM-BA connection on DBGU:
  • A 5V power supply to either J14 (EDBG-USB) or J23 (A5-USB-A).
  • A power-only USB cable from a USB host (e.g. a PC) to either J14 (EDBG-USB) or J23 (A5-USB-A).
  • A standard USB connection from a USB host (e.g. a PC) to J14 (EDBG_USB). JP1 (EDBG_DIS) should be shorted.
When the board is powered properly for SAM-BA, then there is no need for kluged scripts as your demo_linux_serialflash_ttyUSB0.sh.

Regards
uaraz
Posts: 3
Joined: Tue Oct 01, 2019 6:04 am

Re: Serious Issues Using SAM-BA

Wed Oct 09, 2019 6:21 am

Hi blue_z,

I am currently using Sama5d2 Xplained Ultra board on windows host.

Here is what I did:
1. Short JP9 (BOOT_DIS)
2. Connect usb cable to J23 port
3. Bossa Program Port (COM4) detected in device manager
4. Managed to get version when 'V#' is sent: "v1.2 Dec 1 2015 09:20:36"
5. run "demo_linux_serialflash.sh" from the sample yocto image.
6. The following error message appear:
Opening serial port 'COM4'
Connection opened.
-I- === Initialize serialflash access ===
C:/Users/yopok/Downloads/sam-ba_3.2.3-win32/sam-ba_3.2.3/qml/SAMBA/Applet.qml:232: Error: Could not initialize applet (status: 1)
Connection closed.

I tried the same method using a ubuntu (virtual box) but still getting the same error.

I then modified "demo_linux_serialflash_usb.qml" to only flash the eMMC memory. This time I am able to flash the filesystem to eMMC and no error message. It seems that only the serial flashing part (u-boot and kernel image) will fail.
nferre
Site Admin
Posts: 208
Joined: Wed Feb 14, 2007 11:17 am

Re: Serious Issues Using SAM-BA

Wed Oct 09, 2019 9:24 am

Hi,

Maybe it's because BOOT_DIS is still positioned when you run the script. If it's the case, the SAM-BA applet cannot position the CS and access the serial flash...

Regards,
Nicolas
dchristiancp
Posts: 5
Joined: Thu Oct 24, 2019 6:33 pm

Re: Serious Issues Using SAM-BA

Thu Oct 24, 2019 6:43 pm

I'm having similar issues. Even simple reads fail.

I can see RomBOOT through a terminal emulator, so I know that the UART and host serial configuration are OK.

On a custom board:

Code: Select all

$ ./sam-ba -d sama5d2 -a bootconfig -c readcfg:bscr
No port option on command-line, using 'serial'.
Opening serial port 'ttyUSB0'
Connection opened.
/opt/sam-ba_3.3/qml/SAMBA/Applet.qml:232: Error: Could not initialize applet (status: undefined)
Connection closed.
If I run from a Windows VM, I get the "unable to set binary mode" thing.
dchristiancp
Posts: 5
Joined: Thu Oct 24, 2019 6:33 pm

Re: Serious Issues Using SAM-BA

Fri Oct 25, 2019 4:54 pm

I managed to get a trace of the interaction using strace (on Linux). The applet is loading now for some reason. It seems to interact for a couple seconds and then get stuck.

Code: Select all

strace -o ~/tmp/sb5.txt -s 39 -tt -e file,read,write ./sam-ba -d sama5d2 -a bootconfig -c readcfg:bscr
Here is the interesting part of the strace:

Code: Select all

08:45:01.524698 read(6, "8287\nsam-ba\nl-dchristian\n", 16384) = 25
08:45:01.524737 read(6, "", 16359)      = 0
08:45:01.711296 write(6, "#", 1)        = 1
08:45:01.718767 read(6, "\n\r>", 512)   = 3
08:45:01.822564 write(6, "N#", 2)       = 2
08:45:01.830551 read(6, "\n\r", 512)    = 2
08:45:01.831278 write(6, "wfc069000,#", 11) = 11
08:45:01.846649 read(6, "\302\10\\\212", 512) = 4
08:45:01.847252 write(6, "Wf8030058,00000000#", 19) = 19
08:45:01.849892 write(6, "S220000,4000#", 13) = 13
08:45:01.862532 read(6, "C", 512)       = 1
08:45:01.862847 write(6, "\1", 1)       = 1
08:45:01.862945 write(6, "\1", 1)       = 1
08:45:01.863028 write(6, "\376", 1)     = 1
08:45:01.863110 write(6, "!\0\0\352\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 128) = 128
08:45:01.863191 write(6, "\10", 1)      = 1
08:45:01.863268 write(6, "3", 1)        = 1
08:45:01.878381 read(6, "\6", 512)      = 1
08:45:01.878671 write(6, "\1", 1)       = 1
08:45:01.878771 write(6, "\2", 1)       = 1
08:45:01.878853 write(6, "\375", 1)     = 1
08:45:01.878937 write(6, "\0\0\0\0\214\0\"\0\1\0\0\0\4\0\240\341\r"..., 128) = 128
08:45:01.879047 write(6, "\243", 1)     = 1
08:45:01.879132 write(6, "]", 1)        = 1
08:45:01.894394 read(6, "\6", 512)      = 1
08:45:01.894583 write(6, "\1", 1)       = 1
08:45:01.894788 write(6, "\3", 1)       = 1
08:45:01.894985 write(6, "\374", 1)     = 1
08:45:01.895097 write(6, "\2\2(\277\240\353\301p\260\353\201\177\0\277B\353\2\2(\277\240\353\201p\260\353A\177\0\277B\353\2\2(\277\240\353A"..., 128) = 128
08:45:01.895193 write(6, "K", 1)        = 1
08:45:01.895279 write(6, "7", 1)        = 1
08:45:01.910489 read(6, "\6", 512)      = 1
08:45:01.911090 write(6, "\1", 1)       = 1
08:45:01.911421 write(6, "\4", 1)       = 1
08:45:01.911645 write(6, "\373", 1)     = 1

... < lots of repetition similar to above trimmed for clarity >

08:45:03.988916 write(6, "D&\"\08&\"\0d&\"\0X&\"\0(&\"\0000&\"\0\300\10\0\0\1\0\0\0|&\"\0$'\""..., 128) = 128
08:45:03.989164 write(6, "\320", 1)     = 1
08:45:03.989393 write(6, "\232", 1)     = 1
08:45:04.003603 read(6, "\6", 512)      = 1
08:45:04.004173 write(6, "\1", 1)       = 1
08:45:04.004485 write(6, "\5", 1)       = 1
08:45:04.004702 write(6, "\372", 1)     = 1
08:45:04.005059 write(6, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\r\nApplet 'B"..., 128) = 128
08:45:04.005291 write(6, "\254", 1)     = 1
08:45:04.005489 write(6, "\343", 1)     = 1
08:45:04.019530 read(6, "\6", 512)      = 1
08:45:04.019952 write(6, "\1", 1)       = 1
08:45:04.020248 write(6, "\6", 1)       = 1
08:45:04.020525 write(6, "\371", 1)     = 1
08:45:04.020783 write(6, "- Invalid parameter for read config: in"..., 128) = 128
08:45:04.021118 write(6, "\243", 1)     = 1
08:45:04.021342 write(6, "n", 1)        = 1
08:45:04.035565 read(6, "\6", 512)      = 1
08:45:04.036107 write(6, "\1", 1)       = 1
08:45:04.036457 write(6, "\7", 1)       = 1
08:45:04.036742 write(6, "\370", 1)     = 1
08:45:04.037168 write(6, "itten: \0BSCR: 0x%08x -> \0BUREG_VALID\0 B"..., 128) = 128
08:45:04.037446 write(6, "\352", 1)     = 1
08:45:04.037707 write(6, "\376", 1)     = 1
08:45:04.051486 read(6, "\6", 512)      = 1
08:45:04.052005 write(6, "\1", 1)       = 1
08:45:04.052332 write(6, "\10", 1)      = 1
08:45:04.052550 write(6, "\367", 1)     = 1
08:45:04.052767 write(6, "IOSET_1\0 QSPI_0_IOSET_2*\0 QSPI_0_IOSET_"..., 128) = 128
08:45:04.053274 write(6, "\353", 1)     = 1
08:45:04.053481 write(6, "W", 1)        = 1
08:45:04.067498 read(6, "\6", 512)      = 1
08:45:04.068089 write(6, "\1", 1)       = 1
08:45:04.068394 write(6, "\t", 1)       = 1
08:45:04.068734 write(6, "\366", 1)     = 1
08:45:04.069093 write(6, "1_IOSET_1\0 SPI_1_IOSET_2*\0 SPI_1_IOSET_"..., 128) = 128
08:45:04.069365 write(6, "\314", 1)     = 1
08:45:04.069545 write(6, "\253", 1)     = 1
08:45:04.083333 read(6, "\6", 512)      = 1
08:45:04.083741 write(6, "\1", 1)       = 1
08:45:04.083966 write(6, "\n", 1)       = 1
08:45:04.084075 write(6, "\365", 1)     = 1
08:45:04.084177 write(6, "ET_1*\0 CONSOLE_UART1_IOSET_2*\0 CONSOLE_"..., 128) = 128
08:45:04.084279 write(6, ",", 1)        = 1
08:45:04.084382 write(6, "\223", 1)     = 1
08:45:04.099423 read(6, "\6", 512)      = 1
08:45:04.099744 write(6, "\1", 1)       = 1
08:45:04.099839 write(6, "\v", 1)       = 1
08:45:04.099922 write(6, "\364", 1)     = 1
08:45:04.099995 write(6, "ONSOLE_UART3_IOSET_2*\0 CONSOLE_UART3_IO"..., 128) = 128
08:45:04.100069 write(6, "<", 1)        = 1
08:45:04.100141 write(6, "\f", 1)       = 1
08:45:04.115241 read(6, "\6", 512)      = 1
08:45:04.115527 write(6, "\1", 1)       = 1
08:45:04.115649 write(6, "\f", 1)       = 1
08:45:04.115728 write(6, "\363", 1)     = 1
08:45:04.115806 write(6, "\0 EXT_MEM_BOOT*\0 QSPI_XIP_MODE*\0 DISABL"..., 128) = 128
08:45:04.115884 write(6, "K", 1)        = 1
08:45:04.115957 write(6, "\34", 1)      = 1
08:45:04.131289 read(6, "\6", 512)      = 1
08:45:04.131530 write(6, "\1", 1)       = 1
08:45:04.131701 write(6, "\r", 1)       = 1
08:45:04.131775 write(6, "\362", 1)     = 1
08:45:04.131844 write(6, "and 0x%08x\r\n\0\2\6\7\t\n\f\r\17\37 -.45?-F- Invalid"..., 128) = 128
08:45:04.131914 write(6, "\375", 1)     = 1
08:45:04.131980 write(6, "\24", 1)      = 1
08:45:04.147242 read(6, "\6", 512)      = 1
08:45:04.147590 write(6, "\1", 1)       = 1
08:45:04.147721 write(6, "\16", 1)      = 1
08:45:04.147791 write(6, "\361", 1)     = 1
08:45:04.147860 write(6, "- Invalid pin type\r\n\0#-0+ \0hlL\0efgEFG\0000"..., 128) = 128
08:45:04.147928 write(6, "e", 1)        = 1
08:45:04.147994 write(6, "\234", 1)     = 1
08:45:04.163166 read(6, "\6", 512)      = 1
08:45:04.163424 write(6, "\1", 1)       = 1
08:45:04.163558 write(6, "\17", 1)      = 1
08:45:04.163652 write(6, "\360", 1)     = 1
08:45:04.163722 write(6, "\4\360\37\345U-\"\0\351\5\"\0\20G\"\0\0\0\0\0\334A\"\0\374A\"\0\274A\"\0\0\0\0\0\0\0\0"..., 128) = 128
08:45:04.163791 write(6, "\366", 1)     = 1
08:45:04.163855 write(6, "\204", 1)     = 1
08:45:04.179176 read(6, "\6", 512)      = 1
08:45:04.179420 write(6, "\1", 1)       = 1
08:45:04.179593 write(6, "\20", 1)      = 1
08:45:04.179662 write(6, "\357", 1)     = 1
08:45:04.179727 write(6, "\274\344\377\177\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 128) = 128
08:45:04.179794 write(6, ";", 1)        = 1
08:45:04.179859 write(6, "}", 1)        = 1
08:45:04.195192 read(6, "\6", 512)      = 1
08:45:04.195505 write(6, "\4", 1)       = 1
08:45:04.211010 read(6, "\6", 512)      = 1
08:45:04.211672 write(6, "W220004,00000000#", 17) = 17
08:45:04.211821 write(6, "W220008,ffffffff#", 17) = 17
08:45:04.211979 write(6, "W22000c,00000001#", 17) = 17
08:45:04.212114 write(6, "W220010,00000003#", 17) = 17
08:45:04.212255 write(6, "W220014,ffffffff#", 17) = 17
08:45:04.212384 write(6, "W220018,ffffffff#", 17) = 17
08:45:04.212494 write(6, "W22001c,00000000#", 17) = 17
08:45:04.212605 write(6, "W220020,00000000#", 17) = 17
08:45:04.212702 write(6, "W220024,00000000#", 17) = 17
08:45:04.212795 write(6, "W220028,00000000#", 17) = 17
08:45:04.212963 write(6, "W22002c,00000000#", 17) = 17
08:45:04.213067 write(6, "W220030,00000000#", 17) = 17
08:45:04.213165 write(6, "W220034,00000000#", 17) = 17
08:45:04.213270 write(6, "W220038,00000000#", 17) = 17
08:45:04.213373 write(6, "W22003c,00000000#", 17) = 17
08:45:04.213553 write(6, "W220040,00000000#", 17) = 17
08:45:04.213680 write(6, "W220044,00000000#", 17) = 17
08:45:04.213796 write(6, "W220048,00000000#", 17) = 17
08:45:04.213932 write(6, "W22004c,00000000#", 17) = 17
08:45:04.214063 write(6, "W220050,00000000#", 17) = 17
08:45:04.214171 write(6, "W220054,00000000#", 17) = 17
08:45:04.214274 write(6, "W220058,00000000#", 17) = 17
08:45:04.215073 write(6, "W22005c,00000000#", 17) = 17
08:45:04.222052 write(6, "W220060,00000000#", 17) = 17
08:45:04.222349 write(6, "W220064,00000000#", 17) = 17
08:45:04.222487 write(6, "W220068,00000000#", 17) = 17
08:45:04.222582 write(6, "W22006c,00000000#", 17) = 17
08:45:04.222665 write(6, "W220070,00000000#", 17) = 17
08:45:04.222746 write(6, "W220074,00000000#", 17) = 17
08:45:04.222828 write(6, "W220078,00000000#", 17) = 17
08:45:04.237871 write(6, "W22007c,00000000#W220080,00000000#", 34) = 34
08:45:04.238155 write(6, "G220000#", 8) = 8
08:45:04.275114 read(6, "\6", 512)      = 1
08:45:04.275879 write(6, "w220004,#", 9) = 9
08:45:14.287927 write(6, "w220008,#", 9) = 9
blue_z
Location: USA
Posts: 2007
Joined: Thu Apr 19, 2007 10:15 pm

Re: Serious Issues Using SAM-BA

Sat Oct 26, 2019 2:46 am

dchristiancp wrote: I managed to get a trace of the interaction using strace (on Linux). The applet is loading now for some reason. It seems to interact for a couple seconds and then get stuck.
The salient parts of that strace are

Code: Select all

15:40:53.739580 open("/opt/sam-ba_3.3/qml/SAMBA/Device/SAMA5D2/applets/applet-bootconfig_sama5d2-generic_sram.bin", O_RDONLY|O_CLOEXEC) = 7
(which you edited out) and

Code: Select all

08:45:04.238155 write(6, "G220000#", 8) = 8
(which is your 4th from last line).

So the applet is loaded into SRAM, does start execution, seems to terminate, but is then non-responsive to further commands.
What should happen is

Code: Select all

15:40:56.141487 write(6, "G220000#", 8) = 8
15:40:56.158605 read(6, "\6", 512)      = 1
15:40:56.159476 write(6, "w220004,#", 9) = 9
15:40:56.161546 read(6, "\313\377\377\377", 512) = 4             << missing response in your strace
15:40:56.162128 write(6, "w220008,#", 9) = 9
15:40:56.165634 read(6, "\0\0\0\0", 512) = 4                            << missing response in your strace
15:40:56.166467 write(6, "w22000c,#", 9) = 9
15:40:56.168544 read(6, "\0\0\0\0", 512) = 4
15:40:56.169165 write(6, "w220010,#", 9) = 9
15:40:56.170493 read(6, "\0\0", 512)    = 2
15:40:56.171487 read(6, "\0\0", 512)    = 2
15:40:56.171837 write(6, "w220014,#", 9) = 9
15:40:56.173489 read(6, "\0\0\0\0", 512) = 4
15:40:56.173842 write(6, "w220018,#", 9) = 9
15:40:56.175493 read(6, "\0\0\0\0", 512) = 4
15:40:56.175848 write(6, "w22001c,#", 9) = 9
15:40:56.177495 read(6, "\0\0\0\0", 512) = 4
15:40:56.177858 write(6, "w220020,#", 9) = 9
15:40:56.180951 read(6, "\0\0\0\0", 512) = 4
15:40:56.181466 write(6, "w220024,#", 9) = 9
15:40:56.183504 read(6, "\0\0\0\0", 512) = 4
15:40:56.183857 write(6, "w220028,#", 9) = 9
15:40:56.185495 read(6, "\0\0\0\0", 512) = 4
15:40:56.185846 write(6, "w22002c,#", 9) = 9
15:40:56.187481 read(6, "\0\0\0\0", 512) = 4
15:40:56.187732 write(6, "w220030,#", 9) = 9
15:40:56.189536 read(6, "\0\0\0\0", 512) = 4
15:40:56.189910 write(6, "w220034,#", 9) = 9
15:40:56.191496 read(6, "\0\0\0\0", 512) = 4
15:40:56.191844 write(6, "w220038,#", 9) = 9
15:40:56.193496 read(6, "\0\0\0\0", 512) = 4
15:40:56.193838 write(6, "w22003c,#", 9) = 9
15:40:56.195475 read(6, "\0\0\0\0", 512) = 4
15:40:56.197508 write(6, "w220040,#", 9) = 9
15:40:56.199507 read(6, "\0\0\0\0", 512) = 4
15:40:56.199860 write(6, "w220044,#", 9) = 9
15:40:56.201497 read(6, "\0\0\0\0", 512) = 4
15:40:56.201848 write(6, "w220048,#", 9) = 9
15:40:56.203493 read(6, "\0\0\0\0", 512) = 4
15:40:56.203841 write(6, "w22004c,#", 9) = 9
15:40:56.205491 read(6, "\0\0\0\0", 512) = 4
15:40:56.205834 write(6, "w220050,#", 9) = 9
15:40:56.207495 read(6, "\0\0\0\0", 512) = 4
15:40:56.207843 write(6, "w220054,#", 9) = 9
15:40:56.209500 read(6, "\0\0\0\0", 512) = 4
15:40:56.209856 write(6, "w220058,#", 9) = 9
15:40:56.211497 read(6, "\0\0\0\0", 512) = 4
15:40:56.211848 write(6, "w22005c,#", 9) = 9
15:40:56.214194 read(6, "\0\0\0\0", 512) = 4
15:40:56.214677 write(6, "w220060,#", 9) = 9
15:40:56.216495 read(6, "\0\0\0\0", 512) = 4
15:40:56.216862 write(6, "w220064,#", 9) = 9
15:40:56.218495 read(6, "\0\0\0\0", 512) = 4
15:40:56.218846 write(6, "w220068,#", 9) = 9
15:40:56.220495 read(6, "\0\0\0\0", 512) = 4
15:40:56.220843 write(6, "w22006c,#", 9) = 9
15:40:56.222497 read(6, "\0\0\0\0", 512) = 4
15:40:56.222876 write(6, "w220070,#", 9) = 9
15:40:56.224494 read(6, "\0\0\0\0", 512) = 4
15:40:56.224852 write(6, "w220074,#", 9) = 9
15:40:56.226497 read(6, "\0\0\0\0", 512) = 4
15:40:56.226868 write(6, "w220078,#", 9) = 9
15:40:56.228492 read(6, "\0\0\0\0", 512) = 4
15:40:56.228833 write(6, "w22007c,#", 9) = 9
15:40:56.231372 read(6, "\0\0\0\0", 512) = 4
15:40:56.231873 write(6, "w220080,#", 9) = 9
15:40:56.233498 read(6, "\0\0\0\0", 512) = 4
15:40:56.233750 write(2, "BSCR=0x00000000 / BUREG0\n", 25) = 25
15:40:56.233957 write(3, "\1\0\0\0\0\0\0\0", 8) = 8
15:40:56.234061 write(3, "\1\0\0\0\0\0\0\0", 8) = 8
15:40:56.234419 write(4, "\1\0\0\0\0\0\0\0", 8) = 8
15:40:56.235029 write(3, "\1\0\0\0\0\0\0\0", 8) = 8
15:40:56.235120 write(3, "\1\0\0\0\0\0\0\0", 8) = 8
15:40:56.304583 unlink("/var/lock/LCK..ttyACM0") = 0
15:40:56.305023 write(2, "Connection closed.\n", 19) = 19
15:40:56.318203 open("/sys/devices/system/cpu/online", O_RDONLY|O_CLOEXEC) = 4
15:40:56.318373 read(4, "0-1\n", 8192)  = 4
15:40:56.321735 +++ exited with 0 +++

You might want to enable the trace feature (i.e. using "-t 5" SAM-BA option to get debug text from the applet), but I can only get trace output on the target's DBGU port when executing SAM-BA with the USB device port of the target (and /dev/ttyACM0 on the host).
For the command

Code: Select all

$ ./sam-ba -p serial:ttyACM0 --tracelevel 5  -d sama5d2 -a bootconfig -c readcfg:bscr
the trace output is

Code: Select all

Applet 'BootConfig' from softpack 2.17 (v2.17).
BSCR: 0x00000000 ->  BUREG_0

Do you need to and/or have you accounted for all hardware differences by modifying the applets?

Otherwise when execution of a simple SRAM applet is problematic, you probably should be verifying the voltages and clocks of your custom board.
IOW the SAM-BA issue you are having is indicative of a hardware issue rather than any procedural issue.
Claiming that you are having "similar issues" with SAM-BA is disingenuous when the real issue seems to be board bring-up.

Regards
dchristiancp
Posts: 5
Joined: Thu Oct 24, 2019 6:33 pm

Re: Serious Issues Using SAM-BA

Mon Oct 28, 2019 7:39 pm

Thanks for the help. The interaction between the applet and the board configuration was new to me.

Giving it a board config instead of just the device made things work.

This works (although I don't see any trace info):

Code: Select all

./sam-ba -b sama5d27-som1 -a bootconfig -c readcfg:bscr -t 5
No port option on command-line, using 'serial'.
Opening serial port 'ttyUSB0'
Connection opened.
Executing command 'readcfg:bscr'
BSCR=0x00000000 / BUREG0
Connection closed.
Is there documentation that talks about modifying the applets and/or board configurations? I couldn't find anything about this. It's still a mystery to me how qml code gets turned into target code.

Return to “Development Tools”

Who is online

Users browsing this forum: No registered users and 1 guest