ARM (Thumb Mode) _CPU_Context_switch_arm
Matthew J Fletcher
amimjf at gmail.com
Fri Feb 22 09:39:27 UTC 2013
Sebastian,
I am using 4.10.2 and the standard rtl22xx_t compiler options of
-mcpu=arm7tdmi -mthumb -mstructure-size-boundary=8 -mfpu=vfp
-mfloat-abi=soft -mapcs-frame -fno-schedule-insns2
The registers at before the 'bx lr' instruction in _restore() in cpu.asm.s
are;
r0 = 0x81485f54
r1 = 0x814879a4
r2 = 0x13
r3 = 0x81485ee4
sp = 0x40001c80
lr = 0x7fffe369
pc = 0x81189178
gdb says 'p _Thread_Handler'
$2 = {void (void)} 0x811999f4 <_Thread_Handler>
On 22 February 2013 08:17, Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:
> On 02/21/2013 06:02 PM, Matthew J Fletcher wrote:
>
>> Hi,
>>
>> As you may have guessed from the title my BSP is now running right up to
>> context switching into the first task, i can see from the heir structures
>> that
>> its got the correct function pointer into my Init task.
>>
>> Looking at the #ifdef __thumb__ where it restores the context it fails at
>> the
>> bx instruction, the lr register is not a valid address. Before RTEMS we
>> used a
>> home grown executive and the asm to swap contexts looks very different.
>>
>> Does anyone run an arm BSP in thumb mode ?
>>
>
> Which RTEMS version do you use and which BSP? Which compiler options do
> you use? We use Thumb mode on the lpc24xx and lpc32xx BSPs all the time.
>
> What do you mean with "the lr register is not a valid address"? For the
> first context switch in Thumb mode it should be the address of
> _Thread_Handler + 1.
>
> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone : +49 89 189 47 41-16
> Fax : +49 89 189 47 41-09
> E-Mail : sebastian.huber at embedded-**brains.de<sebastian.huber at embedded-brains.de>
> PGP : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
> ______________________________**_________________
> rtems-users mailing list
> rtems-users at rtems.org
> http://www.rtems.org/mailman/**listinfo/rtems-users<http://www.rtems.org/mailman/listinfo/rtems-users>
>
regards
---
Matthew J Fletcher
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20130222/17c5f00c/attachment-0001.html>
More information about the users
mailing list