cancel
Showing results for 
Search instead for 
Did you mean: 

freeRtos & usarts interrupt

alireza_roozitalab
Associate III
Posted on February 09, 2013 at 07:35

hello every one

i use stm32f107 and i want to use freeRtos and usart1,usart2 interrupts at the same time (only RXNE interrupt)

but ofter many usarts interrupt micro controller get fault

if i remove usarts interrupts or freertos the program work correctly

how can i fix this

the priority of usarts tasks is the same ( 1UL | portPRIVILEGE _BIT)

and the priority of usart1 interrupt is 44

and the priority of usart2 interrupt is 45

thanks for helping me
3 REPLIES 3
Posted on February 09, 2013 at 15:08

how can i fix this

Use a debugger? You need to better understand the CPU state when it faulted. What instruction, what register settings, what stack state.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
alireza_roozitalab
Associate III
Posted on February 12, 2013 at 14:34

thanks for your replay clive1

 i change freertos to rtx and same problem

my debugger is keil and the stack size iz 0x2000 and each stack size is 600 and there is three task

the program stoped in line 334 of startup_stm32f10x_cl.s

//---------------------

DMA2_Channel1_IRQHandler

DMA2_Channel2_IRQHandler

DMA2_Channel3_IRQHandler

DMA2_Channel4_IRQHandler

DMA2_Channel5_IRQHandler

ETH_IRQHandler

ETH_WKUP_IRQHandler

CAN2_TX_IRQHandler

CAN2_RX0_IRQHandler

CAN2_RX1_IRQHandler

CAN2_SCE_IRQHandler

OTG_FS_IRQHandler

                B       .

                ENDP

                ALIGN

//--------------------------------------------

thansk

Posted on February 12, 2013 at 16:44

At a guess I'd say you haven't created a USART1_IRQHandler() or USART2_IRQHandler() and it is dumping into the unhandled interrupt routine.

If you changed the names in the vector table, you'd want to confirm the linkage.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..