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

nrf52-mesh-light-switch-client-server-proxy-master add uart module

HI

I use SDK nrf52-mesh-light-switch-client-server-proxy-master with nrf52840 PDK。

I need uart module,so I add include path,c file to the project.

add header file , uart_init function and uart event handle dunction to main.c . 

set SDKconfig.h as uart example of SDK15.0.0 .

At beginning,it works fine. But when I send many data or send data Very frequently, it will stop running and show this error:

app_error_weak.c,  105, Mesh error 1 at 0x00000000 (:0)

after debug, i fuond that uart_event_handle function came a event of APP_UART_COMMUNICATION_ERROR.

  • What is the value of data field of the app_uart event? From app_uart.h :

    /**@brief Struct containing events from the UART module.
     *
     * @details The app_uart_evt_t is used to notify the application of asynchronous events when data
     * are received on the UART peripheral or in case an error occured during data reception.
     */
    typedef struct
    {
        app_uart_evt_type_t evt_type; /**< Type of event. */
        union
        {
            uint32_t error_communication; /**< Field used if evt_type is: APP_UART_COMMUNICATION_ERROR. This field contains the value in the ERRORSRC register for the UART peripheral. The UART_ERRORSRC_x defines from nrf5x_bitfields.h can be used to parse the error code. See also the \nRFXX Series Reference Manual for specification. */
            uint32_t error_code;          /**< Field used if evt_type is: NRF_ERROR_x. Additional status/error code if the error event type is APP_UART_FIFO_ERROR. This error code refer to errors defined in nrf_error.h. */
            uint8_t  value;               /**< Field used if evt_type is: NRF_ERROR_x. Additional status/error code if the error event type is APP_UART_FIFO_ERROR. This error code refer to errors defined in nrf_error.h. */
        } data;
    } app_uart_evt_t;


    Non-blocking means that you continue executing code when you wait for a state change instead of blocking execution: 
    change_state();
    
    while(!state_changed); // Blocking function 
    
    do_stuff();
    
    do_other_stuff(); // Blocked function
    
    -------------------------- VS ----------------------------
    
    change_state();
    do_other_stuff(); // Not blocked
    
    
    void some_event_handler(bool state_changed) 
    {
        if(state_changed)
        {
            do_stuff();
        }
    }

  • Hi Enzo.

    Am strugle with the same issue.

    Looking at the one, you are quite succes.

    Could you attache project file (am guess in SES)?

    Thanks forward,

    Kamo.

Related