This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

working without DFU, not working with DFU

Hi there,

I had the DFU already working very well for quite some time, but my luck has ended. When I program the application via JLink it works perfectly fine, also the download of the application via secure DFU itself doesnt cause any issues.

My application starts advertising, I can connect but always at the same moment (when I start up an SPI interface and want to start talking to an external ADC) the application resets. I checked the ROM/RAM settings a thousand times, the bootloader address is correct, the RAM settings of the application according to the requirements of the softdevice and also tried many different combinations (mainly different irom sizes of application) but still the same reboot issue which does not appear when downloading the application directly.

I use SDK13, Softdevice S132 4.0.2, nRF52832 with 512KB flash (168KB available when using dual bank dfu) and 65KB RAM (57KB left with Softdevice enabled) and my application is not that big: Program Size: Code=76740 RO-data=6620 RW-data=1688 ZI-data=21800

Any idea what I could be missing?

Thanks a lot, Josef

Parents
  • Hi Hung, Thansk for the feedback! I managed to solve the issue! It was indeed related to the UICR configuration. I programmed my application to set the NFC pins as GPIO, which happened when programming the application via SWD. On the other hand, when updating the application via Bluetooth DFU, the bootloader didn't allow/perform this write, which meant that the pins were not configured as GPIO but still as NFC antenna pins. As soon as my application wanted to access the pins to perform SPI transfers, the microcontroller crashed. I solved the issue by setting the UICR already in the bootloader firmware instead of the application, now it works perfectly.

    Best regards, Josef

Reply
  • Hi Hung, Thansk for the feedback! I managed to solve the issue! It was indeed related to the UICR configuration. I programmed my application to set the NFC pins as GPIO, which happened when programming the application via SWD. On the other hand, when updating the application via Bluetooth DFU, the bootloader didn't allow/perform this write, which meant that the pins were not configured as GPIO but still as NFC antenna pins. As soon as my application wanted to access the pins to perform SPI transfers, the microcontroller crashed. I solved the issue by setting the UICR already in the bootloader firmware instead of the application, now it works perfectly.

    Best regards, Josef

Children
No Data
Related