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

nRF52832: Setting NRF_SDH_BLE_GATT_MAX_MTU_SIZE to more than 30 cause boot failure

Hello,

I'm trying to write BLE app that talks to Android phone. sometimes I need to set MTU more than 23 bytes so I decided to increase NRF_SDH_BLE_GATT_MAX_MTU_SIZE.

But as soon as I strt debugging app stucks in the middle of nowhere:

and do not run further.

I have feeling that ihas something to do with RAM, but may be I'm wrong.

Does anybody have experience with that?

Parents
  • Hi, 

    When you change your MTU size you should also change the RAM allocation since the RAM usage for the stack will depend on certain things, like the GATT table size, MTU and TX-buffering settings, and similar.

    If you modify NRF_SDH_BLE_GATT_MAX_MTU_SIZE you should adjust RAM start and RAM size for your project. 

    Please see this post

    -Amanda H.

  • Thanks, looks like I fodun how to change RAM start but it's still unclear how to calculate it.

    If I have 0x200022f0 for  MAX_MTU=23, what is the value for 250 bytes?

  • Hi, 

    You should check the log. Please enable the log in the sdk_config.h as

    // <h> nRF_Log 
    
    //==========================================================
    // <e> NRF_LOG_BACKEND_RTT_ENABLED - nrf_log_backend_rtt - Log RTT backend
    //==========================================================
    #ifndef NRF_LOG_BACKEND_RTT_ENABLED
    #define NRF_LOG_BACKEND_RTT_ENABLED 1
    #endif
    
    // <e> NRF_LOG_ENABLED - nrf_log - Logger
    //==========================================================
    #ifndef NRF_LOG_ENABLED
    #define NRF_LOG_ENABLED 1
    #endif

    It will indicate the correct address as:

    <warning> nrf_sdh_ble: Change the RAM start location from 0x2000XXXX to 0x2000XXXX.
    <warning> nrf_sdh_ble: Maximum RAM size for application is 0xXXXX

    Please modify the address as the log suggest.

    If this cannot help you, please provide the log. 

    -Amanda H. 

Reply
  • Hi, 

    You should check the log. Please enable the log in the sdk_config.h as

    // <h> nRF_Log 
    
    //==========================================================
    // <e> NRF_LOG_BACKEND_RTT_ENABLED - nrf_log_backend_rtt - Log RTT backend
    //==========================================================
    #ifndef NRF_LOG_BACKEND_RTT_ENABLED
    #define NRF_LOG_BACKEND_RTT_ENABLED 1
    #endif
    
    // <e> NRF_LOG_ENABLED - nrf_log - Logger
    //==========================================================
    #ifndef NRF_LOG_ENABLED
    #define NRF_LOG_ENABLED 1
    #endif

    It will indicate the correct address as:

    <warning> nrf_sdh_ble: Change the RAM start location from 0x2000XXXX to 0x2000XXXX.
    <warning> nrf_sdh_ble: Maximum RAM size for application is 0xXXXX

    Please modify the address as the log suggest.

    If this cannot help you, please provide the log. 

    -Amanda H. 

Children
Related