SOFTDEVICE: INVALID MEMORY ACCESS and NRF_FAULT_ID_APP_MEMACC

Hi,

When  I download the example of "ble_app_uart"(SDK17.0.2  S132) in nRF52832,mty board is working as normal. But when I add RNG in main, the RTT Viewer just logging SOFTDEVICE: INVALID MEMORY ACCESS.

Here is my main code:

int main(void)
{
    bool erase_bonds;
		uint8_t random_value;
    // Initialize.
    uart_init();
    log_init();
    timers_init();
//    buttons_leds_init(&erase_bonds);
    power_management_init();
    ble_stack_init();
    gap_params_init();
    gatt_init();
    services_init();
    advertising_init();
    conn_params_init();

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

		NRF_RNG->CONFIG=1;
		NRF_RNG->TASKS_START=1;
		NRF_RNG->EVENTS_VALRDY=0;
		while(NRF_RNG->EVENTS_VALRDY==0){}
		random_value=NRF_RNG->VALUE;
		NRF_RNG->TASKS_STOP=1;
		NRF_RNG->INTENCLR=0;               
		NRF_RNG->CONFIG=0; 
    // Enter main loop.
    for (;;)
    {
        idle_state_handle();
    }
}

Parents Reply Children
Related