I have a finished sketch that I would like to load and run "naked" on a Nano 33 BLE without bootlader.
The purpose is to make it start faster without the delay that the bootloader always imposes while listening for a connection.
For that I bought a cheap CMSIS-DAP programmer from Alex Taradov and made the 5-pin connector for the SWD pins on the underside of the Nano.
I made sure that the whole thing worked together by burning sucessfully the bootloader using the SWD pins.
Now I want to upload my compiled sketch into the Nano, overwriting the existing bootloader. How to do it ?
if it works it will not delete the bootloader. for that you have to create a custom variant with a different linker script putting the binary together to address 0.
in my_boards I have a M0 variant without bootloader
Ok, I created the variant structure inside my sketch:
C:\Users\pjr\Google Drive\wf_meter\wf_meter_v2\hardware\my_boards\nrf52\variants\ARDUINO_NANO33BLE
Now, I suppose I have to change the location where the sketch will be loaded ?
Ok, I created the variant structure inside my sketch:
C:\Users\pjr\Google Drive\wf_meter\wf_meter_v2\hardware\my_boards\nrf52\variants\ARDUINO_NANO33BLE
Now, I suppose I have to change the location where the sketch will be loaded ?
Is it -DMBED_APP_START inside ldflags.txt ?
the location should be the hardware folder in the sketchbook folder. the sketchbook folder is configured in Preferences.
for M0 I changed in .ld
FLASH (rx) : ORIGIN = 0x00000000+0x4000, LENGTH = 0x00040000-0x4000
to
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000
so I guess you should change something in linker_script.ld
Indeed, while the port appears visible, I'm unable to upload the sketch over USB anymore.
However, the sketch still takes the same time as before to start running.
pjrebordao:
Indeed, while the port appears visible, I'm unable to upload the sketch over USB anymore.
However, the sketch still takes the same time as before to start running.
The non-AVR boards have bootloaders that work significantly differently, and the erasure of the AVR bootloader when you "upload using programmer" is more of an unavoidable side-effect than a feature.
You probably have to explicitly erase or replace the bootloader code to get rid of it.
What sort of startup time do you need to achieve?
For example, there's a ~0.5s pause while the bootloader checks for "double tap reset", and (I guess) a longer pause waiting for traffic. One elegant solution would be to change the startup to ONLY enter the bootloader on the double-tap...
westfw:
What sort of startup time do you need to achieve?
For example, there's a ~0.5s pause while the bootloader checks for "double tap reset", and (I guess) a longer pause waiting for traffic. One elegant solution would be to change the startup to ONLY enter the bootloader on the double-tap...