We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I'm using MDK303Beta2 to debug UCOS-II on LM3S MCU. At different optimization level of C/C++, diferent asm instructions will be used to build a C instrction, but sometime, the asm intstructions access inexistent RAM spcace and Fault exception occurs. For example, there are 3 lines of C: Queue->NData = 0; Queue->ReadEmpty = Empty; Queue->WriteFull = Full; If I select "Optimization" to Level 1, it will be MOVS R1, #0x00 STRH R1, [R4, #0x0C] STR R5, [R4, #0x10] STR R5, [R4, #0x14] It's fine, no error. But if I select "Optimization" to the other levels(0,2,3), same asm instructions will be use: STRD R1, R2, [R4, #0x04] MOVS R1, #0x00 STRH R1, [R4, #0x0C] when STRD excuted, fault exception occurs. And "Level 1" is not always ok, as the code becomes biger and biger, sometime level 0 ok, soemtime level 3...Sometime compiler ignores something, like for "Prio>>3", sometime shifting right is omited, "Prio" is used directly in the following.
I also found that RVCT produces wrong code when using float or double for Luminary parts (THUMB2). the same piece of code works fine for ARM devices (Ex LPC2148,....)