Menu

#3 Better ARM interworking

open
nobody
None
5
2007-09-02
2007-09-02
zbuntowany
No

I'm building STR7 port now. I would like to build all picoos in full ARM mode and most of my app in THUMB. I found that system hang in that configuration. The problem is in arch_c.c file in constructStackFrame. My treads are are in thumb mode, but idle thread is in ARM mode. The solution is:

In first lines, replace definitions:

// Code
#ifdef __thumb__

#define CPU_MODE (SYS_MODE | THUMB_MODE)

#else

#define CPU_MODE SYS_MODE

#endif
// End of code

by just:
#define CPU_MODE SYS_MODE

then, in function constructStackFrame, add new variable:
// Code
unsigned int mode;
// And set it
mode = CPU_MODE
// Is task in thumb?
if(((unsigned int)funcptr & 1) != 0)
mode |= THUMB_MODE;
// End of code

last change:
// Code:
*(--str) = (unsigned int)CPU_MODE; /* CPSR */
// End of code

replace by:
// Code
*(--str) = (unsigned int)mode; /* CPSR */
// End of code

Regards
Radoslaw Koppel
(zbuntowanyREMOVE_ME at o2.pl)

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.