2020-05-24 11:47:07 -04:00
|
|
|
# This script programs the bootloader and the firmware application using J-Link debugger.
|
|
|
|
|
|
|
|
gdb_flash_program enable
|
|
|
|
gdb_breakpoint_override hard
|
|
|
|
|
|
|
|
$_TARGETNAME configure -event reset-init {
|
|
|
|
# Arm Semihosting is used to show debug console output and may only be enabled after init event. We wait for the event and enable Arm Semihosting.
|
|
|
|
echo "Enabled ARM Semihosting to show debug output"
|
|
|
|
arm semihosting enable
|
|
|
|
}
|
|
|
|
|
|
|
|
# Connect to the device.
|
|
|
|
init
|
|
|
|
|
|
|
|
echo "Stopping..."
|
|
|
|
reset
|
|
|
|
halt
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
# Flashing Bootloader
|
|
|
|
echo "Flashing bootloader..."
|
2020-09-20 05:29:56 -04:00
|
|
|
program ./bootloader-5.0.4.elf verify 0x00000000
|
2020-05-24 11:47:07 -04:00
|
|
|
|
|
|
|
# Flashing Application
|
|
|
|
echo "Flashing application..."
|
|
|
|
program ./image.bin verify 0x00008000
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
# Restart the device and start the bootloader.
|
|
|
|
echo "Restarting..."
|
|
|
|
reset
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
echo "**** Done! Press Ctrl-C to exit..."
|