You are reading a single comment by @user156811 and its replies.
Click here to read the full conversation.
-
Ok so i don't think i'm running into a "error" --overlap. It seems like it part of the build script?
So there seems to be two types of defines
- BOOTLOADER
- USE_BOOTLOADER
And in my python board file i have 'bootloader' : 1. This one is sets USE_BOOTLOADER to true.
As for BOOTLOADER
- BOOTLOADER=1 make the bootloader (not Espruino)
$(PROJ_NAME).hex: $(PROJ_NAME).app_hex ifdef USE_BOOTLOADER ifdef BOOTLOADER @echo Bootloader - leaving hex file as-is @mv $(PROJ_NAME).app_hex $(PROJ_NAME).hex # for testing: [#python](https://forum.espruino.com/search/?q=%23python) scripts/hexmerge.py --overlap=replace $(SOFTDEVICE) $(PROJ_NAME).app_hex -o $(PROJ_NAME).hex else @echo Merging SoftDevice and Bootloader @# build a DFU settings file we can merge in... family can be NRF52840 or NRF52 nrfutil settings generate --family $(BOOTLOADER_SETTINGS_FAMILY) --application $(PROJ_NAME).app_hex --app-boot-validation VALIDATE_GENERATED_CRC --application-version 0xff --bootloader-version 0xff --bl-settings-version 2 $(OBJDIR)/dfu_settings.hex @echo FIXME - had to set --overlap=replace python scripts/hexmerge.py --overlap=replace $(SOFTDEVICE) $(NRF_BOOTLOADER) $(PROJ_NAME).app_hex $(OBJDIR)/dfu_settings.hex -o $(PROJ_NAME).hex endif else @echo Merging SoftDevice python scripts/hexmerge.py $(SOFTDEVICE) $(PROJ_NAME).app_hex -o $(PROJ_NAME).hex endif # USE_BOOTLOADER
```
- BOOTLOADER
I'm surprised you hit issues with
--overlap=replace
- my understanding was that's only really needed if the hex files overlap - and if they're overlapping generally that's probably going to cause you some problems as something is too big?On the debug front, it's a nightmare with nRF52 because the softdevice tries to restart if it realises the CPU is halted for much time. There is a
wdt_off
GDB macro at https://github.com/espruino/Espruino/blob/master/.gdbinit#L31-L33 that you can call the very first time you break execution after the softdevice is started and I believe that will stop the reboot, but bluetooth connections will still completely break as soon as you start breakpointing stuff.