Running from flash using SAMA5D2 Xplained

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm new to this processor and the XULT dev board.  I'm using IAR Embedded Workbench.

 

I've written my little LED flasher that executes in RAM.  Now I want run out of flash.  My attempts to load flash have not worked.  I use the Segger J-Link device, Project->Download and the verify step fails as the flash appears to be zero rather than my code.  I'm trying to flash at address 0x400000.

 

Any suggestions would be appreciated.

C: i = "told you so";

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So, as is, the bootstrap resides in ROM (address 0x00000000, about 10K) and sets up U-Boot, by copying 0x80000 bytes from 0x8000 (ROM) to 0x26f00000 (in DDR3/SDRAM?).

 

U-Boot appears to pull the Linux kernel from serial flash (AT25DF321), size 0x3636a8 bytes, to location 0x22000000.  Also some Device Tree stuff at 0x21000000 which I presume is used by the kernel(?).

 

I've assembled a Ubuntu box with Linaro ARM cross compiler, and recompiled the bootstrap (at91bootstrap), version 3.8.10.  The XULT came with 3.8.5 installed, so my first task is to use sam-ba.exe to update that.  I'll try the serial connection first, and then the Segger J-Link.  Hopefully I don't brick it.  If so, then what?  Build a restore SD card?

 

Question: U-Boot and Linux are copied from flash to RAM (AFAIK) and executed there.  Is it possible to program flash and run from there?  I.e., can the SAMA5D2 execute code where the Program Counter is pointing to flash memories?

C: i = "told you so";

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

To wrap up, the instructions at the following link are quite useful when programming the XULT.

 

https://community.atmel.com/forum/running-flash-using-sama5d2-xplained

 

Using sam-ba I successfully updated the flash with a newer bootstrap, and then U-Boot.  For whatever reason, the kernel became corrupted, though.  Tried recompiling the kernel and flashing it, following instructions on that page, couldn't quite get it back.  But the page lists an archive (linux4sam-poky-sama5d2_xplained-5.8.zip) that contains the images and batch files to restore the eval board to working order.  Blue blinky is back.

 

C: i = "told you so";