Shop OBEX P1 Docs P2 Docs Learn Events
SimpleIDE Transition — Parallax Forums

SimpleIDE Transition

I have written a good bit of software for the P1 using SimpleIDE C++.
Does anyone know the best way to move to the P2 with C++ and save as much of the SimpleIDE C++
software as possible ??

Comments

  • JonnyMacJonnyMac Posts: 9,064
    edited 2024-08-28 22:22

    The P2 is different from the P1, and many libraries -- especially those that are hardware dependent -- for the P1 will not work on the P2. I have written more than 1000 P1 programs, and spent the last couple years translating many of them to the P2 (I use Spin).

    You have two choices for Propeller C: FlexProp and Catalina. Both are actively supported here in the forums. I think that @"Roy Eltham" did some work translating Simple IDE libraries to work in FlexProp. If you do go with FlexProp, you have the opportunity to use multiple languages (C, BASIC, Spin) in the same project, which means that until you've got a C library you need you could use one written in Spin.

  • Thanks, JonnyMac.

    I tried to write a C++ program for the LSM9DS1 on a P2 using Catalina, but I encountered lots and lots of "weird" errors. Sometimes my errors were in compilation and
    sometimes during execution. My effort went on and on and I got nowhere.

    Just for fun I tried the same code under SimpleIDE and after a few tries, it worked on the P1and has been running for many months. Of course the "problem" with the P1
    is that it lacks memory and it is getting old.

    My experiences with the P2 have all been pretty bad. The documentation is really lousy (in my opinion).

  • RaymanRayman Posts: 14,343

    For C++, as I understand it, the best option is currently the riscv jit compiler.

    There is also a “native” c++ compiler that may also work but hasn’t seen much use lately afaik

  • iseriesiseries Posts: 1,485

    I have moved most of my code over to the P2 using FlexProp with little or no changes from the P1. C code moves seamlessly.

    I have most of the sensor's libraries converted and on Git Hub here.

    Mike

  • SimpleIDE C++ is built on PropGCC which is a full C/C++ compiler.

    Catalina is an ANSI C compiler, not C++. So various things in SimpleIDE C++ will not work without rewriting in C.

    FlexProp supports C with some additions that are in the C++ direction, so it would be easier to get SimpleIDE C++ stuff converted to it, but it will still require some work depending on what your code uses of the libraries.
    I just looked at the repository for FlexProp's C libs, and it appears to have the SimpleIDE libraries libsimpletools, libsimplei2c, and a subset of libsimpletext converted over. A little bit more than I remember doing, so Eric has done some work there.
    You can include "simpletools.h" in FlexProp C code to get many of the familiar SimpleIDE library functions you need for P1. Many will work when targeting P2 also, but notably pwm/pulseIn/pulseOut do NOT have P2 variants.
    It doesn't include all the library stuff from SimpleIDE for handling various specific external devices. Displays, sensors, audio, etc. Some of those may work with without change if they used libsimpletools/libsimplei2c stuff to do their P1 specific things and didn't use too much C++ stuff.

Sign In or Register to comment.