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?
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.
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?
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
#define NRF_LOG_BACKEND_RTT_ENABLED 1
// <e> NRF_LOG_ENABLED - nrf_log - Logger
#define NRF_LOG_ENABLED 1
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.
I already have log enabled but I don't see such messages.
What is the equation to calculate RAM offset?
There is no equation to calculate the RAM offset, but the log will indicate that.
Could you provide the log?