[fpc-devel] Arm Thumb2 - Stellaris status

Jeppe Græsdal Johansen jjohan07 at student.aau.dk
Sun Aug 21 18:59:30 CEST 2011

Den 21-08-2011 17:43, John Clymer skrev:
> I found FPC_HAS_SYSTEMS_INTERRUPT_TABL, enabled it - but it was still 
> broken for Thumb2 (stellaris, stm32).
> For Thumb2, it was broken in the following ways:
> 1) Stack_top should be placed at vector 0.
I disagree, but I guess that's a question of interpretation. I don't 
think it's really a vector. So currently vector 0 is for the reset 
vector at address 0x80000004, and _stack_top is placed in front of the table
> 2) Each address should have the LSB set - to "force" Thumb mode when 
> the PC gets loaded with that value.
That's the linkers job. And it is handled correctly currently as long as 
the labels where they are pointing to are marked with the .thumb_func 
directive(as they are when using -Cpcortexm3)
> I defined FPC_HAS_SYSTEMS_INTERRUPT_TABLE a little further down - so 
> that was only enabled on ARM and AVR (trying not to break other things...)
> I also have some added logic in ncgutil - for M3 devices - to place 
> the stack_top into vector 0, then place handlers for vectors 1 to 
> TOP.  The WriteVector routine for Thumb also adds an offset of 1 to 
> each vector - so as to force Thumb mode upon load to PC.
You shouldn't add anything to get thumb vectors, as I explained further up.
> John

More information about the fpc-devel mailing list