We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Actually I read from the Mastering in the FreeRTOS documentation that,
/* If all is well then main() will never reach here as the scheduler will now be running the tasks. If main() does reach here then it is likely that there was insufficient heap memory available for the idle task to be created. Chapter 2 provides more information on heap memory management. */ for( ;; );
what if I removed for( ;; ); from the main? I mean in case if anything happens in the project and if the control goes to that infinite loop then the product will hang forever.
So my question is why we use this?? can we remove it??
omkardixi said:When main returns the CPU executes the next instruction which is simply a GOTO to go back to the beginning of the code.
Do you just assume that happens, or did you look it up in some documentation about this tool chain?
I got the answer on the FreeRTOS forum
What happens when you exit an embedded program is only defined by a particular implementation. Some may restart the program, but many just loop to stall. In any case, your program had a major failure where the system didn’t start up, and retrying is unlikely to change that. Ideally you want it easy to see what happened when debugging, so having the loop right there is helpfull.