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

52840 LE CODED App_UART with GPIOTE - crash

The code is running on 52832 (BLE) and transmit msg over BLE (NUS) each time GPIO is active (GPIOTE).

But same code (after adding LE CODED Phy) is crashing once it reached the GPIOTE initialization 

What can be the problem?

here is my main code:

int main(void)
{
bool erase_bonds;
uint32_t err_code;
// Initialize.
//uart_init();
log_init();
NRF_LOG_INFO("Start");
timers_init();
buttons_leds_init(&erase_bonds);
power_management_init();
ble_stack_init();
gap_params_init();
app_timer_start(bas_timer, APP_TIMER_TICKS(20* 1000), NULL);
gatt_init();

services_init();
advertising_init();
conn_params_init();
err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, m_advertising.adv_handle, TX_POWER);
APP_ERROR_CHECK(err_code);
if (!nrf_drv_gpiote_is_init())
{
err_code = nrf_drv_gpiote_init();
VERIFY_SUCCESS(err_code);
}
nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_HITOLO(true);
in_config.pull = NRF_GPIO_PIN_PULLUP;
err_code = nrf_drv_gpiote_in_init(PIN_IN1, &in_config, in_pin_handler1);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_gpiote_in_init(PIN_IN2, &in_config, in_pin_handler2);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_gpiote_in_init(PIN_IN3, &in_config, in_pin_handler3);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_gpiote_in_init(PIN_IN4, &in_config, in_pin_handler4);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_gpiote_in_init(PIN_IN5, &in_config, in_pin_handler5);
APP_ERROR_CHECK(err_code);

nrf_drv_gpiote_in_event_enable(PIN_IN1, true);
nrf_drv_gpiote_in_event_enable(PIN_IN2, true);
nrf_drv_gpiote_in_event_enable(PIN_IN3, true);
nrf_drv_gpiote_in_event_enable(PIN_IN4, true);
nrf_drv_gpiote_in_event_enable(PIN_IN5, true);


// Start execution.
//printf("\r\nUART started.\r\n");
NRF_LOG_INFO("Debug logging for UART over RTT started.");
advertising_start();

Parents
  • After debug, I can see that I reach a warning of RAM size and then next line it crashes.

    If it is RAM issue, how do I know which values should I use:

    // Start of RAM, obtained from linker symbol.
    uint32_t const app_ram_start_link = *p_app_ram_start;

    ret_code_t ret_code = sd_ble_enable(p_app_ram_start);
    if (*p_app_ram_start > app_ram_start_link)
    {
    NRF_LOG_WARNING("Insufficient RAM allocated for the SoftDevice.");

    NRF_LOG_WARNING("Change the RAM start location from 0x%x to 0x%x.",
    app_ram_start_link, *p_app_ram_start);
    NRF_LOG_WARNING("Maximum RAM size for application is 0x%x.",
    ram_end_address_get() - (*p_app_ram_start));
    }

  • This warning means you have to adjust the RAM settings in your linker settings. The debug log should tell you what settings to use.

    What IDE/toolchain are you using?

Reply Children
Related