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

Regarding the Uart not working as per intended in release mode... or without the debugger connected to the chip

Hi , 

In my application .. I have define two custom characteristics one with write permission and other with read + notify permission... 

Whenever a value is written to the characteristics with write permission it is transmitted over uart to my MCU as it is..

The string recieved by the  MCU is processed and the appropriate response string is sent  back to the nrf52810 chip over uart, which inturn updates the characteristics with read + notify permission.

Above mentioned functionality  is working fine when the chip is connected to my Debugger/Programmer (nrf52840 DK ) and the application is run in Debug Mode..

but when Debugger is disconnected and board is power cycled...  I could write data to write characteristics and it is written as expected over uart to my MCU, My MCU is forming the response and sending the same over UART to NRF52810 chip  (This is been verified physically over uart lines and also reading my MCU UART registers in Debug Mode)

the Data received over the UART by the NRF52810 chip as response to  is not updated over the read  + notify characteristics... 

Can you please help to understand, where should i look or how should I overcome this issue.

Please find enclosed code for your review and comment... suspect it has something to do with the timing, but not sure how to work around on the same, as it seems to work perfectly fine when the application is run over my PC with the debugger connected to the NRF52810 chipset

Thanks and Regards

Sijeo Philippca10040e.rar

Parents
  • # SEGGER J-Link RTT Viewer V6.81c (beta) Terminal Log File
    # Compiled: 17:41:02 on Jun 19 2020
    # Logging started @ 20 Jun 2020 21:13:01
    00> <info> app: DisConnected.
    00> 
    00> <info> peer_manager_handler: Connection secured: role: Peripheral, conn_handle: 0, procedure: Encryption
    00> 
    00> updating the custom valueNotification Done<info> app: Fast advertising.
    00> 
    00> <info> app: Disconnected.
    00> 
    00> <info> app: DisConnected.
    00> 
    00> <info> peer_manager_handler: Connection secured: role: Peripheral, conn_handle: 0, procedure: Encryption
    00> 
    00> updating the custom valueNotification Done<info> app: Fast advertising.
    00> 
    00> <info> app: Disconnected.
    00> 
    00> <info> app: Sleep Mode.
    00> 
    00> <error> app: Fatal error
    00> 
    00> <warning> <info> app: Sleep Mode.
    00> 
    00> <error> app: Fatal error
    00> 
    00> <warning> <info> app: Sleep Mode.
    00> 
    00> <error> app: Fatal error
    00> 
    00> <warning> <info> app: Sleep Mode.
    00> 
    00> <error> app: Fatal error
    00> 
    00> <warning> <info> app: Fast advertising.
    00> 
    00> <info> app: Sleep Mode.
    00> 
    00> <error> app: Fatal error
    00> 
    00> <warning> <info> app: Fast advertising.
    00> 
    00> <info> app: Sleep Mode.
    00> 
    00> <error> app: Fatal error
    00> 
    00> <warning> <info> app: Fast advertising.
    00> 
    00> <info> app: DisConnected.
    00> 
    00> <info> app: Fast advertising.
    00> 
    00> <info> peer_manager_handler: Connection security failed: role: Peripheral, conn_handle: 0x0, procedure: Bonding, error: 4352
    00> 
    00> <info> app: Disconnected.
    00> 
    00> <info> app: Sleep Mode.
    00> 
    00> <error> app: Fatal error
    00> 
    00> <warning> <info> app: Fast advertising.
    00> 
    00> <info> app: Sleep Mode.
    00> 
    00> <error> app: Fatal error
    00> 
    00> <warning> <info> app: Sleep Mode.
    00> 
    00> <error> app: Fatal error
    00> 
    00> <warning> <info> app: Sleep Mode.
    00> 
    00> <error> app: Fatal error
    00> 
    00> <warning> <info> app: Sleep Mode.
    00> 
    00> <error> app: Fatal error
    00> 
    00> <warning> <info> app: Sleep Mode.
    00> 
    00> <error> app: Fatal error
    00> 
    00> <warning> <info> app: Sleep Mode.
    00> 
    00> <error> app: Fatal error
    00> 
    00> <warning> <info> app: Fast advertising.
    00> 
    
    RTT Logging seems to be a good idea... attaching the log for your review and comment... One thing i could come accross was Once the data is recieved through UART ble_cus_custom_value_update function is called... 

    Sometime the err_code = sd_ble_gatts_hvx( p_cus->conn_handle, &hvx_params ) is executed and successfully updates the notification characteristics on the nrf connect soon after  it switches to fast advertising mode and then disconnects, 

    Sometimes after executing sd_ble_gatts_hvx( p_cus->conn_handle, &hvx_params ) api in the application, the data is not updated on the apk as it quickly switches over to fast advertising mode and disconnects after which it ends up in Fatal Error

    Please do let me know if possible how I can avoid the device going to fast advertising mode and then leading to disconnection... any pointers for me to look into

Reply
  • # SEGGER J-Link RTT Viewer V6.81c (beta) Terminal Log File
    # Compiled: 17:41:02 on Jun 19 2020
    # Logging started @ 20 Jun 2020 21:13:01
    00> <info> app: DisConnected.
    00> 
    00> <info> peer_manager_handler: Connection secured: role: Peripheral, conn_handle: 0, procedure: Encryption
    00> 
    00> updating the custom valueNotification Done<info> app: Fast advertising.
    00> 
    00> <info> app: Disconnected.
    00> 
    00> <info> app: DisConnected.
    00> 
    00> <info> peer_manager_handler: Connection secured: role: Peripheral, conn_handle: 0, procedure: Encryption
    00> 
    00> updating the custom valueNotification Done<info> app: Fast advertising.
    00> 
    00> <info> app: Disconnected.
    00> 
    00> <info> app: Sleep Mode.
    00> 
    00> <error> app: Fatal error
    00> 
    00> <warning> <info> app: Sleep Mode.
    00> 
    00> <error> app: Fatal error
    00> 
    00> <warning> <info> app: Sleep Mode.
    00> 
    00> <error> app: Fatal error
    00> 
    00> <warning> <info> app: Sleep Mode.
    00> 
    00> <error> app: Fatal error
    00> 
    00> <warning> <info> app: Fast advertising.
    00> 
    00> <info> app: Sleep Mode.
    00> 
    00> <error> app: Fatal error
    00> 
    00> <warning> <info> app: Fast advertising.
    00> 
    00> <info> app: Sleep Mode.
    00> 
    00> <error> app: Fatal error
    00> 
    00> <warning> <info> app: Fast advertising.
    00> 
    00> <info> app: DisConnected.
    00> 
    00> <info> app: Fast advertising.
    00> 
    00> <info> peer_manager_handler: Connection security failed: role: Peripheral, conn_handle: 0x0, procedure: Bonding, error: 4352
    00> 
    00> <info> app: Disconnected.
    00> 
    00> <info> app: Sleep Mode.
    00> 
    00> <error> app: Fatal error
    00> 
    00> <warning> <info> app: Fast advertising.
    00> 
    00> <info> app: Sleep Mode.
    00> 
    00> <error> app: Fatal error
    00> 
    00> <warning> <info> app: Sleep Mode.
    00> 
    00> <error> app: Fatal error
    00> 
    00> <warning> <info> app: Sleep Mode.
    00> 
    00> <error> app: Fatal error
    00> 
    00> <warning> <info> app: Sleep Mode.
    00> 
    00> <error> app: Fatal error
    00> 
    00> <warning> <info> app: Sleep Mode.
    00> 
    00> <error> app: Fatal error
    00> 
    00> <warning> <info> app: Sleep Mode.
    00> 
    00> <error> app: Fatal error
    00> 
    00> <warning> <info> app: Fast advertising.
    00> 
    
    RTT Logging seems to be a good idea... attaching the log for your review and comment... One thing i could come accross was Once the data is recieved through UART ble_cus_custom_value_update function is called... 

    Sometime the err_code = sd_ble_gatts_hvx( p_cus->conn_handle, &hvx_params ) is executed and successfully updates the notification characteristics on the nrf connect soon after  it switches to fast advertising mode and then disconnects, 

    Sometimes after executing sd_ble_gatts_hvx( p_cus->conn_handle, &hvx_params ) api in the application, the data is not updated on the apk as it quickly switches over to fast advertising mode and disconnects after which it ends up in Fatal Error

    Please do let me know if possible how I can avoid the device going to fast advertising mode and then leading to disconnection... any pointers for me to look into

Children
No Data
Related