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

Why mesh sdk goes to app_error_fault_handler before softdevice being inited?

Hi,

I am testing the light switch sample in mesh sdk 2.2, in server part I need to drive an I2C slave device, which may take some time to init, so I put the init code after this line:

__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "----- BLE Mesh Light Switch Server Demo -----\n");

where is before softdevice being inited, so that it would not influence the sofdevice work.

But, the code always goes to app_error_fault_handler before the init code being finished, the error is Mesh error 17 at 0x00000000.

The init code is just some twi operation and nrf_delay, which should be good because sometimes by running from breakpoint to next breakpoint, the device can work correctly.

I also tried it in nRF5_SDK_15.0.0_a53641a, where it can last longer but also goes to app_error_fault_handler at last.

So why this is happening and how to solve it?

Parents Reply
  • Hi, Hung,

    No problem, thanks for the reply and happy new year !

    Below is the send_cmd code:

    I

    void send_cmd(uint8_t cmd)
    {
    	ret_code_t err_code;
    	uint8_t reg[2];
    	reg[0] = 0x00;
    	reg[1] = cmd;
    	err_code = nrf_drv_twi_tx(&m_twi, AIP31068L_ADDR, reg, 2, false);
    	APP_ERROR_CHECK(err_code);
        while (m_xfer_done == false);
    }

    The delay times were from device datasheet, As the code shows, they would not influence the TWI transfer.

    Though, I'll take a try to increase them.

Children
Related