Bare-Metal Programming of the SAMA5D2 Xplained Ultra Board

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

Hi all,

 

I am trying and failing to program the SAMA5D2 MPU on the SAMA5D2 Xplained Ultra board with the bare-metal "getting_started" example (provided in the SAMA5D2 Software Package). I have the following setup:

 

  • SAMA5D2 Xplained Ultra (Rev. B) Board (powered via a Micro-USB cable connected to J23)
  • Atmel-ICE (connected to my PC and with its 10-pin IDC cable connected from its SAM port to J11 on the board)
  • FTDI TTL-232R-3V3 Cable (connected from my PC to J1 on the board)

 

I have successfully built the "getting_started" code using GNU Make with the command 

make TARGET="sama5d2-xplained"

to produce the binary "getting-started_sama5d2-xplained_sram.bin", but I now don't know how to program this into the SAMA5D2 on the board.

 

I have tried using SAM-BA (first disabling EDBG and external boot by shorting JP1 and JP9 on the board to see "RomBOOT" appear on the terminal after reset) but I cannot connect to the board via J-Link. I have tried the command:

sam-ba -p j-link -b sama5d2-xplained -a bootconfig -c readcfg:bscr

This gives the error:

Error: No J-Link devices found

However, I can connect to the board using a serial link with:

sam-ba -p serial -b sama5d2-xplained -a bootconfig -c readcfg:bscr

This gives the output:

Opening serial port 'COM6'
Connection opened.
Executing command 'readcfg:bscr'
BSCR=0x00000000 / BUREG0
Connection closed.

For my purposes, I need to be able to program the device using JTAG, so continuing further with a serial link is not an option. I have also tried building the same code using IAR (thinking it might be easier to use their Embedded Workbench to program the binary) but the code size exceeds the link-limit for the evaluation version!

 

If anyone can help me do the following I would be very grateful:

 

  1. Connect to the SAMA5D2 on the board using JTAG;
  2. Program the "getting_started" binary into the SAMA5D2;
  3. Debug the binary.

 

Thank you in advance,

Ed King

Last Edited: Tue. Mar 28, 2017 - 02:52 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"Dare to be naïve." - Buckminster Fuller

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

Thanks for the reply.

 

No, I don't think it will be. For context, I am writing some bring-up test firmware for a custom SAMA5D2 board, so I will never boot into anything other than C Runtime. I will instead confirm the interfaces to the external memories and leave it there, which is why I'm using the bare-metal software package.

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

Ed King wrote:
I have tried using SAM-BA ...
An alternative to SAM-BA is BOSSA but SAMA5 is not mentioned (one SAM9 is mentioned)

https://github.com/shumatech/BOSSA

via (for ARM Cortex-M)

http://docs.platformio.org/en/latest/platforms/atmelsam.html#packages

 

"Dare to be naïve." - Buckminster Fuller

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

"Dare to be naïve." - Buckminster Fuller

Last Edited: Wed. Mar 29, 2017 - 06:10 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"Dare to be naïve." - Buckminster Fuller

Last Edited: Wed. Mar 29, 2017 - 06:35 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have now managed to use SAM-BA to program the bare-metal software examples. It turned out that the Atmel-ICE that I had ordered (which I believed supported all ARM devices) only supports Cortex-M cores. The SAMA5D2 has a Cortex-A5 core, which requires a full J-Link compatible ICE, which is the SAM-ICE model.