Shop OBEX P1 Docs P2 Docs Learn Events
PropGCC for P2 - Page 2 — Parallax Forums

PropGCC for P2

245

Comments

  • evanhevanh Posts: 15,126
    Actually, I've recently got into the habit of putting the whole sequence of assemble and download into one simple to edit line, eg:
    filename=init-diag-testing;    ../bin/fastspin -l -q -2 ${filename}.spin2; echo; ../bin/loadp2 -p /dev/serial/by-id/usb-Parallax_Inc._Propeller_P2-EVAL-ES_P2EEL5N-if00-port0 -SINGLE ${filename}.binary -v -t
    
  • samuellsamuell Posts: 554
    edited 2019-08-22 23:05
    Thanks, guys. I'll have to give this a try once I return home. Compiling from tarballs can be tricky, though.

    Kind regards, Samuel Lourenço
  • samuell wrote: »
    Thanks, guys. I'll gave to give this a try once I return home. Compiling from tarballs can be tricky, though.

    Kind regards, Samuel Lourenço
    Do a "git clone" and type "make" from the root directory. There are installation instructions in the README. It's quite easy.

  • evanhevanh Posts: 15,126
    edited 2019-08-20 03:25
    Ha, first time for me using git. I've always used the browser to download from GitHub.

    With that little hint from David I've worked out that I can do:
    git clone https://github.com/totalspectrum/loadp2
    
    and it creates a new subdirectory called loadp2 containing the 18 files ready to compile. Wasn't too hard.

    Had to work out what link to give to git though. They aren't entirely obvious.

    EDIT: Ah, found the index - https://github.com/totalspectrum?tab=repositories
  • Once again I want to point out the importance of libraries to connect to sensors, actuators, displays, whatever. It would need years to do from scratch, what is available for the Arduino Ecosystem. You can use this same libraries for Atmega 8 bit, Esp32, M0, M4, M7.
    The arduino ide has got a board manager and has got a library manager and it has got a port manager, which makes it easy to program a board over wlan, if it has this ability. If you want to use a board with M7 instead of M4, just select the other board.

    The libraries have some sort of layers. For example a display driver will use a spi or I2c lower level library. This makes it possible to reuse a higher level library.

    Of course all of you, who are involved in this discussion, could port a library easily to p2, but there are many more potential customers, who cannot.

    Can one of the existing compilers be brought into the Arduino ecosystem?
  • Once again I want to point out the importance of libraries to connect to sensors, actuators, displays, whatever. It would need years to do from scratch, what is available for the Arduino Ecosystem. You can use this same libraries for Atmega 8 bit, Esp32, M0, M4, M7.
    The arduino ide has got a board manager and has got a library manager and it has got a port manager, which makes it easy to program a board over wlan, if it has this ability. If you want to use a board with M7 instead of M4, just select the other board.

    The libraries have some sort of layers. For example a display driver will use a spi or I2c lower level library. This makes it possible to reuse a higher level library.

    Of course all of you, who are involved in this discussion, could port a library easily to p2, but there are many more potential customers, who cannot.

    Can one of the existing compilers be brought into the Arduino ecosystem?
    I think Arduino deserves a new thread. This is the PropGCC thread. Anyway, you can port the Arduino libs for your projects.

    Kind regards, Samuel Lourenço
  • I don't mean to point fingers at anyone in particular, but it seems to me that discussion of C compilers for the P2 quickly devolves into abstract requests for features. "Someone should port LLVM"; "someone should port a newer GCC"; "someone should port the Arduino IDE"; "someone should support Visual Studio", and so on. The thing is, there is no "someone". There's only us. Parallax seems to have no budget for tools development. So if you want some feature or tool for the P2, you'll have to do it -- or, equivalently, arrange for it to be done by starting a kickstarter, raising funds, and hiring a person or company to do it.

    As it stands, there are 4 C compilers for P2 already, but it's not at all clear that anyone is actually using them. I've received zero feedback on riscvp2, which is the only C++ compiler for P2 at the moment (p2gcc could be made to support C++, but it doesn't out of the box). I've received a little bit of feedback on fastspin, but mostly for the Spin and PASM features. Probably the bottom line is that there are only a few people doing P2 development and most of them are writing PASM code. There's really very little incentive right now for developers to support C on the P2. If you're a fan of C and you have a P2 eval board, then I suggest you try Catalina, or fastspin, or p2gcc, or riscvp2, and send in bug reports or better yet fixes and improvements to the author of the respective tool.
  • ersmith wrote: »
    I don't mean to point fingers at anyone in particular, but it seems to me that discussion of C compilers for the P2 quickly devolves into abstract requests for features. "Someone should port LLVM"; "someone should port a newer GCC"; "someone should port the Arduino IDE"; "someone should support Visual Studio", and so on. The thing is, there is no "someone". There's only us. Parallax seems to have no budget for tools development. So if you want some feature or tool for the P2, you'll have to do it -- or, equivalently, arrange for it to be done by starting a kickstarter, raising funds, and hiring a person or company to do it.

    As it stands, there are 4 C compilers for P2 already, but it's not at all clear that anyone is actually using them. I've received zero feedback on riscvp2, which is the only C++ compiler for P2 at the moment (p2gcc could be made to support C++, but it doesn't out of the box). I've received a little bit of feedback on fastspin, but mostly for the Spin and PASM features. Probably the bottom line is that there are only a few people doing P2 development and most of them are writing PASM code. There's really very little incentive right now for developers to support C on the P2. If you're a fan of C and you have a P2 eval board, then I suggest you try Catalina, or fastspin, or p2gcc, or riscvp2, and send in bug reports or better yet fixes and improvements to the author of the respective tool.
    Well stated. I need to get back to my work with fastspin. I'd also like to try Catalina.

  • Well, for the moment, p2gcc is my compiler of choice. I occasionally use spin2gui if I feel lazy. I already reported one "bug" with the latter, but never found any more bugs since.

    I must say that, although spin2gui is not optimal for compiling C code, I've seen great improvements. Lately, I've not been testing C code, only the occasional spin codes using the I/O boards. I've been involved in several personal projects, so I didn't had the time to test more.

    Kind regards, Samuel Lourenço
  • samuell wrote: »
    Well, for the moment, p2gcc is my compiler of choice. I occasionally use spin2gui if I feel lazy. I already reported one "bug" with the latter, but never found any more bugs since.

    I must say that, although spin2gui is not optimal for compiling C code, I've seen great improvements. Lately, I've not been testing C code, only the occasional spin codes using the I/O boards. I've been involved in several personal projects, so I didn't had the time to test more.

    Kind regards, Samuel Lourenço
    I would recommend that you use either fastspin/spin2cpp or Catalina for C code since the author of p2gcc has stated that he no longer intends to support it. Best to help work out the bugs in the compilers that we know are going to be supported going forward.


  • I think Arduino deserves a new thread. This is the PropGCC thread. Anyway, you can port the Arduino libs for your projects.

    Kind regards, Samuel Lourenço[/quote]

    Sorry for disturbing this thread. I just wanted to say, that a compiler alone is quite useless for many potential customers. And therefore for Parallax too.
    In Germany most distributes, that had P1 boards, do no longer have them in stock.
    Sorry again I will shut up.

    Best regards Christof
  • Sorry for disturbing this thread. I just wanted to say, that a compiler alone is quite useless for many potential customers. And therefore for Parallax too.
    In Germany most distributes, that had P1 boards, do no longer have them in stock.
    Sorry again I will shut up.

    Best regards Christof
    Are you saying a P2 board will only sell if we provide Arduino libraries for it?

  • I try to make visible, that it would help a lot, If P2 support would be integrated into the Arduino ecosystem. Because it makes it easy to use P2 for people, who have not got the time or the knowledge to port libraries or reinvent them.
  • I try to make visible, that it would help a lot, If P2 support would be integrated into the Arduino ecosystem. Because it makes it easy to use P2 for people, who have not got the time or the knowledge to port libraries or reinvent them.
    You'll have to talk with Ken Gracey (kgracey@parallax.com) about this. He would have to support any official Parallax effort to provide an Arduino environment for either P1 or P2.

  • I think ersmith has it exactly right, especially about parallax resources.

    Of course with unlimited resources it would be great to have a 1:1 matchup with all the Arduino libraries or mBed or whatever other platform libraries. However this represents millions in software engineering costs and years of time to 'catch up' if fully funded by parallax.

    I think the best chance for initial traction for the P2 is focus on it being a virtual peripheral not a general purpose computing device. More like how programmable logic is used. A co-processor for Arduino, not a replacement for Arduino.

    If parallax can win some big customers for PASM virtual peripheral applications then there will be funding to broaden the toolbase.

    Until then, my guess is any tool-builders are free to use whatever they want - as long as they build it themselves.

  • I'm working on binutils (starting with the current master branch) and gcc 9.1 for P2 using the older gcc 4* for P1 as reference.

    So far I have a working assembler supporting 95% of the P2 opcodes. I need to dig into the linker a bit more to understand how all of that works.

    If that goes well, I'll work on getting a simple subset of the instructions defined for gcc.
  • ntosme2 wrote: »
    I'm working on binutils (starting with the current master branch) and gcc 9.1 for P2 using the older gcc 4* for P1 as reference.

    So far I have a working assembler supporting 95% of the P2 opcodes. I need to dig into the linker a bit more to understand how all of that works.

    If that goes well, I'll work on getting a simple subset of the instructions defined for gcc.
    Wow! That's great news.

  • Actually, I just realized that you should probably start with Eric Smith's version of binutils. I think it is more current than what is in the master branch of the Parallax GitHub repository.

    https://github.com/totalspectrum/binutils-propeller
  • ntosme2 wrote: »
    I'm working on binutils (starting with the current master branch) and gcc 9.1 for P2 using the older gcc 4* for P1 as reference.

    So far I have a working assembler supporting 95% of the P2 opcodes. I need to dig into the linker a bit more to understand how all of that works.

    If that goes well, I'll work on getting a simple subset of the instructions defined for gcc.

    Our hero! :smiley:
  • Oh, I actually meant the upstream master of binutils. I assume that is more likely to be compatible with the newest gcc, though I haven't tried to build an old/new combo. I'm definitely referencing Eric's repos.

    https://www.gnu.org/software/binutils/
    git://sourceware.org/git/binutils-gdb.git

    No guarantees on timeline of course; this is mostly a learning exercise but I hadn't seen anyone mention they'd started so I'm giving it a crack.
  • @ntosme2,

    welcome to this forum if nobody told you already. And what a entrance. Absolutely cool that you are doing this.

    Parallax is currently stretched to get the (hopefully) final chip out to production and haven't started anything yet with GCC.

    To be frank and the German rude guy again, the people who did the P1 version got - miffed - because Parallax would not update their own systems and downloads to newer versions.

    Nobody assigned to at Parallax, and they where afraid to switch to newer compilers because of BlockyProp, the education and the main income.

    So P1 gcc starved. it did not die, but it starved. People involved did other things, and I, for myself, am quite happy about it.

    If Parallax would have pushed for gcc, we would not have FastSpin. Or MicroPhyton and a full running gcc c/c++ CMM version for the p2 using RISCV with some just in time compiler, something @ersmith should brag about more so the message gets out.

    Mike
  • That is good news! There is hope for gcc and for Linux users.

    Thanks for your involvement, ntosme2.

    Kind regards, Samuel Lourenço
  • samuell wrote: »
    That is good news! There is hope for gcc and for Linux users.

    Thanks for your involvement, ntosme2.

    Kind regards, Samuel Lourenço
    I don't understand your comment about Linux users. Both fastspin and Catalina as well as p2gcc run under Linux. We already have lots of Linux tools.

  • samuellsamuell Posts: 554
    edited 2019-08-22 17:30
    David Betz wrote: »
    samuell wrote: »
    That is good news! There is hope for gcc and for Linux users.

    Thanks for your involvement, ntosme2.

    Kind regards, Samuel Lourenço
    I don't understand your comment about Linux users. Both fastspin and Catalina as well as p2gcc run under Linux. We already have lots of Linux tools.
    Sorry, wrong context, maybe. I was not aware that the tools you mentioned was ported for Linux. I had the notion that gcc was the only tool for Linux ( tested this after importing it via nix).

    In advance, however, if you are going to say that I need to compile Catalina, or p2gcc, or fastspin, I might not consider that Linux ready, because to compile it I will probably need to do some modifications, to the system and to the makefile.

    Do these tools compile under Ubuntu/Kubuntu/Debian with the native compiler, without having to add extra out-of-repository or unnoficial packages? If so, I consider them Linux ready. If not, it is a port and I can't consider them. I don't want to mess up my system.

    That is why I don't have git installed.

    Kind regards, Samuel Lourenço
  • David BetzDavid Betz Posts: 14,511
    edited 2019-08-22 17:34
    samuell wrote: »
    David Betz wrote: »
    samuell wrote: »
    That is good news! There is hope for gcc and for Linux users.

    Thanks for your involvement, ntosme2.

    Kind regards, Samuel Lourenço
    I don't understand your comment about Linux users. Both fastspin and Catalina as well as p2gcc run under Linux. We already have lots of Linux tools.
    Sorry, wrong context, maybe. I was not aware that the tools you mentioned was ported for Linux. I had the notion that gcc was the only tool for Linux ( tested this after importing it via nix).

    In advance, however, if you are going to say that I need to compile Catalina, or p2gcc, or fastspin, I might not consider that Linux ready, because to compile it I will probably need to do some modifications, to the system and to the makefile.

    Do these tools compile under Ubuntu/Kubuntu/Debian with the native compiler, without having to add extra out-of-repository or unnoficial packages? If so, I consider them Linux ready. If not, it is a port and I can't consider them. I don't want to mess up my system.

    That is why I don't have git installed.

    Kind regards, Samuel Lourenço
    Yes, they should compile with standard tools on most any Linux distribution. You'll find that the same is true of GCC. Unless someone puts together a binary distribution you have to build from sources. Also, fastspin was not "ported to Linux". It was developed under Linux and ported to the other platforms.

  • samuell wrote: »
    David Betz wrote: »
    samuell wrote: »
    That is good news! There is hope for gcc and for Linux users.

    Thanks for your involvement, ntosme2.

    Kind regards, Samuel Lourenço
    I don't understand your comment about Linux users. Both fastspin and Catalina as well as p2gcc run under Linux. We already have lots of Linux tools.
    Sorry, wrong context, maybe. I was not aware that the tools you mentioned was ported for Linux. I had the notion that gcc was the only tool for Linux ( tested this after importing it via nix).

    In advance, however, if you are going to say that I need to compile Catalina, or p2gcc, or fastspin, I might not consider that Linux ready, because to compile it I will probably need to do some modifications, to the system and to the makefile.

    Do these tools compile under Ubuntu/Kubuntu/Debian with the native compiler, without having to add extra out-of-repository or unnoficial packages? If so, I consider them Linux ready. If not, it is a port and I can't consider them. I don't want to mess up my system.

    That is why I don't have git installed.

    Kind regards, Samuel Lourenço

    Binary versions of most tools are available on my server, linked in my signature. So far everyone has written fairly nice tools that compile without much trouble SimpleIDE and PropGCC are, by far, the most complicated tools to build from source (in terms of required dependencies).
  • DavidZemon wrote: »
    samuell wrote: »
    David Betz wrote: »
    samuell wrote: »
    That is good news! There is hope for gcc and for Linux users.

    Thanks for your involvement, ntosme2.

    Kind regards, Samuel Lourenço
    I don't understand your comment about Linux users. Both fastspin and Catalina as well as p2gcc run under Linux. We already have lots of Linux tools.
    Sorry, wrong context, maybe. I was not aware that the tools you mentioned was ported for Linux. I had the notion that gcc was the only tool for Linux ( tested this after importing it via nix).

    In advance, however, if you are going to say that I need to compile Catalina, or p2gcc, or fastspin, I might not consider that Linux ready, because to compile it I will probably need to do some modifications, to the system and to the makefile.

    Do these tools compile under Ubuntu/Kubuntu/Debian with the native compiler, without having to add extra out-of-repository or unnoficial packages? If so, I consider them Linux ready. If not, it is a port and I can't consider them. I don't want to mess up my system.

    That is why I don't have git installed.

    Kind regards, Samuel Lourenço

    Binary versions of most tools are available on my server, linked in my signature. So far everyone has written fairly nice tools that compile without much trouble SimpleIDE and PropGCC are, by far, the most complicated tools to build from source (in terms of required dependencies).
    I see your server builds spin2cpp but there may be people who aren't aware that that project also builds fastspin. Most of the discussion in the forums is about fastspin. Maybe you should add a comment to that effect in your description of that project so people know what to download to get fastspin?
  • David Betz wrote: »
    DavidZemon wrote: »
    samuell wrote: »
    David Betz wrote: »
    samuell wrote: »
    That is good news! There is hope for gcc and for Linux users.

    Thanks for your involvement, ntosme2.

    Kind regards, Samuel Lourenço
    I don't understand your comment about Linux users. Both fastspin and Catalina as well as p2gcc run under Linux. We already have lots of Linux tools.
    Sorry, wrong context, maybe. I was not aware that the tools you mentioned was ported for Linux. I had the notion that gcc was the only tool for Linux ( tested this after importing it via nix).

    In advance, however, if you are going to say that I need to compile Catalina, or p2gcc, or fastspin, I might not consider that Linux ready, because to compile it I will probably need to do some modifications, to the system and to the makefile.

    Do these tools compile under Ubuntu/Kubuntu/Debian with the native compiler, without having to add extra out-of-repository or unnoficial packages? If so, I consider them Linux ready. If not, it is a port and I can't consider them. I don't want to mess up my system.

    That is why I don't have git installed.

    Kind regards, Samuel Lourenço

    Binary versions of most tools are available on my server, linked in my signature. So far everyone has written fairly nice tools that compile without much trouble SimpleIDE and PropGCC are, by far, the most complicated tools to build from source (in terms of required dependencies).
    I see your server builds spin2cpp but there may be people who aren't aware that that project also builds fastspin. Most of the discussion in the forums is about fastspin. Maybe you should add a comment to that effect in your description of that project so people know what to download to get fastspin?

    Good point. Done.
  • evanhevanh Posts: 15,126
    samuell wrote: »
    I was not aware that the tools you mentioned was ported for Linux. I had the notion that gcc was the only tool for Linux ( tested this after importing it via nix).
    These tools are built around GCC and its make system. They could be considered as native Linux programs ported to Windoze.

  • Well, being that the case, I should try to compile those tools as soon as possible.

    Kind regards, Samuel Lourenço
Sign In or Register to comment.