what are common pattern for implementing UART on zephyr rtos based system ?

Hi Everyone 

what are the common patterns for implementing UART on zephyr rtos-based system using the mesh stack?

I use uart async APIs, here my implementation...

step 1 - Use an interrupt handler to push received bytes to a message queue

step 2 - then processed by a separate task responsible for message framing, CRC validation,

step 3 - Once a message is validated, it is pushed to a separate message queue for processing to another int order to publish it over the ble mesh.

About step 3, I wonder if I should use the system workq to push the message or use a distinct thread as a publisher.

I would like to confirm that this implementation follows the best practices for UART data framing and message validation in a zephyr-based BLE MESH. Additionally, I would appreciate any feedback or suggestions on how we can further improve this implementation.

Thanks 

Cedric

  • Hello again Cedric,

    what are the common patterns for implementing UART on zephyr rtos-based system using the mesh stack?

    There is no go-to way of doing this, but optimally you'll choose one that doesn't hinder the radio usage. That also counts for the steps that goes between sending a message over UART and sending it over Bluetooth. It depends on what you need for your project. But a great example of both of these problems solved (and something you could emulate) is what we did in the peripheral_uart sample. Radio use is radio use after all, no matter if its Bluetooth Mesh or just regular Bluetooth.

    Regards,

    Elfving

Related