-
Notifications
You must be signed in to change notification settings - Fork 27
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
Works on Arduino Mega 2560 #1
Comments
On AVR space is added to your size for interrupt context and other structures. I have also found that ChibiOS often appears to work OK when the stack overflows into other areas. Eventually you will either have a crash or corrupt other global memory. I fill the allocated stack space with a 0x55 pattern at startup and check how much of the pattern remains when you call chUnusedThreadStack() You must have some unused stack. |
Would that mean that the space added for interrupt context and other structures is more than needed? |
The examples allocate generous stack space since they run on various CPUs. You must decide how much unused stack to allocate. You must never allow stack overflow. The purpose of chUnusedThreadStack() is to check if the work-space size is appropriate. Using an RTOS take experience beyond simple C/C++ programming. An RTOS is a complex tool. Here is a quote from the author of ChibiOS.
|
Hi there!
First I want to thank you for this, it looks amazing and I'm really happy you decided to still work on this port of ChibiOS just for Arduino.
I've used vanilla ChibiOS but for simple things/project, it's a bit of an overkill. With ChRt I can get the best of both Arduino and ChibiOS.
I've been running all the examples on the Mega2560, changing a few things to see if everything breaks and for the moment I haven't found any bug.
On question I have though is about the
chUnusedThreadStack()
. I've tried putting a stack of zero but in the Blink example but I still get everything to work as intended. Is that normal?The text was updated successfully, but these errors were encountered: