This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem in converting the ARM code into THUMB

Hi,
Good Day.

I am working on ARM7TDMI core processor from Analog Devices family (ADuC703x). I developed a preemptive scheduler on the same in ARM environment. The functionality of the same is fine and its working well. For the purpose of optimization, i migrated into thumb mode using Keil RV compiler option (by changing the code generation option to THUMB mode and the optimization level option to 3 in C/C++ tab of the target settings option).

After changing the settings my code size is reduced by 2 KB. But, the complete functionality of the software got changed.

Can anybody help me out to get out of this problem?
Also, I would like to know why this kind of behavior is occurring... Please let me know your valuable suggesions.

Thanking you in anticipation,
Ravi Kumar Desaraju.

Parents
  • Why not run your scheduler in IRQ mode? You only have one FIQ source - are you sure you want to spend it on your scheduler? Basically, your tasks should not run in privileged mode - executing

    SUBS       PC, LR, #4
    

    from IRQ mode should bring you to the right task assuming your LR is restored correctly.
    You can switch modes manually while in privileged mode by writing to CPSR. Changing modes while in user mode can only occur by an exception.

Reply
  • Why not run your scheduler in IRQ mode? You only have one FIQ source - are you sure you want to spend it on your scheduler? Basically, your tasks should not run in privileged mode - executing

    SUBS       PC, LR, #4
    

    from IRQ mode should bring you to the right task assuming your LR is restored correctly.
    You can switch modes manually while in privileged mode by writing to CPSR. Changing modes while in user mode can only occur by an exception.

Children
No data