Forum > Embedded - ARM

Arduino DUE and Free Pascal.

(1/3) > >>

marcov:
Anybody have experience with FPC and an Arduino DUE (which is a Cortex M3 SAM3X8E) or similar ARMs ?

I'm planning to connect a W5500 to an Arduino DUE and port a minimal UDP-only stack over to it, but coming from dsPIC33e, I'll have to start at the bottom, the datasheet looks fairly daunting.

Peripherals that I need
 - DMA a block (read/write) to SPI
     - with CS going low before the transfer, and up again after. (e.g. in the DMA finished interrupt).
     - Some notifications that it is finished. (dma finished interrupt again)
     - 8/16/32-bit DMA, does it matter?  (e.g. dspic33e has two bit pauses between units, so 16-bit DMA saves 2 bits per 16-bits send (18 instead of 20 bits per 16-bits payload)
 - Watching the INT pin with some hardware pin thingy. (edge high-to-low or so)
 - updating simple volatile variables to communicate between interrupt and the main program. in dspic33e simple operations on volatiles (  e.g. int++ in an interrupt handler) can be considered atomic, and no increments or decrements are lost. How is this on ARM M3?
 - I need some form of time keeping (e.g. for the reset period of the W5500 on startup).

I'm an intermediate programmer in C, I haven't done anything embedded in FPC.

If anybody can give me tips/hints about this, that would be welcome. The hardware is still in the mail, I'm just starting to read up.

Thaddy:
Have a look at this thread which was very helpful to me.
http://forum.lazarus.freepascal.org/index.php?topic=30960.0
I have arduino's, but no due, though.
[edit]
OTOH I don't see that processor architecture listed on my arm compiler (fpc -i)

Laksen:
Support for Cortex M3 is pretty good I would say. There's even support for SAM3X8E in trunk.

Build a compiler with
OS_TARGET=embedded CPU_TARGET=arm SUBARCH=armv7m

Compile with
-Parm -Tembedded -Cparmv7em -WpATSAM3X8E -O3 -Oonostackframe

Bam. Lazarus even has code completion for the hidden RTL units. So you can code directly to it :)

Thaddy:
@Laksen
I don't see that SAM3X8E listed when I type fpc -i (in trunk from today)

Laksen:
It's sitting right there on line 965 of compiler/arm/cpuinfo.pas

So it should be there if you see the rest of them? Did you mean to write fpc -Parm -i maybe?

Navigation

[0] Message Index

[#] Next page

Go to full version