[elektro] PIC32 FreeRtos IT semafor probléma.

F-I flaist at gmail.com
Fri Jun 15 02:54:15 CEST 2012


Sziasztok!

Használom a PIC32 FREERTOS összeállítás.

IT rutinból hivok szmafor eseményt a minta példák alapján.

                 xSemaphoreGiveFromISR( xSemaphore, &xHigherPriorityTaskWoken );  //indítja a jelfeldolgozó taszkot



A bajom az, hogy ez az IT rutin sürün jön, ezért használná a HW SHADOW regiszter mentést.

__attribute__ ((interrupt(IPL6SRS)))            //ez használja a HW shadow  reg. mentést


Ha viszont ezt beállitom, akkor 7-es "general_exception"-t dob a PIC32 a FREERTOS ora IT rutinjában. 


Ha tiltom, akkor nincs hiba:

__attribute__ ((interrupt(IPL6SOFT)))       //Ne haználja a HW shadow reg. mentést.





A program ez után a szemafor hivás után száll el.


                 xSemaphoreGiveFromISR( xSemaphore, &xHigherPriorityTaskWoken );  //indítja a jelfeldolgozó taszkot


Ez hívja a lenti PIC32 spec.függvény, ami után jön az elszállás!  

"port.c"
---------------------------------------------------------------------------------------------------
unsigned portBASE_TYPE uxPortSetInterruptMaskFromISR( void )
{
unsigned portBASE_TYPE uxSavedStatusRegister;

 asm volatile ( "di" );
 uxSavedStatusRegister = _CP0_GET_STATUS() | 0x01;
 /* This clears the IPL bits, then sets them to 
 configMAX_SYSCALL_INTERRUPT_PRIORITY.  This function should not be called
 from an interrupt that has a priority above 
 configMAX_SYSCALL_INTERRUPT_PRIORITY so, when used correctly, the action
 can only result in the IPL being unchanged or raised, and therefore never
 lowered. */
 _CP0_SET_STATUS( ( ( uxSavedStatusRegister & ( ~portALL_IPL_BITS ) ) ) | ( configMAX_SYSCALL_INTERRUPT_PRIORITY << portIPL_SHIFT ) );

 return uxSavedStatusRegister;
}
---------------------------------------------------------------------------------------------------

Olyan a jelenség, mintha felengedné az IT-t, és a FREERTOS ora IT ráindulna  !!??

Azon kívül, hogy ne használjam a SHADOW-t van valami ötlet?

Köszi, üdv István


More information about the Elektro mailing list