First of all, I am an IAR PowerPAC customer but they don't have a forum like this. I know that PowerPAC is a rebranded Segger product, so I appreciate your assistance.
I am running on an STM32F103ZE.
I just recently upgraded my RTOS from PowerPAC rev 2.21 to 2.32. I am now getting an
OS_ERR_CPU_STATE_ISR_ILLEGAL error in an ISR that I didn't get previously. It appears the error was never trapped in the 2.21 version. So how do I get around this one. From the Segger/IAR manuals and a posting on this forum about STM32 interrupt priorities, it looks like I can no longer call OS API routines within my ISRs. In the code snippet below my ISR for the UART fires on the receipt of a character and I want to post it as a mailbox message for a task to handle. All of the OS functions now generate the OS_ERR_CPU_STATE_ISR_ILLEGAL. I am at a loss how to fix this.
The manuals say to call another ISR using OS_CallISR. This seems ineffecient. If I have to, how do you set up this other interrupt?
None of the code examples provided with the install for the PowerPAC utilized an ISR sending a mailbox message or any kind of event. Do you have another code example how to set this up.
I get the feeling there is something very simple I am overlooking but I just can't see it.
Thanks,
Jim
------------------------------------------------------------------------
Below is the configuration of the hardware ISR for the UART.
Display All
I am running on an STM32F103ZE.
I just recently upgraded my RTOS from PowerPAC rev 2.21 to 2.32. I am now getting an
OS_ERR_CPU_STATE_ISR_ILLEGAL error in an ISR that I didn't get previously. It appears the error was never trapped in the 2.21 version. So how do I get around this one. From the Segger/IAR manuals and a posting on this forum about STM32 interrupt priorities, it looks like I can no longer call OS API routines within my ISRs. In the code snippet below my ISR for the UART fires on the receipt of a character and I want to post it as a mailbox message for a task to handle. All of the OS functions now generate the OS_ERR_CPU_STATE_ISR_ILLEGAL. I am at a loss how to fix this.
The manuals say to call another ISR using OS_CallISR. This seems ineffecient. If I have to, how do you set up this other interrupt?
None of the code examples provided with the install for the PowerPAC utilized an ISR sending a mailbox message or any kind of event. Do you have another code example how to set this up.
I get the feeling there is something very simple I am overlooking but I just can't see it.
Thanks,
Jim
------------------------------------------------------------------------
Below is the configuration of the hardware ISR for the UART.
Brainfuck Source Code
- /* Enable the USART3 Interrupt */
- NVIC_InitStructure.NVIC_IRQChannel = USART3_IRQChannel;
- NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
- NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
- NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
- NVIC_Init(&NVIC_InitStructure);
- /* Enable the USART Receive interrupt: this interrupt is generated when the
- USART1 receive data register is not empty */
- USART_ITConfig(USART3, USART_IT_RXNE, ENABLE);
- -----------------------------------------------------------------------
- void USART3_IRQHandler(void)
- {
- char c;
- if(USART_GetITStatus(USART3, USART_IT_RXNE) != RESET)
- {
- /* Read one byte from the receive data register */
- c = USART_ReceiveData(USART3) & 0xFF;
- if (mbSerial.Id) // Make sure the mailbox is created
- OS_PutMailCond1(&mbSerial, &c); <====== This is where the error occurs
- }
- }