micro-ROS / micro-ROS/micro_ros_stm32cubemx_utils

UCLIENT_PROFILE_MULTITHREAD not working for FreeRTOS

Open
#114 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
275
Forks
100
PR merge metrics
No merged PRs in 30d

Description

After generating the micro ros library with the multithread flag enabled (and adding the FreeRTOS headers to the compile search path) I realized that my application is broken. It seems to me that at least the custom transport for writing data to the host is not working properly. The data structure for the belong DMA receive channel is not initialized and the transmit doesn't seem to be correct (see screenshot on the right hand side).
![Screenshot from 2023-08-11 13-33-37](https://github.com/micro-ROS/micro_ros_stm32cubemx_utils/assets/135316308/19c34e55-6123-43d5-a1f1-3e849de51c8f)
If I use a non multithread version of the micro ros library the exact same position in the code (and also in the execution order) looks like:
![Screenshot from 2023-08-11 13-37-17](https://github.com/micro-ROS/micro_ros_stm32cubemx_utils/assets/135316308/dbfd8474-9328-4946-9013-86bdcff600e0)

From previous experience I assume that something is going wrong in allocating the memory for the protecting semaphores that are used in the ROS2 or DDS layers.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the generated multithread and non-multithread configurations, focusing on the custom transport's DMA receive initialization, transmit path, and protecting semaphore allocation. Done means the FreeRTOS multithread application initializes the transport correctly and writes data to the host as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.