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 Reply
  • I have similar code (with changes related to the PHY). 

    The code includes 5 GPIOTE events and when they are triggered, the NUS send a msg over BLE.

    It works with all the 5 with 52832.

    With 52840 it works only with 1 GPIOTE and the msg is LE CODED as designed.

    When I have more than 1 GPIOTE, the code is crashing on RAM and I don't know how to select the correct value (if this is indeed the reason)

Children
Related