[fpc-pascal] Variable alignment in arm-embedded

alrieckert anton at riecktron.co.za
Mon Jun 11 13:46:50 CEST 2012


Hi Jeppe,

I've been using the actual ROM based interrupt table for the past month now
in freepascal ad it seems to work great. No need to declare a block of RAM
and pointing the interrupt table to it.

You can code any procedure and just give it the interrupt keyword with an
address index.

For example:



There are 3 patches you need to apply to your compiler. I'll try to submit
the patches to the Freepascal mailing list and hopefully someone will accept
them, but in the mean time you can find them here.

https://github.com/alrieckert/freepascal/commit/8255677c9a79dfec22b65c5b34be43b1602c6928
https://github.com/alrieckert/freepascal/commit/2e40029a9d4b191ee06b7b3519bdc382769adbc7
https://github.com/alrieckert/freepascal/commit/1883b86791af851f0c5093760e349dc8854c5905

The first patch enables the interrupt keyword for the arm-embedded target
and allows the compiler to generate the NVIT table that will link in at
0x080000000

The second patch is a small bug fix with the stm32f103.pp definition file

The third patch fixed the exit code, otherwise you will get Hard Fault
interrupt when a interrupt occurs as a procedure is busy restoring the stack
and SP.

No need to give the nostackframe since the ARMv7m automatically stores
R0-R3, R12, SP and LR for you when  an interrupt occurs, thus the interrupt
procedure looks exactly like a normal procedure.

Please let me know if you have any questions.

--
Anton  

--
View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Variable-alignment-in-arm-embedded-tp5709962p5709998.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.



More information about the fpc-pascal mailing list