Unable to perform Secure DFU buttonless after disabling log_init function

SoftDevice: s140_nrf52_7.2.0_softdevice
SDK: nRF5_SDK_17.0.2_d674dde

Problem:
We trying to use the Secure DFU buttonless feature on our custom board. Our custom board has a buzzer and led attached to GPIOs P0.06 and P0.15 respectively. Both are Active high. The buzzer starts buzzing continuously and the led starts blinking if we update the program. The issue is solved if we comment the log_init() function. log_init() function is already provided in SDK. A snippet of log_init() function is given below:


If we comment log_init() function the buzzer and led issue is resolved but we are unable to perform buttonless DFU on the custom Board. If we uncomment the log_init() function then the buzzer starts buzzing continuously and led blinks but we are able to perform buttonless DFU on a custom board. A snippet of main function is given below:

The log_init() function further calls other functions and there are many layers of abstraction can you tell me what is in log_init() function that is causing buzzer and led behaviour

Regards,
Moghees Bin Zahid

  • Hello Moghees,

    What log backend did you use before you turned it off? UART or RTT?

    And I assume you are using a BLE bootloader, correct? Meaning that you transfer the application DFU image using BLE, or do you transfer the application DFU image using serial?

    I'm trying to think of possible reasons. You say that you have a buzzer connected to P0.06. How do you set this up, and how do you control it? The reason I ask is because if you use the UART backend, then P0.06 is used as the UARTs TX pin, which is probably why you hear the buzzer being constantly on. UART is active low, so while it is not actually transmitting any log, it is default high. 

    As to why you can't perform the DFU after you turn off the log, I am not sure. Perhaps you never initialized the pin for the buzzer (which was ok when the log was enabled, because the TX pin was set as an output pin when the log was initialized), but when you tried to control the buzzer when the TX pin was not initialized, it crashes and the application restarts. That is one thing that might happen.

    It should be possible to perform DFU without logging enabled, but without knowing more about your project/application, it is not easy to say what's going on. When the log is turned off, are you able to see the advertisements? Are you able to connect to it? Are you able to start the DFU, but it doesn't finish?

    Are you able to replicate this on a DK?

    Best regards,

    Edvin

Related