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

Any flag to know it's under UART mode or HRM mode when BLE is connected ?

I encounter a problem to switch to DFU mode from UART when BLE is connected and one 5ms timer keeps running for heart rate sensing alg. Maybe it's the reason keeps BLE busy and missed the signal I send for switing to DFU mode for OTA the firmware. Thus, any flag or command I can use to know which mode I'm running ? i.e. if I'm under UART , then no need to run the timer and OTA should be no problem.

Thank you

Parents
  • Hi David

    Thank you for you question.

    I do not fully understand your scenario. 1) Your 5 ms timer, does it trigger a BLE transmission? 2) What is your connection interval? 3) Do you trigger DFU with the DFU service, i.e. over BLE? 4) What is your UART, is that the UART service or just receiving/sending bytes over UART?

    If you use a DFU service, there is data written into GPREGRET that is written by the DFU service. This data tells if the bootloader should start the application or stay in bootloader mode.

    For an unmodified bootloader: If the application that you have uploaded is not valid for any reason, then the device will start up in bootloader mode after power on reset. The bootloader will also read the GPREGRET register in order to know if a peer device (central device) wants to initiate bootloader mode or not. Perhaps you need to debug the bootloader code in order to know what is going on in your case.

Reply
  • Hi David

    Thank you for you question.

    I do not fully understand your scenario. 1) Your 5 ms timer, does it trigger a BLE transmission? 2) What is your connection interval? 3) Do you trigger DFU with the DFU service, i.e. over BLE? 4) What is your UART, is that the UART service or just receiving/sending bytes over UART?

    If you use a DFU service, there is data written into GPREGRET that is written by the DFU service. This data tells if the bootloader should start the application or stay in bootloader mode.

    For an unmodified bootloader: If the application that you have uploaded is not valid for any reason, then the device will start up in bootloader mode after power on reset. The bootloader will also read the GPREGRET register in order to know if a peer device (central device) wants to initiate bootloader mode or not. Perhaps you need to debug the bootloader code in order to know what is going on in your case.

Children
No Data
Related