- document that the QN9080DK has an alternative firmware for the
debugger/programmer that supports J-Link
- allow selecting the debugger firmware via parameter / environment
variable
- add `JLINK_DEVICE` parameter to allow flashing via J-Link
QN908X CPUs require the image to have a valid checksum. The checksum is
a simple addition of the first 7 uint32_t values stored in the 8th
position of the image header. This position is a reseved entry of the
Cortex-M Vector Table and its value depends on other fields that are
computed at link time. Performing this checksum at link time seems
hard to do, so instead this patch uses a python script to patch the
checksum from the ELF file. This redefines the value of FLASHFILE
to the new .elf file with the checksum fixed.
With this patch, OpenOCD can program and verify QN908X images since
now they have a valid checksum value.
- include serial.inc.mk is not needed as it's handled in the main Makefile.include
- the default serial ports are already defined in serial.inc.mk
- use PROGRAMMER to specify the default programmer (openocd) and don't include openocd.inc.mk
- FLASHFILE is already defined as ELFILE in openocd.inc.mk
Boards based on the qn908x CPU will share the same OpenOCD configuration
regarding the image offset and OpenOCD commands needed to flash the
image directly with "make flash".