2012-01-05 04:26 AM
Hello,
We are working on the STM3220-G Evaluation Board. We are using IAR compiler [V6.2] and running a test application with FreeRTOS [7.0.2] and the STM32_F105-07_F2xx_USB-Host-Device_Lib_V2.0.0 The USB is used as Virtual Com Port. The USB alone works correctly. The FreRTOS alone works correctly (with only one task). But when I put USB with FreeRTOS, I have systematically a crash on the IAR environnement (don't answer), I must close the environnment Have someone already have this kind of problem, please? Regards #usb #freertos #freertos #virtual-comm-port2012-01-05 10:47 PM
Can you pls share which functions of USB did you put in Tasks ?
Is the USB Interrupt running Freely without the FreeRTOS Task ?2012-01-05 11:31 PM
Thank you for your answer.
I have no task USB, I've just a task that do nothing (just while(1)). The USB Interrupt (USBD_OTG_ISR_Handler) is running without the FReeRTOS.2012-01-06 12:53 AM
The problem is now solved.
It was a problem of priority between USB interrups and FreeRTOS (Systick) interrupts. I've forgotten tthe line : NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4); that FreeRTOS preconize. The USB Stack writes NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1); and it is incompatible with FreeRTOS.2012-01-06 12:54 AM
The problem is now solved.
It was a problem of priority between USB interrups and FreeRTOS (Systick) interrupts. I've forgotten tthe line : NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4); that FreeRTOS preconize. The USB Stack writes NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1); and it is incompatible with FreeRTOS.2012-01-08 02:02 AM
Please always read the FreeRTOS documentation on how to write interrupt service routines for your particular port. In this case, any documentation page for an STM32 demo will do. The bit of interest is setting up the interrupt nesting parameter configMAX_SYSCALL_INTERRUPT_PRIORITY. For example, see the Interrupt Service Routines section on the following page
http://www.freertos.org/FreeRTOS-for-STM32F4xx-Cortex-M4F-IAR.html
There is more in the FAQ ''My application does not run, what could be wrong'' - point 3 is most important for Cortex-M users:Having any NVIC_PriorityGroupConfig() setting other than NVIC_PriorityGroup_4 massively complicates things. ST are, to my knowledge, the only Cortex-M vendor who default to something else.Regards,Richard ()