Hello - I'm writing a simple usart console application using RTX with MDK-ARM v3.20 on an MCBSTM32. The code ends up in either MemManage_Handler or HardFault_Handler when setting an event via isr_evt_set in the interrupt that services the USART. I get the same result when running the MCBSTM32\RTX_Traffic example, which is similar to my application. Is there anyone out there running this example successfully? Thanks -
Hi Ben,
I am not familiar with your specific board and processor but I can probably give you some ideas where to look for possible problems.
Do you allow nested interrupts?
If yes, don't use isr_evt_set; instead use os_evt_set. The reason is that allowing nested interrupts, you switch back into user/system mode! The problem with this situation is that you may force a task switch in your interrupt handler and start the waiting task. Your interrupt will only finish after the related task is finished.
I would start with non-nested interrupts using isr_evt_set and once this is working you can switch to nested interrupts if this is really necessary.
Frank
Frank,
Inside STM32 device is a Cortex-M3 (not ARM7/9) which has a completely different Interrupt system. There is no User or System mode but Thread and Handler mode.
Normal code runs in Thread mode and Handler mode is entered as a result of an exception/interrupt (also true for nested interrupts). Therefore nested interrupts should not be the reason for the problem that Ben reported. Also the mentioned RTX_Traffic example doesn't use nested interrupts.
Ben,
I see no problems when running RTX_Traffic on MCBSTM32. You should send the description on how to duplicate the problem with RTX_Traffic to support.intl@keil.com
Thanks for your responses. I'll continue as suggested.