FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [September 2009 Threads] Api in interrupt CM3Posted by Alessandro Zerbini on September 24, 2009 I've a problem with FreeRtos, i'm programming on CORTEX M3. My application is very easy, there is a task that waits on semaphore and toggle a led, the semaphore is give by a ISR: void EXTI9_5_IRQHandler(void) { portBASE_TYPE xHigherPriorityTaskWoken= pdFALSE; xSemaphoreGiveFromISR(xSem, &xHigherPriorityTaskWoken); if(xHigherPriorityTaskWoken==pdTRUE) portYIELD(); }
The problem is that when the API "xSemaphoreGiveFromISR" is called , the programm crashes. If i don't use API the programm runs... Can someone help me? thanks
RE: Api in interrupt CM3Posted by Richard on September 24, 2009 Can you check that the semaphore xSem was created correctly and is not NULL.
Also, can you step into the xSemaphoreGiveFromISR() function to see at what point the crash occurs.
Regards.
RE: Api in interrupt CM3Posted by Alessandro Zerbini on September 24, 2009 The semaphore is created correctly. I see, that xSemaphoreGiveFromISR() runs correctly, the program crashes on portYIELD(), infact doesn't force context switch...
RE: Api in interrupt CM3Posted by Richard on September 24, 2009 portYIELD() should not cause a context switch directly - the switch is just pended. Try placing a break point on the function called xPortPendSVHandler() in port.c.
Regards.
RE: Api in interrupt CM3Posted by Alessandro Zerbini on September 24, 2009 i can't place a break point, because i don't simulate the program...
RE: Api in interrupt CM3Posted by Alessandro Zerbini on September 24, 2009 But i place on the function xPortPendSVHandler() a led that have to toggle, but doesn't toggle..
RE: Api in interrupt CM3Posted by Richard on September 24, 2009 <code> i can't place a break point, because i don't simulate the program...</code>
I don't understand that - are you running in a simulator or on real hardware?
<code>But i place on the function xPortPendSVHandler() a led that have to toggle, but doesn't toggle..</code>
xPortPendSVHandler() is a naked function written in assembly - you cannot add code to it unless it too is assembly code.
Regards.
RE: Api in interrupt CM3Posted by Alessandro Zerbini on September 24, 2009 I'm running in real hardware.. Regards
RE: Api in interrupt CM3Posted by Alessandro Zerbini on September 25, 2009 I've tried to take off the function portYIELD, and program runs... but now the time between the ISR and handler task is not deterministic..
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|