7 years, 8 months ago.

Memory problems with RTOS

Hi everyone, We are having some problems with function execution when using RTOS. The programs are running individually without RTOS, but when they are merged and run with RTOS, the program seems to hang. The microcontroller we are using is FRDM-KL46Z. The program hangs when the number of function calls (one inside the other) is increased, or when number of static variables is increased. That is, the program starts running as expected when static variables are removed and a function is cut-pasted inside the function that calls it. This is the link to the program that hangs: https://developer.mbed.org/users/shreeshas95/code/MNG_TC/ and this is the link to the program that is working https://developer.mbed.org/users/shreeshas95/code/MNG_TC_working/ . Is this a problem with stack getting overflown ? Is there any way to determine the size of stack, or the RAM being used, or any memory clashes, ? The program as said works without RTOS, so is there any limit on the number of function calls in RTOS ? We tried debugging with 'printf' statements, is there any way of debugging the program (related to memory problems in particular) ?

Thanks in advance.

Question relating to:

Be the first to answer this question.