adafruit / Adafruit_nRF52_Bootloader

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

[Bug]Does not seem to run applications built with nRF5 SDK #199

Closed overkillprojects closed 3 years ago

overkillprojects commented 3 years ago

Describe the bug Working applications built with the native Nordic nRF5 SDK are not working when the UF2 file is loaded to an ItsyBitsy nRF52840

Set up (please complete the following information)

To Reproduce Steps to reproduce the behavior:

  1. Create a BLE application that uses the SoftDevice (in my case the ble_app_blinky example with the LED location modified to the LED on the ItsyBitsy at P0.6).
  2. Create a UF2 from the .hex file by issuing the command uf2conv.py ble_app_blinky_pca10056_s140 -c -f 0xADA52840
  3. Ensure that the upload location is 0x26000 (although uploading to 0x27000 - the default for SD v7.2.0 - also doesn't work),
  4. Upload UF2
  5. Notice that the application is not advertising, LEDs aren't lighting, etc.

Expected behavior The application should work. I should also mention that things seem to work fine with non-SoftDevice applications as long as they are loaded to 0x26000.

Screenshots I can send a screenshot of me uploading the file if someone thinks it will help.

Additional context I can debug these applications perfectly via J-Link on other ItsyBitsy boards, so I know they are working with both SD v6.1.1 and v7.2.0. When I do the same with an example without BLE, things work fine. With the SoftDevice, they don't work. At first I thought they might be loaded to the wrong address, but I can see plainly in the .uf2 (using hex editor) that the file address is 0x026000, so that doesn't seem to be the issue. Since you can't really debug this (unless someone wants to tell me how) I'm not really sure how to proceed.

overkillprojects commented 3 years ago

Okay, so in typical fashion I'm an idiot. I swear I tried reloading the bootloader before and saw no difference, but I did it again and not the application works. My best guess is that I must have tried to load a version of the UF2 that had a memory address that stepped on the SD, preventing it from working for subsequent loads. Sorry for the inconvenience!