adafruit / Adafruit_nRF52_Bootloader

USB-enabled bootloaders for the nRF52 BLE SoC chips
MIT License
438 stars 393 forks source link

Stuck in DFU mode after flashing[Bug] #201

Closed coriolan-v closed 3 years ago

coriolan-v commented 3 years ago

Describe the bug Hi everyone, I've got a nrf52840 module on a custom PCB that works quite well. However after flashing the bootloader and firmware, the module is stuck on DFU mode. Even if I unplug it and plug it again, it still goes straight in DFU and shows the fake "USB drive". The only way I found out of this is to copy the CURRENT.UF2 file to the Desktop, then copy it again to the drive (and replace it) and that successfully exits DFU mode even if I remove and plug the board! Any ideas?

The INFO_UF2.TXT files gives this: UF2 Bootloader 0.3.2 lib/nrfx (v2.0.0) lib/tinyusb (legacy-1500-g23df777b) s140 6.1.1 Model: Adafruit Feather nRF52840 Express Board-ID: nRF52840-Feather-revD Date: Mar 12 2020

Set up (please complete the following information)

To Reproduce These are the commands I use:

  1. Flash bootloader nrfjprog.exe --program feather_nrf52840_express_bootloader-0.3.2_s140_6.1.1.hex -f nrf52 --chiperase --reset

  2. Flash firmware nrfjprog.exe --reset --program myfirmware-0.1.hex --sectorerase -f nrf52

Is there an extra parameter to add when I flash the firmwre to make the MCU exit DFU mode and boot into normal mode straight away? Thanks!

hathach commented 3 years ago

you need to either write an correct CRC checksum of firmware or magic that force it to skip CRC to the right address. doing it via uf2 will disable the crc check. This is mentioned several times in the issues, try to look it up.