-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add stm32cube framework #45
base: main
Are you sure you want to change the base?
Conversation
This looks good to me. Could you provide some transport layer such as basic serial transport using STM HAL? Also, could you integrate this into the CI?
|
@mergify backport humble foxy galactic |
🟠 Waiting for conditions to match
|
I would integrate it with CI but I would need some help. For starters, I have a few questions:
|
Maybe you can add a target here. But if you need to create another folder, it is ok for us.
Maybe for initial support, we can add a board that you as a contributor can confirm that works. Just add the needed references in the README.md specifying that this has been tested in X hardware.
In general, if support for one platform/hardware is added, another user should be able to use it. If your contribution requires further steps to make a basic micro-ROS application works, feel free to add a section in the README.md explaining the dependencies and required steps for making in work. |
I added an example project and CI job. I didn't want to include generated code so I added a step in CI job that installs CubeMX and stm32pio which I use to generate the code before running platformio. |
@Acuadros95 please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, will test it on monday.
Also, add the board to the Supported boards list please.
rhead = rtail = thead = thead_next = ttail = 0; | ||
HAL_UART_Receive_DMA(stream->uart, stream->rbuffer, stream->rbuffer_size); | ||
} | ||
open_count++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use a integer for this?
Also, did you encounter any situation where open/close calls miss match?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my case, I used rmw_uros_ping_agent
periodically to detect agent disconnects. The issue was that this function called open and close on the transport each time it was called, even when the transport was already opened. This is why I decided to ignore all nested open/close calls, hence I use integer to track the nesting level.
It's possible I used the library wrong. Let me know if that's the case or if you know a better way to deal with this problem.
ci/stm32cube/Src/main.c
Outdated
void HAL_UART_TxCpltCallback(UART_HandleTypeDef* huart) { | ||
if (huart == &huart1) { | ||
uart_transfer_complete_callback(&stream); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we move this inside of the library?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementing HAL_UART_TxCpltCallback
inside the library would be problematic in case the user wants to use another UART port for something else. I don't see a clean way of doing this, any ideas?
Co-authored-by: Antonio Cuadros <[email protected]>
- Fix race condition in rollover detection by disabling interrupts - Fix integer overflows by casting types in the correct order
I tested it only on F4. Also I haven't tested the rollover feature, because I don't know how to do it without running the code for 50 days.