Hello All,
Here is my code:
Display All
In OS_InitHW(); I have configured PIT like below:
Display All
PIT interrupt handler gets called successfully, But while executing OS_TICK_Handle(); OS error occured OS_ERR_ILLEGAL_OUT_ISR.
}
Documentation says:
a call of
OS_EnterInterrupt().
so I have used
static void _OS_SystemIrqhandler(void) {
then
OS_ERR_NOT_IN_ISR occured. Don't khow how to fix this !!
Thanks for your support
~Ashok
Here is my code:
Source Code
- int main(void) {
- OS_IncDI(); /* Initially disable interrupts */
- OS_InitKern(); /* Initialize OS */
- OS_InitHW(); /* Initialize Hardware for OS */
- // BSP_Init(); /* Initialize LED ports */
- /* You need to create at least one task before calling OS_Start() */
- OS_CREATETASK(&TCBHP, "HP Task", HPTask, 100, StackHP);
- OS_CREATETASK(&TCBLP, "LP Task", LPTask, 50, StackLP);
- OS_DecRI();
- OS_Start(); /* Start multitasking */
- return 0;
- }
In OS_InitHW(); I have configured PIT like below:
Source Code
- void OS_InitHW(void) {
- OS_IncDI();
- OS_ARM_CACHE_Sync(); // Ensure, caches are synchronized
- /* Initialize PIT as OS timer, enable timer + timer interrupt */
- // AT91C_BASE_PITC->PITC_PIMR = ((OS_TIMER_RELOAD & 0x000FFFFF) | (1uL << 25) | (1uL << 24));
- // OS_ARM_InstallISRHandler(AT91C_ID_SYS, _OS_SystemIrqhandler);
- // OS_ARM_EnableISR(AT91C_ID_SYS);
- AT91C_BASE_PMC->PMC_PCER |= (1 << AT91C_ID_SYS);
- AT91C_BASE_PITC->PITC_PIMR =((OS_TIMER_RELOAD & 0x000FFFFF) );
- AT91C_BASE_PITC->PITC_PIMR |= AT91C_PITC_PITEN; //24
- AT91C_BASE_AIC->AIC_IDCR |= (1 << AT91C_ID_SYS);
- AT91C_BASE_AIC->AIC_IDCR |= (1 << AT91C_ID_SYS);
- AT91C_BASE_AIC->AIC_SMR[AT91C_ID_SYS]= 0x04;//(AT91C_AIC_SRCTYPE_INT_EDGE_TRIGGERED | OS_TICK_IPL);
- AT91C_BASE_AIC->AIC_SVR[AT91C_ID_SYS] = (unsigned int)_OS_SystemIrqhandler;
- AT91C_BASE_AIC->AIC_ICCR |= (1 << AT91C_ID_SYS);
- AT91C_BASE_AIC->AIC_IECR |= (1 << AT91C_ID_SYS); // IntrEnableMask |= 1 << AT91C_ID_SYS;
- AT91C_BASE_PITC->PITC_PIMR |= AT91C_PITC_PITIEN; //25 //enable PIT Interrupt
- AT91C_BASE_PITC->PITC_PIMR |= AT91C_PITC_PITEN; //24 //Enable PIT
- // OS_COM_Init(); //thios has no effect on behavior
- OS_DecRI();
- }
PIT interrupt handler gets called successfully, But while executing OS_TICK_Handle(); OS error occured OS_ERR_ILLEGAL_OUT_ISR.
Documentation says:
162
OS_ERR_ILLEGAL_OUT_ISR embOS timer tick handler or UART handler
for embOSView was called without
a call of
OS_EnterInterrupt().
so I have used
static void _OS_SystemIrqhandler(void) {
then
OS_ERR_NOT_IN_ISR occured. Don't khow how to fix this !!
Thanks for your support
~Ashok