Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2014-09

Pinguino

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Schnell

As the MIPS32 CPU now is supported, and I am involved in several PIC32 projects, I am very interested in possibilities to use FPC on this cheap and versatile chip.

While up till now I only knew the MPLABX IDE (including C compiler and C libraries) by Microchip, that needed to be attached to when doing the RTL for fpc on such architecture, I just stumbled about "Pinguino" which seems to provide an "Arduino-like" universe for PIC32.

Here we have nice cheap boards such as
http://microcontrollershop.com/product_info.php?cPath=112_160_479&products_id=4641 that come with Pinguino "Bootloader firmware" and seemingly software should be done by means of the Pinguino -IDE (
http://wiki.pinguino.cc/index.php/Main_Page ).

Is there any plan to support PIC32-Pinguino by a variant of the fpc MIPS32 RTL ?

-Michael

Reply by email

Michael Ring
to Michael Schnell

I guess it depends on what you understand by the word support ;-)

The Pinguino has a PIC32MX440F256H; translated headers for this chip are available. Flashing and Debugging with JLink V9 Adapter should also work fine with gdb, it did with every other PIC32MX I tried.

There's also support for defining the DEVCFG registers in sourcecode and 'high level' (aehm...) support for accessing gpio pins and some started code to do the same thing for uarts, timers osc and spi but nothing that I'd call complete or well tested ;-)

There's also a problem with debug symbols that is still open, I think I know how to fix that but haven't spent much time on this lately.

So, if you are willing to play arround and get your feet wet then I'd say everything is usable, if you expect full integration in RTL, bells & whizzles then there's no support (yet).

If you are interested in making this port more complete then I can check in my latest changes to the branch for this project, 90% of the code are already in trunk, perhaps the rest can also show up in trunk fast if some of the devs are willing to merge my latest changes to trunk. This should be easy as most of the changes are in the rtl/mipsel directory.

Michael

Michael Schnell wrote 22 lines
As the MIPS32 CPU now is supported, and I am involved in several PIC32 projects, I am very interested in possibilities to use FPC on this cheap and versatile chip. While up till now I only knew the MPLABX IDE (including C compiler and C libraries) by Microchip, that needed to be attached to when doing the RTL for fpc on such architecture, I just stumbled about "Pinguino" which seems to provide an "Arduino-like" universe for PIC32. Here we have nice cheap boards such as http://microcontrollershop.com/product_info.php?cPath=112_160_479&products_id=4641 that come with Pinguino "Bootloader firmware" and seemingly software should be done by means of the Pinguino -IDE ( http://wiki.pinguino.cc/index.php/Main_Page ). Is there any plan to support PIC32-Pinguino by a variant of the fpc MIPS32 RTL ? -Michael _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

Michael Schnell
to Michael Ring
Michael Ring wrote
I guess it depends on what you understand by the word support ;-)

Regarding "support", a first issue would be some kind of TODO-List / documentation e.g. in the Wiki.

Then, I suppose (but I don't know what exactly would be involved) that a dedicated RTL version would be necessary to run some fpc code in such an environment.

Additionally there would need to be a way to have the fpc code loaded and started in such an environment.

I see two ways to do this: as a function callable by some C code that is created by the Pinguino IDE, or as a stand-alone program that is just uploaded by the Pinguino tools.

I suppose for these variants, different RTLs are necessary. E.g. (1) would need to attach to malloc() and friends in the C library, while (2) would need a more complete system setup phase.

The Pinguino has a PIC32MX440F256H; translated headers for this chip are available. Flashing and Debugging with JLink V9 Adapter should also work fine with gdb, it did with every other PIC32MX I tried.

I suppose the usual Pinguino lovers will want to use the Pinguino boot flash to upload any code and not buy a JTAG hardware adapter. I have no idea how they do any debugging.

"Normal" PIC users (like myself) have "PICKit" and "ICD" adapters, that are to be used with the MPLAB IDE, and here, too, using JTAG on a PIC seems rather uncommon.

There's also support for defining the DEVCFG registers in sourcecode and 'high level' (aehm...) support for accessing gpio pins and some started code to do the same thing for uarts, timers osc and spi but nothing that I'd call complete or well tested ;-)

I suppose this also is done via JTAG. Correct ?

There's also a problem with debug symbols that is still open, I think I know how to fix that but haven't spent much time on this lately.

I suppose this also is related to JTAG.
Is there no way to use the Microchip tools (PICKit and ICD) for this ? If yes I might be able to take a look.

So, if you are willing to play arround and get your feet wet then I'd say everything is usable, if you expect full integration in RTL, bells & whizzles then there's no support (yet).

We (a colleague of mine and myself) definitively plan to try to make fpc compiled code run on a PIC32, as soon as we are ready with the current project and can hop on this extension. But we need to integrate the fpc code to be created (actually ported from a project running on PC) in a rather complex project done MPLAB in ANSI C. In fact the fpc unit needs to be called by the C code.

Show quoted text 8 lines
If you are interested in making this port more complete then I can check in my latest changes to the branch for this project, 90% of the code are already in trunk, perhaps the rest can also show up in trunk fast if some of the devs are willing to merge my latest changes to trunk. This should be easy as most of the changes are in the rtl/mipsel directory.

Great !
But at the moment we are not able to spend any time on this interesting stuff. I'll come back as soon as we can start to take a look. Moreover we don't have a JTAG Adapter to use with the PIC (we do have two for the FIDO/ARM20 and several for ATMEL and Xilinx FPGAs, but I don't supposed they are usable here.) Hence I am most interested in allowing MPLAB (i.e. gcc/gdb) to link (and debug) in the fpc code.

-Michael

Reply by email