Replies: 3 comments
-
This occurs on both 328P and 2560 |
Beta Was this translation helpful? Give feedback.
-
Have you tried using critical sections? These libraries might not support reentrancy |
Beta Was this translation helpful? Give feedback.
-
I'm not sure of the way that C++ caches values, but I'm strongly suspicious that local variables from one task (and therefore one stack), won't be automatically copied to the similarly named local variable on another stack in a different task. If you find it works within one task, either within the loop() or another task, but then fails if you try to do it across different tasks, then that is your problem solved. I suggest putting the linked list declaration as a global, then the variables will be defined in the data section, and should be common across all tasks. Also, you've defined a VERY SMALL stack for your task. It needs at least 85 bytes to start the task, and that only gives you 53 bytes remaining. You will find things quickly go bad if the stack is too small. Try with 256 or 512 bytes and see if that changes anything. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I need to utilize a LinkedList, and rather than do it myself, am using the LinkedList arduino library here..
The library works in a standard Arduino (loop) configuration, but when I put it into the RTOS, it fails to save values. The size() counter increments as if it is saving, but all values returned are '0'.
I initially expected this was an implementation issue with the library, but trying out Qlist yields the same results.
Is there something special I need to do for a LInkedList to properly handle saving values in FreeRTOS?
FreeRTOS Code:
FreeRTOS Code Output (truncated):
Standard Arduino Code:
Standard Arduino Code Output (truncated):
Beta Was this translation helpful? Give feedback.
All reactions