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

Mesh error code 4

Hi,

I'm modifying the light_switch client example, so that I can use GPIO as input instead of the button. I was able to build the modified example in SES and download it to the DK. When I look at the log in RTT viewer I'm getting the following error:

0> <t: 0>, main.c, 328, ----- BLE Mesh Light Switch Client Demo -----
0> <t: 0>, mesh_softdevice_init.c, 112, Initializing SoftDevice...
0> <t: 0>, mesh_softdevice_init.c, 77, Enabling BLE...
0> <t: 1>, mesh_softdevice_init.c, 88, Ram base: 0x200032C8
0> <t: 582>, main.c, 233, Initializing and adding models
0> <t: 587>, app_error_weak.c, 105, Mesh error 4 at 0x00000000 (:0)

The four LEDs on the DK are on.

I've made following changes to the code:

1. I've commented all the lines related to the button function.

2. I've added gpiot_init and input_handler functions from pin_change_init.

3. I've added the nrf_gpiote.c to the project under nrf5DK folder and added all header files to the preprocessor.

Please help me to resolve the error.

Regards,

Sunil

Parents
  • It is APP_ERROR_CHECK failure in your application and It is quite easy to debug this.

    In app_error_weak.c function comment out velow

    #ifndef DEBUG
        NRF_LOG_WARNING("System reset");
        NVIC_SystemReset();
    #else
        app_error_save_and_stop(id, pc, info);
    #endif // DEBUG

    recompile and flash the code and start it in the debug mode.  When you run it and when this error happens, the debugger will automatically halt inside this function at NRF_BREAKPOINT_COND.

    You can step few more instructions to see which line exactly caused a failure in the APP_ERROR_CHECK. 

  • Hi Aryan, 

    I was able to solve the error. I had set the GPIOTE_CONFIG_IN_SENSE_TOGGLE value to false and this was causing the error. But, I want to enable GPIO sensing in Polling mode. How do I change the pin_change_int code to enable the polling mode?

    Regards,

    Sunil

Reply Children
No Data
Related