Using OpenOCD with the ATSAM4E-XPRO development board

Hello all,

I recently bought an ATSAM4E-XPRO development board. I want to use OpenOCD to interface with this board. The most important functionality at this point would be uploading / starting executable images; later on it will be useful to use GDB for remote debugging.

I am using Debian that includes OpenOCD v0.9.0. If I list supported atmel boards (/usr/share/openocd/scripts/board/atmel_*) I see a bunch of boards that appear close, but the atmel_sam4e_xplained_pro.cfg is not among them:

atmel_at91sam7s-ek.cfg

atmel_at91sam9260-ek.cfg

atmel_at91sam9rl-ek.cfg

atmel_sam3n_ek.cfg

atmel_sam3s_ek.cfg

atmel_sam3u_ek.cfg

atmel_sam3x_ek.cfg

atmel_sam4e_ek.cfg

atmel_sam4l8_xplained_pro.cfg

atmel_sam4s_ek.cfg

atmel_sam4s_xplained_pro.cfg

atmel_samd20_xplained_pro.cfg

atmel_samd21_xplained_pro.cfg

atmel_samg53_xplained_pro.cfg

atmel_saml21_xplained_pro.cfg

atmel_samr21_xplained_pro.cfg

I have two questions:

(1) I presume writing a config file for the board I have can be as simple as taking one of the existing configs and changing one or two things. What would be the best starting point, and what would I need to change?

(2) Once I can contact the board, what is a sequence of commands or script to transfer an executable image compiled on my host machine and start it?

I checked the manual but it is still a bit daunting (given that this is my first encounter with OpenOCD). So any help will be greatly appreciated!

Kind regards,

Sidney

Hello reddish,

I am new to openocd, and I have the same questions for using an ATSAMB11-MR510CA development board.

Did you find any solution on how to use *.cfg files as example for your board ?

Thanks !

kev

Hi Kev,

It turns out that the SAM4E EK board configuration works on my XPlained Pro board as well. After compilation, to upload an image, I simply do this from the Linux command line:

sudo openocd -f interface/cmsis-dap.cfg -f board/atmel_sam4e_ek.cfg -c "program image.elf verify reset exit"

So you may get lucky just trying a config file that is close to your board, as long as it lists the correct Atmel microcontroller model there’s a decent chance it will work.

Regards Sidney