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.

Parents
  • APP_UART_COMMUNICATION_ERROR

    From app_uart_evt_t :

    uint32_t app_uart_evt_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 nRF5 Series Reference Manual for specification.

    I need you to share the value of the UARTs ERRORSRC register.


    I suggest using HW Flow Control, or the UARTE — Universal asynchronous receiver/transmitter with EasyDMA peripheral with UARTE driver.

  • Hi haakonsh.

    thanks for your reply.

    I found these defines,

    /* Bit 3 : Break condition */
    #define UART_ERRORSRC_BREAK_Pos (3UL) /*!< Position of BREAK field. */
    #define UART_ERRORSRC_BREAK_Msk (0x1UL << UART_ERRORSRC_BREAK_Pos) /*!< Bit mask of BREAK field. */
    #define UART_ERRORSRC_BREAK_NotPresent (0UL) /*!< Read: error not present */
    #define UART_ERRORSRC_BREAK_Present (1UL) /*!< Read: error present */

    /* Bit 2 : Framing error occurred */
    #define UART_ERRORSRC_FRAMING_Pos (2UL) /*!< Position of FRAMING field. */
    #define UART_ERRORSRC_FRAMING_Msk (0x1UL << UART_ERRORSRC_FRAMING_Pos) /*!< Bit mask of FRAMING field. */
    #define UART_ERRORSRC_FRAMING_NotPresent (0UL) /*!< Read: error not present */
    #define UART_ERRORSRC_FRAMING_Present (1UL) /*!< Read: error present */

    /* Bit 1 : Parity error */
    #define UART_ERRORSRC_PARITY_Pos (1UL) /*!< Position of PARITY field. */
    #define UART_ERRORSRC_PARITY_Msk (0x1UL << UART_ERRORSRC_PARITY_Pos) /*!< Bit mask of PARITY field. */
    #define UART_ERRORSRC_PARITY_NotPresent (0UL) /*!< Read: error not present */
    #define UART_ERRORSRC_PARITY_Present (1UL) /*!< Read: error present */

    /* Bit 0 : Overrun error */
    #define UART_ERRORSRC_OVERRUN_Pos (0UL) /*!< Position of OVERRUN field. */
    #define UART_ERRORSRC_OVERRUN_Msk (0x1UL << UART_ERRORSRC_OVERRUN_Pos) /*!< Bit mask of OVERRUN field. */
    #define UART_ERRORSRC_OVERRUN_NotPresent (0UL) /*!< Read: error not present */
    #define UART_ERRORSRC_OVERRUN_Present (1UL) /*!< Read: error present */

    thanks for your suggestion, I will try.

Reply
  • Hi haakonsh.

    thanks for your reply.

    I found these defines,

    /* Bit 3 : Break condition */
    #define UART_ERRORSRC_BREAK_Pos (3UL) /*!< Position of BREAK field. */
    #define UART_ERRORSRC_BREAK_Msk (0x1UL << UART_ERRORSRC_BREAK_Pos) /*!< Bit mask of BREAK field. */
    #define UART_ERRORSRC_BREAK_NotPresent (0UL) /*!< Read: error not present */
    #define UART_ERRORSRC_BREAK_Present (1UL) /*!< Read: error present */

    /* Bit 2 : Framing error occurred */
    #define UART_ERRORSRC_FRAMING_Pos (2UL) /*!< Position of FRAMING field. */
    #define UART_ERRORSRC_FRAMING_Msk (0x1UL << UART_ERRORSRC_FRAMING_Pos) /*!< Bit mask of FRAMING field. */
    #define UART_ERRORSRC_FRAMING_NotPresent (0UL) /*!< Read: error not present */
    #define UART_ERRORSRC_FRAMING_Present (1UL) /*!< Read: error present */

    /* Bit 1 : Parity error */
    #define UART_ERRORSRC_PARITY_Pos (1UL) /*!< Position of PARITY field. */
    #define UART_ERRORSRC_PARITY_Msk (0x1UL << UART_ERRORSRC_PARITY_Pos) /*!< Bit mask of PARITY field. */
    #define UART_ERRORSRC_PARITY_NotPresent (0UL) /*!< Read: error not present */
    #define UART_ERRORSRC_PARITY_Present (1UL) /*!< Read: error present */

    /* Bit 0 : Overrun error */
    #define UART_ERRORSRC_OVERRUN_Pos (0UL) /*!< Position of OVERRUN field. */
    #define UART_ERRORSRC_OVERRUN_Msk (0x1UL << UART_ERRORSRC_OVERRUN_Pos) /*!< Bit mask of OVERRUN field. */
    #define UART_ERRORSRC_OVERRUN_NotPresent (0UL) /*!< Read: error not present */
    #define UART_ERRORSRC_OVERRUN_Present (1UL) /*!< Read: error present */

    thanks for your suggestion, I will try.

Children
No Data
Related