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

nRF52 ANT DFU, hangs at wait_for_events()

Hello, I'm trying to implement a buttonless DFU via ANT for a custom nRF52 board. I've got the 212 v4.02 Softdevice and I'm using the 14.0.0 SDK. I am able to transmit and receive via ANT, I am able to go into my bootloader, and I can progress through the bootloader until I hit the "err_code = bootloader_dfu_start();" line. This function progresses until it hits "wait_for_events()". At this point it just hangs waiting for (I assume) an ANT event that never occurs.

When I attempt to connect to the device via "OTAUpdater.exe" I am unable to, thus no ANT event. I set the manufacturer ID and product ID to wildcard (0), select nRF52 as the platform, and it is unable to see my board. When the ANT-FS in the bootloader times out (~2 minutes via default setting), it kicks me back to my main program code, at which point ANT broadcasting starts working immediately.

I am able to perform an OTA update on my nRF52 DK using the same method I am trying with my custom device. Any suggestions?

  • So it works perfectly on the nRF52 DK? Any important hardware differences between the nRF52 DK and the custom board?

  • Hi Petter,

    Yes, it works fine on the nRF52 DK. There are a bunch of hardware differences between my custom device and the DK, but ultimately I don't know how they would contribute to this issue. Both are using the nRF52832, but mine is on a custom board without any of the same buttons, LEDs, onboard programming. Mine is using an external crystal that meets ANT spec, uses a different VReg system, connects to peripherals over the TWI interface, etc. etc. Keep in mind, I am attempting to do this buttonless (which I've been able to do on the DK).

    Again, the weird part is that I am able to broadcast ANT in the application code, so I don't understand why it wouldn't be able to do the DFU stuff in the bootloader code. Is there something on the hardware side of things that makes DFU possible? What else should I be looking at?

  • Quick update, when I try to debug the DFU stuff I am able to breakpoint up until it enters bootloader_dfu_start(), but I can't breakpoint within the bootloader.c code, so it's hard to get an idea of what is going on in the registers.

  • Just to confirm, you have a LFXO witha frequency tolerance less than 50 ppm? It is weird that it works in application code, and on the nRF52 DK as well.

    Have you tried to use the bootloader directly? It is a shot in the dark though. Sounds to me like it is some kind of hardware issue, but I'm not sure what. Have you tested with several of these custom boards?

  • Yes, I'm using an external crystal with a tolerance of 40ppm.

    I don't really follow when you say use the bootloader directly as I am using the bootloader. I am able to parse an incoming ANT event, set a persistent flag, and read the flag in the bootloader. That's how I'm pushing to the DFU mode, but once I progress through that it hangs/times out as I described previously.

    I'm going to get another one of my custom boards later today and I will try and investigate if it's a hardware issue, but I don't really understand how it could be.

Related