Martin Thomas wrote:
>>> I will extend the LPC2378 example to demonstrate SWI-calls and modify the
>>> source if needed when I have some spare time.
>
> An extended version of "demo_1/epsilon" is available at:
> http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/#lpc23xx_demo1
>
> I have modified the swi-handler and startup-code:
> - modified decoding of swi-number in swi-handler (from arm-mode only,
> since the assembler-functions with the swi instruction are in arm-mode,
> so the decoding from thumb is not needed here) (swi_handler.S)
> - Exception vector "routes" SWI-exceptions to swi-handler (in startup.S)
> - application starts in USR-mode with IRQ-exceptions disabled
> (startup.S)
> - IRQs enabled in main() thru swi (main.c)
>
> Hope this helps, feedback welcome
> Martin Thomas
Hello Martin,
Thank you very much! With addition of the SWI handler,
your example is really a great one. I adapted your code for my
own board (not industry standard) and now it works fine.
To support watchdog I added a small asembler function to your
swi_handler.S and it works too, though I am not an ARM assembler
expert:
WDTfeed:
STMFD sp!, {r4}
MOV r4,#0xaa
MOV r0,#0xe0000000
STR r4,[r0,#8]
MOV r4,#0x55
STR r4,[r0,#8]
LDMFD sp!, {r4}^
MOVS PC, LR
Maybe it is not a nice code and experts can suggest a better one.
One more question: I use Programmers Notepad from the standard
WinARM, but I could not find (if exists) how to let it know about
the '@' character as a comment. So to avoid ugly highlights in
comments I replaced it with "//@". Maybe there is a better way?
Thanks in advance,
Varuzhan