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.
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.
Hi Michel,
Thanks for your response.
Actually, my code is into 2 parts. The scheduling algorithms and task creation part is implemented in C and ISR, Context switching and Wait state machine are developed in assembly. The C code is consumed huge memory in ARM mode (around 3.5KB) and 1.3 KB is assembly (with ARM mode and optimization level as 0).
for the above mentioned figures (ROM), I opted for THUMB mode and observed huge optimization result.
Any ways, the functionality got affected. But, If we use "ARM/THUMB interworking" option from the C/C++ and ASM tab from the target options, I think we can work with any instruction set (ARM/THUMB) since the compiler is taking care about the conversion of instruction from one mode to another mode (ARM to THUMB or THUM to ARM).
Please give me your valuable suggestions if any?
Thanks and Regards, Ravi Kumar Desaraju.
can you explain what you mean by "the functionality got affected"? does you context switch no longer work? checking ARM/Thumb interworking will generate assembly code that can either be executed in ARM or in thumb. It has no effect, as far as I know, on pure assembly code. So if your context switch does not work, you better carefully check whether your assembly code complies with all thumb rules.
Hi,
Yes.... the problem is with context switching only. I am using few 32-bit move instructions in context switching does it affects any functionality in THUMB mode?