Jtag Firmware Update

Description

Update Flash Image when booting from MRAM without OTA and without changing bootpads.

How to run

Flash this project:

gap run

At the first binary Flash you need to leave Boot0 and Boot1 pins without jumpers on the EVK (Boot0=1 Boo1=0), which is boot from JTAG.

Then a jumper on J9 can be mounted to select boot from eFuses, the GapMod on the Gap9 EVK are shipped already fused for boot from Mram, if this is not the case you can either put a Jumper on J10 only to select boot from Mram or burn the according eFuse.

When you want to update the mram image use this command to let Gap9 reboot, close all dma channels and enable JTAG:

openocd -c "gdb_port disabled; telnet_port 19867; tcl_port disabled" -f "$GAP_SDK_HOME/utils/openocd_tools/tcl/gapuino_ftdi.cfg" -f "`pwd`/gap9revb_send_jtag_en.tcl"

This TCL script writes the JTAGREG register of Gap9. Opeocd writes the MSB Byte and reads the LSB byte. While Gap9 can only read the MSB and R/W the LSB.

Then you can proeced with a flash:

gap flash

To run the new binary you can either reset the board with the reset button on the EVK or send a reset thorugh nRST pin on the Jtag with OpenOCD:

openocd -c "gdb_port disabled; telnet_port 19867; tcl_port disabled" -f "$GAP_SDK_HOME/utils/openocd_tools/tcl/gapuino_ftdi.cfg" -f "`pwd`/gap9revb_run.tcl"