Page 1 of 1

SAMA5D2 nandflash problems with sam-ba 3.1.3

Posted: Tue Aug 30, 2016 12:20 pm
by deejay
I'm facing some issues working with the nandflash applet provided with sam-ba version 3.1.3. I'm using the examples/sama5d2/nandflash/nandflash-usb.qml script.

When invoked, the applet fails with the following error:

Applet.qml:95: Error: Could not initialize applet (status: undefined)

To investigate the issue further, I started hacking into the applet source (https://github.com/atmelcorp/atmel-soft ... ash/main.c):

I don't have any jtag interfaces at my disposal, so the debugging is quite slow and painful, however what I find is, the issue appears to be related to some sort of RAM/stack corruption.

The reason for the above error is, the applet crashes during initialisation in handle_cmd_initialize() - code never returns from applet_set_init_params().

One of the debug steps is, I've stubbed out the following functions to return success

Code: Select all

handle_cmd_read_info()
handle_cmd_erase_pages()
handle_cmd_read_pages()
handle_cmd_write_pages()
At this point the initialisation completes successfully (see output snippet below):

Code: Select all

Opening serial port 'COM6'
Connection opened.
XXXXXXXXXXXX
args: 0,5,2,8,0
Detected memory size is 536870912 bytes.
XXXXXXXXXXXX
Erased 0 bytes at address 0x00000000 (0.00%)
Erased 0 bytes at address 0x00000000 (0.00%)
Erased 0 bytes at address 0x00000000 (0.00%)
Erased 0 bytes at address 0x00000000 (0.00%)
Erased 0 bytes at address 0x00000000 (0.00%)
...
I had a look at the map file, but nothing obvious jumped out. Has anyone had any success with this particular applet? Can you suggest something I can look at?

Thanks
deejay

Re: SAMA5D2 nandflash problems with sam-ba 3.1.3

Posted: Thu Sep 01, 2016 1:19 am
by blue_z
deejay wrote:I'm facing some issues working with the nandflash applet provided with sam-ba version 3.1.3.
...
I don't have any jtag interfaces at my disposal, so the debugging is quite slow and painful, however what I find is, the issue appears to be related to some sort of RAM/stack corruption.
You seem to adequately describe what you're doing, but what is your goal?
(I don't know if expertise in SAM-BA applets is a marketable skill.)
If the goal is to learn how to use/program the SoC, then instead of debugging a host application and its applets, use U-Boot and the DBGU port with a terminal emulator program.
You can study the U-Boot code or run "standalone" programs (such as those from the Atmel Softpack) from U-Boot.

Regards

Re: SAMA5D2 nandflash problems with sam-ba 3.1.3

Posted: Thu Sep 01, 2016 3:06 am
by deejay
I'm attempting to bring up a sama5d2 based custom board with on-board nand flash. The hardware engineers were attempting to use the SAM-BA utility to write to the on-board flash. However, the nandflash applet provided with SAM-BA appears to crash very early in the piece (even before attempting to access the flash controller).

I have progressed a little further with the issue (https://github.com/atmelcorp/atmel-soft ... -243666774) but haven't yet found the root cause.

Re: SAMA5D2 nandflash problems with sam-ba 3.1.3

Posted: Fri Sep 02, 2016 1:42 am
by blue_z
deejay wrote:I'm attempting to bring up a sama5d2 based custom board with on-board nand flash.
Obviously I erred, and retract my comment that you've provided an adequate description.
Good luck trying to bring-up a board using SAM-BA.

Re: SAMA5D2 nandflash problems with sam-ba 3.1.3

Posted: Tue Jul 04, 2017 11:41 am
by nferre
Hi,

SAM-BA 3.2.x is now more stable with NAND and eMMC. You can find a preview here:
https://github.com/atmelcorp/sam-ba/releases

Regards,