unable to boot from NOR on SAMA5D3x

Discussion around products based on ARM Cortex-A5 core.

Moderator: nferre

crawfish101
Posts: 7
Joined: Fri May 02, 2014 6:30 am

unable to boot from NOR on SAMA5D3x

Wed May 21, 2014 2:45 am

I am trying to boot from NOR on the SAMA5D3x to determine if it is much faster than booting from NAND.  I can program and read back the NOR from with SAM-BA.  The problem is the board always boots through RomBOOT (DGBU always prints RomBOOT) even with the BMS jumper JP9 open or closed. 

Now, perhaps if the BMS jumper is closed the SAMA5 will try to load a boot program from parallel NOR and if that fails then it falls back to RomBOOT, but I was not expecting this and it is not documented anywhere.  I suspect that this might be a design flaw with this development board.
blue_z
Location: USA
Posts: 1721
Joined: Thu Apr 19, 2007 10:15 pm

Re: unable to boot from NOR on SAMA5D3x

Wed May 21, 2014 8:30 pm

crawfish101 wrote:I can program and read back the NOR from with SAM-BA.
What code did you put in the NOR Flash?

Regards
crawfish101
Posts: 7
Joined: Fri May 02, 2014 6:30 am

Re: unable to boot from NOR on SAMA5D3x

Wed May 21, 2014 8:55 pm

I used sam-ba to send an at91bootstrap 3.6.2 binary file to parallel NOR address 0x0.  I used the exact same binary file that worked successfully when written to NAND.  Could the header or interrupt vector table be different between a NAND at91bootstrap and a NOR at91bootstrap?

I was assuming that if there was something wrong with the boot image in parallel NOR and the BMS pin was low then the SAMA5 would just not start.  I would not expect the CPU to fallback to RomBOOT in this scenario.  So because it always does run RomBOOT I am worried that the BMS jumper JP9 is not working as designed on the SAMA5D3ek.  I am thinking that the development board is not even attempting to load a boot image from NOR.
blue_z
Location: USA
Posts: 1721
Joined: Thu Apr 19, 2007 10:15 pm

Re: unable to boot from NOR on SAMA5D3x

Wed May 21, 2014 9:18 pm

crawfish101 wrote:I used sam-ba to send an at91bootstrap 3.6.2 binary file to parallel NOR address 0x0.
That is not appropriate bootstrap code to put into NOR Flash.
crawfish101 wrote:Now, perhaps if the BMS jumper is closed the SAMA5 will try to load a boot program from parallel NOR and if that fails then it falls back to RomBOOT, but I was not expecting this and it is not documented anywhere.
Apparently you have not read the SAMA5D3x datasheet.
There is no attempted "load ... from parallel NOR".
Code in NOR Flash is XIP, executed in place.
AT91Bootstrap is a non-relocatable program written & linked for execution in SRAM at 0x00300000, not NOR Flash at 0x0.
crawfish101 wrote:I suspect that this might be a design flaw with this development board.
That's a bit hasty.
You set something up, and when it doesn't perform as expected, you disparage the work of others?
Working with you must be pleasant.

FWIW, when I short JP9 on my board, it hangs as expected since there is no valid code in NOR Flash.

Regards
crawfish101
Posts: 7
Joined: Fri May 02, 2014 6:30 am

Re: unable to boot from NOR on SAMA5D3x

Thu May 22, 2014 2:19 am

I guess claiming there is a design flaw was bit harsh.  I never meant to disparage anybody's work.  Thanks for pointing out my mistake about NOR being XIP.

But, the real question is why does your dev board not boot when the BMS jumper is in place but my dev board starts RomBOOT even when the jumper is in place.  I have the SAMA5D3x REVC motherboard and the Embest SAMA5D31 module.  Do you know if you have the Embest or Roenetix SAMA5 module?
blue_z
Location: USA
Posts: 1721
Joined: Thu Apr 19, 2007 10:15 pm

Re: unable to boot from NOR on SAMA5D3x

Thu May 22, 2014 3:10 am

crawfish101 wrote:Do you know if you have the Embest or Roenetix SAMA5 module?
On boot it reports "Flex", which is supposed to be the same as Embest.
crawfish101 wrote:But, the real question is why does your dev board not boot when the BMS jumper is in place but my dev board starts RomBOOT even when the jumper is in place.  I have the SAMA5D3x REVC motherboard and the Embest SAMA5D31 module.
My board has garbage in NOR Flash.
Your board has proper ARM instructions in NOR Flash.
The first instruction it executes out of NOR at 0x0 is a branch to the start of the program (i.e. the reset vector). It's also going to try to do impossible things, like create the stack in (address space occupied by) NOR Flash instead of SRAM. That execution can somehow branch back to ROM boot program apparently is not impossible.
One possible mechanism is to somehow reset or clear AXIMX_REMAP, the memory remap register at 0x800000. Note that main() starts off with three calls to memset() to zero out memory.

There are a couple things to try:

The MB has a built-in (SAM-ICE/Seggar) JTAG. See if you can trace the execution through NOR. This may not be possible because JTAG is inhibited during part of the boot sequence.

Generate an assembly listing for AT91Bootstrap from the compiler (or use an ARM disassember), and then play computer and desk-trace the execution from location 0.

Erase the NOR Flash, and then see what the board does.

Regards
 
crawfish101
Posts: 7
Joined: Fri May 02, 2014 6:30 am

Re: unable to boot from NOR on SAMA5D3x

Thu May 22, 2014 5:54 pm

I tried erasing all of the NOR by running the sam-ba "Enable NORFlash" followed by "Erase All" scripts.  But still no luck.  The board always starts through ROM boot even with BMS jumper inserted.  I also tried sending a pdf using sam-ba to NOR address 0x0 to try and set the NOR with garbage, but I end up with the same result.

I did notice something else that was odd that may or may not be related.  When I remove the VBAT jumper JP4 the SAMA5 stops shortly after.  The board will not boot if the VBAT jumper is removed.  I have the Linux4sam buildroot demo image running and when I remove VBAT the blinking blue LED on the module and the DBGU console stops after 3 sec.  When I close the VBAT jumper the board reboots through RomBOOT.  I would have expected VBAT to just hold up the real time clock, not stop the processor? 

Also, is your module a rev E?   Mine is the the Embeset SAMA5D31 rev D. I think rev E is the latest.  My motherboard is SAMA5D3x-MB rev C
blue_z
Location: USA
Posts: 1721
Joined: Thu Apr 19, 2007 10:15 pm

Re: unable to boot from NOR on SAMA5D3x

Fri May 23, 2014 3:18 am

crawfish101 wrote:I would have expected VBAT to just hold up the real time clock, not stop the processor?
Still making assumptions?
Instead of guessing, did you study the schematics?
crawfish101 wrote:Also, is your module a rev E?
Yes, Rev. E module and Rev.C MB.

Regards

Return to “SAMA5D Cortex-A5 MPU”

Who is online

Users browsing this forum: No registered users and 1 guest