Hello Segger-Forum-Team,
I'm using the embOS for MSP430 and now have a problem by the use of the OS_Use method. For the time my LCD is used, the LCD shall be blocked for other tasks.
Display All
The problem is now, that sometimes (not always and quite seldom) the PC jumps to a not executable area in memory during performing the OS_Use method. It looks a kind of a corrupted ret-address on stack, but I wasn't able yet to catch this issue in the moment it goes wrong. What I know is, that the program entered OS_Use but never came back properly.
My question is, if taskswitches are performed during OS_Use, so that maybe another task corrups the semaphore or the stack of the task in charge? Can a corruption of the semaphore lead to an unexpected jump at all (I know it can make the task stop so far but cam it crash crashing)? Maybe You have an idea what can cause this behave.
Thanks in advance and regards,
Daniel
I'm using the embOS for MSP430 and now have a problem by the use of the OS_Use method. For the time my LCD is used, the LCD shall be blocked for other tasks.
C Source Code
- void lcd_Pwr(UBYTE ubParam)
- {
- UBYTE ubRetry = RESET;
- switch (ubParam)
- {
- case ON: // Turn LCD on
- if (OS_Use(&lcd_flag) == 1) //If sema taken by another task, wait. If sema is free, take it.
- { //If sema allready taken by this task, do nothing.
- LCD_PWR_ON();
- OS_Delay((OS_TIME)LCD_PWR_DELAY); // wait for power on
- /* (...) */
- }
- break;
- case OFF: // Turn LCD off
- LCD_PWR_OFF(); // power off
- OS_Delay((OS_TIME)LCD_PWR_DELAY);
- OS_Unuse(&lcd_flag); // flag lcd not in use anymore (-> LCD-Resource is free again)
- break;
- default:
- break;
- }
- }
The problem is now, that sometimes (not always and quite seldom) the PC jumps to a not executable area in memory during performing the OS_Use method. It looks a kind of a corrupted ret-address on stack, but I wasn't able yet to catch this issue in the moment it goes wrong. What I know is, that the program entered OS_Use but never came back properly.
My question is, if taskswitches are performed during OS_Use, so that maybe another task corrups the semaphore or the stack of the task in charge? Can a corruption of the semaphore lead to an unexpected jump at all (I know it can make the task stop so far but cam it crash crashing)? Maybe You have an idea what can cause this behave.
Thanks in advance and regards,
Daniel