-
Notifications
You must be signed in to change notification settings - Fork 62
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
ESP32 crashes when listening_message_reliably #155
Comments
What are the differences between In any case, a corruption like this sounds to me like a stack overflow. Have you tried to increase stack sizes of each task? |
Here is a quick diagram showing how to program is composed : Every subs run with the uros_thread executor, their callback functions sends a message to the txQueue. I already tried increasing stacks, but maybe not enough. |
Ok, please provide feedback. And enable the multithread flag because if not, all the stack layers are not thread safe! |
When I turn ON the UCLIENT_PROFILE_MULTITHREAD in the CMakeLists.txt of Micro-XRCE-DDS-Client, it doesn't change the build, and when I do a clean build, it reverts back to OFF. Am I missing something ? |
You need to use the |
I have added the line |
Just check that is enabled in the generated |
Just a moment, my build keeps crashing (doesn't find <rcl/rcl.h> and micro-ros doesn't want to clean) |
When I set the line in colcon.meta, the build keeps crashing |
Clean your environment |
Already done, clean, fullclean, clean-microros, removed the microROS component and resetted it |
Provide more info about this crash |
build failed with doesn't find <rcl/rcl.h> |
|
the stderr in the uROS build is typically :
|
It is not finding your FreeRTOS headers, let me check |
Found anything ? |
Can someone at least guide me? Maybe my config in the colcon.meta wasn't done properly? It would help me a lot as I've already tried on multiple computers, with multiple codebases (including ones without any thread apart from the microROS thread), and still, impossible to turn on this multithreading. Am I missing something? |
Hey, I'm facing the exact same error. I'll try the things mentioned here and will update the results. |
Project builds successfully after adding "-DUUCLIENT_PROFILE_MULTITHREAD=ON" in colcon.meta. I'm using a single executor and thread for uros so I think changing the multi thread flag won't do anything. This error occurs only with a specific sequence of requests made (service clients on ESP32) which are working as usual when executed otherwise.
It'll be really helpful to understand what the error is about. |
@pablogs9 still nothing ? |
Provide code for replicating this issue |
I will try to provide a minimal code replicating this soon, as it currently requires connection with multiple other devices |
I am attaching the multithread_publisher, which is also available in examples, which can be used for replicating this issue,
|
I'm getting the same build failure when setting
It appears to have been introduced by eProsima/Micro-XRCE-DDS-Client#236 |
ESP32 crashes when listening_message_reliably
Steps to reproduce the issue
My project consist on controlling a BT Mesh provisioner via ROS, and transmitting sensors data from the Mesh network to ROS.
The ESP32 serves as a message bridge between the provisioner and ROS.
For that I've got 4 threads running :
The nRF5340 scans for unprovisioned ("unconnected") mesh nodes, and sends the UUIDs to the ESP32 via serial.
So the ESP32 receives a 16 bytes UUID from UART, the uart_phy sends this UUID to uart_mac_rx through a message queue.
uart_mac_rx wakes up because something is in the queue, sees that it is an UUID, and publish it with my "unprov_pub".
The ROS message is the following :
ble2ros_interfaces/msg/Beacon.msg
Expected behavior
UUIDs are sent to ROS without error
Actual behavior
Sometimes, mostly when the ESP32 receives a lot of UUID's to transmit to ROS, i got the following error :
assert failed: pbuf_free IDF/components/lwip/lwip/src/core/pbuf.c:757 (pbuf_free: p->ref > 0)
OR
assert failed: tlsf_free heap_tlsf.c:872 (!block_is_free(block) && "block already marked as free")
but mostly the pbuf_free assert failed.
The most frequent stack backtrace is the following :
Additional information
I also had other configuration with at most 4 pubs and 4 subs, and this problem can occur with any publisher.
I went back to 2 pubs and 2 subs to get back to the basic uROS config (also resetted the max pub/sub in colcon.meta)
I looked if the heap became corrupted at some point, but it was always clean.
When disabling asserts, it stills crash with Guru meditation error: Core 0 panic'ed
I tried lowering priorities, (12 for UART, 11 for uROS), switching priorities (4 for UART, 5 for uROS), still got the same problem.
Looked over the internet for solutions, looked in this repo's issues, found nothing...
Looked if I had memory leaks, but found none
The text was updated successfully, but these errors were encountered: