Artemis JTAG Programming

I’ve had Artemis stuff on the backburner so haven’t been able to resolve some of the issues detailed in other posts. But my JTAG Programmer (J-Link EDU from Sparkfun) has arrived and… is being troublesome.

I followed the Sparkfun JTAG programming tutorial at https://learn.sparkfun.com/tutorials/arm-programming including:

  • (Using Windows 10)

  • Download J-Link software and update firmware on programmer

  • Programmer is recognised under Universal Serial Bus Controllers in Device Manager (no associated COM ports, in case anyone was wondering)

  • Connect to an Artemis Blackboard using the JTAG header and cables

  • Download and install Atmel Studio 7.0… however under Tools->Device Programming, “Simulator” is the only tool I can select

Using J-Flash V6.48b, not only is the programmer recognised, but I can “connect” and “disconnect” from the Artemis Blackboard, so apparently it’s a problem with Atmel Studio? And independent of the actual target board.

Some Sparkfun clarification on this would be great.

I presume J-Flash can also be used to program the Artemis, but addresses for the 2x bootloaders and the main code will be necessary. Info/guidance would be appreciated. If I get a chance I’ll do some more research/experimenting and post findings.

Steve

Hi Steve,

I haven’t used Atmel Studio with the Apollo3 microcontroller. Presumably it should work well enough as a GUI for uploading binaries however I’ve always just stuck to using J-flash directly. So I am interested to hear what you find out about using AS7.

I can give you some information about important memory locations, however. (Since you have a programmer most of these options are reconfigurable, so I’ll just be speaking to how it comes from us at SF.)

The Ambiq Secure Bootloader (that’s our terminology, they call it the Secure Bootloader – but SBL is too hard to distinguish from ‘SVL’ in conversation) is configured with a main image location of 0xC000. This is where the processor jumps after reset. You can configure this and other ASB settings by following these instructions:

viewtopic.php?f=164&t=50266&hilit=confi … er#p206278

The SparkFun Variable Loader, when present (such as from the factory) is loaded as a main image at the 0xC000 address. From there it will place a user application at 0x10000.

Factory settings:

  • main entry point: 0xC000

  • image location to preserve SVL: 0x10000

May I know how you’re planning to use the programmer? How will you be building binaries to flash to the chip? Mainly just curious what your use case is to get a feel for what kind of support we might want to consider in the future.

Thanks LS for the address info. I’ll continue to play around when I have a chance (probably not until next week).

To be honest, I don’t really know what I’m doing with JTAG anything. I got the programmer as a “just in case” I bricked something, which it appears I (sort of) have.

So by “Sparkfun clarification” I probably should have asked for some Artemis-specific step by step JTAG programming instructions by whatever means (if I figure it out, I will post one). Starting from compiling code in Arduino IDE, and then grabbing the .hex file. With screenshots would be amazing. Ie. are your “main entry point” and “image location to preserve SVL” equivalent to “Internal Bank 0” and “Internal Bank 1”? Ie. what settings in Arduino IDE for compilation, and in J-Link?

The ARM-programming tutorial is what said to use AS7, but the issue is not with the chip, it’s that AS7 won’t even recognise the (recommended in the tutorial) programmer.

I’m pleased to report that JTAG programming is working for me, and to provide a how-to for dummies (like me):

  1. Background. A Sparkfun tutorial on JTAG programming is here https://learn.sparkfun.com/tutorials/arm-programming useful for background, but (surprisingly, as Sparkfun tutorials are usually excellent) I hit a brick wall trying to follow it.

  2. Hardware. I’m on Windows 10, with Arduino 1.8.9, Core 1.0.6, and an Artemis Blackboard. JTAG Programmer (Segger J-Link EDU from Sparkfun)

  3. Software - use J-Flash Lite (v6.48b for me). Should come as part of the J-Link package that you download to update firmware. I previously tried…

a) J-Flash (requires a better than EDU license to write flash)

b) J-Link Commander (wouldn’t recognise the upload file)

c) ATMEL Studio 7 per the Sparkfun tutorial (wouldn’t recognise the programmer)

  1. Software again - J-Flash, and J-Link can both be used to test the connection (find the “connect” option) if you’re so inclined

  2. Programming. Make physical connections, ensure the board is independently powered (USB is ok). COMPILE SKETCH IN ARDUINO IDE (to generate binary file for upload). Run J-Flash Lite and use settings:

a) Device: AMA3B1KK-KBR

b) Interface: SWD

c) Speed: 4000kHz

d) Data file: click the 3 dots to browse to the build folder from Arduino IDE ( C:\Users<Your Name>\AppData\Local\Temp\arduino_build_337995 ) and select the .bin file. Yep, there is no .hex!

e) Prog Addr (bin file only): 0x10000 (default, preserves SVL bootloader), or 0xC000 (writes over the SVL bootloader with your application code, and you will need to burn bootloader to program again with Arduino IDE), or presumably 0x000 would write over the Ambiq Secure Bootloader (I was too chicken to try that!)

f) (make sure if you’re doing a dodgy hold-the-connector-in-place, that all pins are contacting) Click “Program Device”

g) Messages will come up in the log, hopefully indicating things went well

Awesome guide! Thanks a bunch for writing that all up. I’ll keep the link handy for the next time someone is asking about JTAG programming