I am trying to create an RTX project to run on the A2F-EVAL-KIT. I have three tasks running, two of them have a priority of 1 and use os_evt_set and os_evt_wait_or to take turns executing. This runs properly. Task 3 has a priority of 2 and uses os_evt_wait_or to wait for isr_evt_set in an ISR. Every time the isr_evt_set is called in the ISR, there is a runtime error and the os_error function is called in RTX_Conf_CM.c. This is the only ISR and the only isr_ call that is made. The returned value of err_code is 2, which appears to be a OS_ERR_FIFO_OVF. I tried increasing the ISR FIFO Queue size to 96, however the runtime error still occurs ever time. I also created another project following this example as closely as possible.
www.keil.com/.../rlarm_ar_inter_funct.htm
I still encounter the same error. I imagine that there some be some configuration that I am missing. I am running uVision 4.2, but I had the same problem with the previous version. Also, I am using the ULink2 programmer.
Thanks in advance, Brandon
Actel did not implement the exclusive access instructions (LDREX/STREX/CLREX) in their Cortex-M3 SmartFusion devices which causes the RTX problems you are seeing.
Cortex-M3 device should implement the ARMv7-M architecture which includes also exclusive access instructions. RTX is taking advantage of those instructions (no interrupts disabling …).
Current RTX bypass for SmartFusion is to prevent using the exclusive access instructions.
Modifying RTX (MDK-ARM V4.20) for SmartFusion requires following steps:
1. Edit file "Keil\ARM\RL\RTX\SRC\CM\rt_HAL_CM.h" Replace two occurrences of
#if defined(__TARGET_ARCH_7_M) || defined(__TARGET_ARCH_7E_M)
with
#if 0
2. Edit file "Keil\ARM\RL\RTX\SRC\CM\rt_MemBox.c" Replace three occurrences of
#if !(defined(__TARGET_ARCH_7_M) || defined(__TARGET_ARCH_7E_M))
#if 1
3. Rebuild RTX library (project Keil\ARM\RL\RTX\RTX_Lib_CM.uvproj)
4. Copy the new RTX library RTX_CM3.lib into folder Keil\ARM\RV31\LIB
5. Rebuild your project
Robert,
Thank you! This was right on. Problem solved. We may be able to use RTX after all. The only advice I would give for other people who are new to uVision like myself, make sure when you open the the project (Keil\ARM\RL\RTX\RTX_Lib_CM.uvproj), to select the correct target. In my case I needed to select CM3_LE. I got hung up a little on this.
Thanks again.