I've been coding for FreeRTOS on the MEGA 2560, and was using some LEDs to determine activity per task by toggling each individual LED each time through the task, and monitoring the time using a scope on the LED pin(s). All worked fine until I added the code for the last task.
Only the LED for the last task showed activity, and I assumed I screwed up in the new code, and spent a full day re-doing the code and troubleshooting. Well, it turns out that the code was working just fine. The problem appears to be RTOS is not manipulating the appropriate LED for each task, but using some other pin. The same configuration but with simple test code works fine.
I've tried just about everything I know, with negative results. The 3 tasks are running OK (I still need to do much more testing) so it's not like there is an issue with stack overflow, plus I decided to make ALL the variables as global variables to minimze stack use, and possible conflicts with the variables, which were the same on two of the original programs. I'm using about 600 bytes of RAM for those variables, and have tons of spece in the MEGA in all aspects. The code only uses 14K of the 256K available.
So, I'm officially stumped, and I assume that there's a problem with the task switching somehow, but I'd expect the code to crash eventually if that were the case, but it runs for hours and hours.
Does anyone have any real experience with FreeRTOS that have experienced similar issues related to simple digitalRead and/or digitalWrite problems similar to what I'm seeing?