Appearance
Getting Started: Flashing & Debugging
Flashing
To flash the binary, assuming you went with the SEGGER J-Link
- connect the J-Link to your Computer's USB Port and to the device hardware - the hardware needs to be powered up by an external supply, J-Link doesn't provide the supply power itself.
- run
JLink.exe
(orJLinkEXE
on MacOSX) and enterconnect
to connect to the device. - the first time you flash your application, the bootloader needs to be installed: on the JLink Executable's command line enter
loadfile [AppName]-[version]-boot.hex
- you might need to provide the full path to the hex file here, if it is not in the same path, you started J-Link from - repeat step 3, but with the command
loadfile [AppName]-[version].hex
- wait for the process to complete and then restart the hardware via JLink Commandline
r <Enter>
, theng <Enter>
- If you want to see log output, open a second terminal window and start JLinkRTTClient(.exe)
Debugging
If you want to debug from your IDE, the binary has to be signed every time before a version is uploaded. The Coldwave OS build system supports this, if you pass the fololowing two variables to CMake:
-DSIGN_AND_UPLOAD=TRUE
-DPATH_TO_JLINK_COMMANDER_EXE=<path_to_jlink_executable>
The target you need to select when building your application is [AppName]-[version]-signed You can try, if the automatic signing and uploading works, by calling ninja [AppName]-[version]-signed
from within the cmake-build-debug
build directory.
INFO
The upload.jlink
script in the coldwave-os
directory assumes you are using the SWD port of your Cortex-M MCU. If you for some reason prefer JTag, you need to alter the script manually by removing the line si 1
from it.