[FYI] PropWare: Complete build system and library for PropGCC

DavidZemonDavidZemon Posts: 2,220
edited August 2016 in Propeller 1 Vote Up0Vote Down
Dead links to PropWare: If you encounter any dead links to PropWare, please do not assume the site is dead! Many pages have moved over time and the file extension has changed from html to xhtml. If you're looking for a specific page, tag me with @DavidZemon and I'll get you the correct link!

I'd like to formally introduce PropWare - my way of giving relative simplicity to beginners and power to experts.

Inspiration

I've drawn inspiration from a lot of different projects over the years, but there are three big ones that helped to form PropWare into what it is today more than anything else.

Arduino

Arduino is the king of "easy" in the microcontroller world. Though they aren't the fastest, and they aren't the cheapest, they have a monopoly on documentation and users. I use www.arduino.cc as my benchmark for ease of use and documentation standards.

TI's TivaWare

My first introduction to a hardware abstraction layer was with TI's StellarisWare (now called TivaWare). It opened my eyes to a new world where I would be able to develop a complex application on a microcontroller, accessing all of its hardware peripherals, without needing to pull out the datasheet every minute. I believe I can reproduce the same power and flexibility on the Parallax Propeller.

@SRLM's libpropeller

SRLM's libpropeller was the wake up call that convinced me not only to use C++, but to use header files as much as possible. It has also given me a constant drive to add more peripherals and objects, simply for competition's sake, even before there were many users.

Overview

PropWare is a combination of three key pieces:
  • Easy, configurable and fast C/C++ objects for the Propeller, including objects from
    • My own PropWare namespace
    • Parallax's C Simple Library
    • SRLM's libpropeller
    • Arduino library port: libArduino
  • An easy-to-use and robust build system using CMake
  • Thorough documentation and tutorials

Installation binaries make setup easy, and CMake functions make building complex applications quick. If you are an Eclipse user, CMake provides a simple command that will generate an Eclipse project (no need for a special Propeller plugin!). Students can take free advantage of JetBrains' new C++ IDE, (CLion), which supports CMake out-of-the-box and is the recommended tool for use with PropWare applications.

Goals and Aspirations

My goal is to provide both novice and expert users alike a single environment that approaches the simplicity of SimpleIDE or Arduino without compromising power or flexibility. I believe it is possible to create a single environment capable of introducing first-time programmers to the Propeller, as well as satisfying a commercial-grade applications. There are lots of ways PropWare doesn't fit into this vision currently, but it is an active and ongoing effort to make improvements every day.






Original post below


What is PropWare?
PropWare is a combination of three key pieces:
  • Easy, configurable and fast C++ objects for the Propeller (includes the C Simple Library from Parallax, libpropeller by SRLM, and my own PropWare namespace)
  • An easy-to-use and robust build system using CMake (lots of examples for anyone not yet familiar)
  • Thorough documentation regarding both source code and setup
My goal is to provide both novice and expert users alike a single environment that approaches the simplicity of SimpleIDE or Arduino without sacrificing a single ounce of power or flexibility. This is accomplished entirely with CMake and it's submodule, CPack. An executable installer is available for Windows and both Red Hat and Debian Linux derivatives. If you are an Eclipse user, CMake provides a simple command that will generate an Eclipse project for you (no need for a special Propeller plugin!). JetBrains' new C++ IDE (CLion) supports CMake out-of-the-box and is the recommended tool for use with PropWare applications.

All source code has been MIT licensed and hosted on GitHub with documentation and binaries available from my website.

I have to give a huge thank you out to everyone here on the forums that have helped me get this far - jazzed, srlm, ericpine, pmrobert, David Betz, and many others.

Key Features:
  • More C++ for the Propeller!
  • CMake for the Propeller!
  • Support for Eclipse, CLion and other full-featured IDEs!
  • Active development - I'm open to requests for new objects/peripherals!

Relevant links:
PropWare: http://david.zemon.name/PropWare/
Issue Tracker: https://github.com/parallaxinc/PropWare/issues
libpropeller: https://github.com/libpropeller/libpropeller
C Learning System: http://learn.parallax.com/propellerc

106264.png

Cheers,
David Zemon
100 x 100 - 10K
David
PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
«1345

Comments

  • 141 Comments sorted by Date Added Votes
  • DavidZemonDavidZemon Posts: 2,220
    edited August 2014 Vote Up0Vote Down
    PropWare's current status: Sep 21, 2014

    Installation
    • Linux installation is very well tested and working great.
    • Windows installation has succeeded on 4/5 computers tested. Please give it a try and report your results.
    • Mac is untested. If you have a Mac, please get in contact with me.
    Miscellaneous
    • Documentation is going great and a basic C/C++ tutorial is well under way. Please provide any comments you might have
    • Dat files are supported but the Learn library changed and pst.dat is no longer included. This only affects FdSerial from the Learn library and the workaround is to copy "pst.dat" from an older version of the Learn folder into your project directory and add it as a source file in CMakeLists.txt.
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
  • jazzedjazzed Posts: 11,795
    edited August 2014 Vote Up0Vote Down
    Sounds good David.

    Where do I get started for testing INSTALL.py on Linux?
  • DavidZemonDavidZemon Posts: 2,220
    edited August 2014 Vote Up0Vote Down
    Simply download PropWare (a binary distribution or the source code) and run INSTALL.py from the util directory.
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
  • DavidZemonDavidZemon Posts: 2,220
    edited August 2014 Vote Up0Vote Down
    Oh, and I almost forgot, there are environment variables that get set during the installation script, so at a bare minimum you should open a new terminal. If you choose to let it install root environment variables (you'll see what I'm talking about - there's a prompt), you'll need to reboot.

    I also realized this morning that, if you have cmake installed via apt-get, the script will fail upon trying to copy over the module files. You'll need to tell it to download a new version (again, there's a prompt for it). I'll get that fixed tonight. Along with searching for PropGCC in /opt/parallax if it isn't in $PATH.
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
  • DavidZemonDavidZemon Posts: 2,220
    edited August 2014 Vote Up0Vote Down
    Steve - how did INSTALL.py work? The version in release-2.0-nightly should be pretty robust for Linux now. The only thing I still haven't figured out how to do determine the installation path of CMake when installed via the package manager :/

    --EDIT--
    All Linux problems should be sorted out. If anyone runs into any issues or anything at all confusing with the INSTALL.py script in release-2.0-nightly, please let me know! Also, I still don't have a single test user for this. If there are any Linux users out there willing to give it a try, I'd appreciate it. I've run it in on a test machine with a fresh version of Ubuntu as well as my normal dev machine, but I need more test cases.
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
  • DavidZemonDavidZemon Posts: 2,220
    edited August 2014 Vote Up0Vote Down
    Documentation is coming right along. Folks unfamiliar with CMake should now be able to get started with PropWare projects by following the instructions here: http://david.zemon.name/PropWare/md_AppDeployment.html. Any missing information can be gleaned from example projects while I continue building up the docs.

    Also, minor bug fix involving root environment variables for Debian users has been applied to the release-2.0-nightly branch.

    Still no progress on Windows :( I've run into a brick wall. Hopefully it will be resolved soon.

    Steve:
    I added some installation instructions just for you :)
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
  • jazzedjazzed Posts: 11,795
    edited August 2014 Vote Up0Vote Down
    Sorry.

    I have been too busy to try your installer.

    Not sure when I'll have time.
  • DavidZemonDavidZemon Posts: 2,220
    edited August 2014 Vote Up0Vote Down
    Bug fix in release-2.0-nightly - 32-bit Debian-based machines will now be compatible. Apparently, 64-bit versions of PropGCC aren't very cooperative with 32-bit OSes. Who'd have thought?
    Another minor bug fixed where root environment variables on Debian were never actually written​ to /etc/environment.

    Thanks kuroneko!
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
  • DavidZemonDavidZemon Posts: 2,220
    edited August 2014 Vote Up0Vote Down
    Excellent news everyone! PropWare is now 100% compatible with the Simple Libraries! This includes the elusive FDSerial library.

    I will soon add support for Spin as well - for now the only extra addition was .dat files (Simple ships with pst.dat and pst.spin).

    Also, the Learn folder has been updaed to 8/27. The previous link (7/30) went down so if you try to run INSTALL.py without updating to the latest branch, it will die. I've also fixed that by mirroring the Learn folder on my server.
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
  • DavidZemonDavidZemon Posts: 2,220
    edited September 2014 Vote Up0Vote Down
    I finally wrote some basic documentation on using Make and CMake. I know I missed some stuff - so those new to CMake and Make, I would greatly appreciate your input and questions.

    CMake & Make Tutorial: http://david.zemon.name/PropWare/md_CMakeTutorial.html
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
  • DavidZemonDavidZemon Posts: 2,220
    edited September 2014 Vote Up0Vote Down
    WINDOWS USERS! Rejoice! I bring to you a version of PropWare that is finally ready for native testing on your operating system! Please refer to the release-2.0 branch.

    At the time of this writing I have tested on a total of four machines: Windows 8.1 64-bit virtual machine (working), Windows 7 32-bit virtual machine (working), Windows 8.1 64-bit native (not working), Windows 8.1 64-bit (working). That's 3 out of 4 working computers. I do not yet know what is wrong with the machine that isn't working. I would love to hear from more users whether or not PropWare installs successfully on their machines and, if not, what their setup is.

    Installation will require Python. See instructions PropWare's installation instructions here.

    --Edit--
    4/5 working :)
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
  • pmrobertpmrobert Posts: 403
    edited September 2014 Vote Up0Vote Down
    Good stuff! I'll give it a shot tomorrow. Did you figure out a workaround for the fdserial issue?
  • DavidZemonDavidZemon Posts: 2,220
    edited September 2014 Vote Up0Vote Down
    Haven't looked into yet. Now that I have this working on Windows, I can concentrate on some other small issues like FdSerial
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
  • DavidZemonDavidZemon Posts: 2,220
    edited September 2014 Vote Up0Vote Down
    I was just pointed at this: http://www.msrobots.net/propware-system.aspx

    Anyone know if the name conflict is important enough to matter? I don't want to step on any toes, so I'll rename if I must, but I obviously would prefer not to. I couldn't find contact information anywhere on that site nor an author.
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
  • msrobotsmsrobots Posts: 1,419
    edited September 2014 Vote Up0Vote Down
    SwimDude0614,

    Do not worry at all.

    I am the author and this project is on ice since two years. And might stay there.

    You are absolutely free to use PropWare for your own project.

    Do not worry at all.

    Enjoy!

    Mike
    I am just another Code Monkey.

    A determined coder can write COBOL programs in any language. -- Author unknown.

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this post are to be interpreted as described in RFC 2119.
  • DavidZemonDavidZemon Posts: 2,220
    edited September 2014 Vote Up0Vote Down
    Cool, glad to hear it! Thanks :)

    David
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
  • DavidZemonDavidZemon Posts: 2,220
    edited October 2014 Vote Up0Vote Down
    The following quote comes from another thread, which I will reply to here...
    StefanL38 wrote: »
    Hi David,

    as I have never coded in C/C++ before I'm the ideal candidate for all the beginner questions.
    If you would answer my questions how to use PropWare I would like to write a beginners guide for PropWare-C-Coding.

    I am always interested in getting the opinions/views of more beginners. It's been many years since I was in your shoes and I know I've forgotten what it's like.

    I'm all for you writing or helping me write a beginners guide. I think I already have a strong start on that though, so rather than creating another new page, it will probably be an addition or revamp to an existing page within PropWare's docs.
    StefanL38 wrote:
    I followed your installation-guide and I guess the installation is successful.

    It finished with the message
    "Linking C executable SimpleText_Demo.elf
    [100%] Buildt target SimpleText_Demo"

    Glad to hear the installation was successful :). Get used to the less-than-useful completion notes. It's a Linux/Unix standard philosophy to only print upon error, not upon success.
    StefanL38 wrote:
    Aha. - - - Now I'm lost. (As I have never coded in C before)

    PropWare is a "built-system". So does this mean I use a texteditor to write the code and then use PropWare to build the final code?
    Sounds complicated.

    Using the propellertool is easy. Start propellertool write code hit F11 code is transferred to PropChip and running.

    Coding in C seems much more complicated. Lot's of includefiles, a makefile etc. etc.
    What would be a good starting point to learn about getting started in coding C for the propeller-chip?

    best regards

    Stefan

    The key to this is in my goal with PropWare: "to provide both novice and expert users alike a single environment that approaches the simplicity of SimpleIDE or Arduino without sacrificing a single ounce of power or flexibility." Think of it like this: SimpleIDE and Arduino are shovels, PropWare is a bulldozer. The shovel is easy, you don't need any training, and you can get started real quick digging your hole. But.... if you take 5 minutes to learn how to operate the bulldozer, you're not even in the same league anymore. PropWare (when combined with JetBrains' CLion or Eclipse) is the bulldozer. (Obviously this is meant in every literal sense and I am not in any way biased :D )

    Regarding build system vs text editor, you are exactly right. PropWare does not provide an editor because it does not sacrifice flexibility. But I highly recommend using JetBrains' CLion with PropWare. It is my go-to editor and the power it brings will amaze you. It is not yet as easy as one would hope, because it was not in any way, shape, or form designed to be used with microcontrollers... but it works nonetheless. It's still in beta stages, but support for microcontrollers is one of the top-voted issues by beta users so I'm hopeful that it will get easier soon.

    Eclipse and Code::Blocks are two more options. If you're on a Mac, XCode will work. All three of those IDEs are good choices (Eclipse is the only one I'm familiar with, so you're on your own for help if you choose the other two). Support for these three is more stable, but less flexible (not in my hands to fix).

    Getting started....
    Let's see... next I'd say you're ready to write a program. Check out Creating a PropWare Application and let me know what questions you have after that. You may want to look at the examples and practice with those (MultiCogBlinky and Concurrency are good ones to start with since they require no additonal hardware other than a Quickstart board). Also, make sure you read the CMake and Make Tutorial.
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
  • dgatelydgately Posts: 883
    edited October 2014 Vote Up0Vote Down
    I would like to make one recommendation...

    Within the PropWare installation webpage, you should give a link to the git repository or the PropWare binary page wherever you mention downloading PropWare. I know that there are links on page one, but why not give the reader a link right where you describe installation?

    For Windows:
    "Download PropWare to your computer." <== should be a link to either a download or page that allows choosing which download. Currently the link is to the namespacePropWare, which is not what the reader is expecting.

    For Linux:
    "Simply download PropWare in any way that you like..." <== should be a link to the actual download or page that allows user choices for download.

    https://github.com/DavidZemon/PropWare <== a good link for those wanting source code!
    http://david.zemon.name/downloads/PropWare_Binaries/PropWare_current.zip <== a good link for those wanting binaries!

    I was starting to research what it would take to provide instructions for Mac OS X, but got a bit frustrated being sent to the namespace definition of PropWare when I expected to download. You may find casual webpage readers less interested in going further if the links are somewhere back at the main page, only.



    dgately
    Livermore, CA (50 miles SE of San Francisco)
  • DavidZemonDavidZemon Posts: 2,220
    edited October 2014 Vote Up0Vote Down
    dgately wrote: »
    Within the PropWare installation webpage, you should give a link to the git repository or the PropWare binary page wherever you mention downloading PropWare

    Very good point! Can't believe I didn't think of that myself lol. It will be updated momentarily...

    _Edit_
    Fix applied
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
  • dgatelydgately Posts: 883
    edited October 2014 Vote Up0Vote Down
    Now I'm really going to be a pest :-)

    When I run the install process on a Mac OS X system that has a recently-built propgcc release_1_0 version installed, I get the following message:
    [COLOR=#000000][FONT=Monaco]$ python INSTALL.py [/FONT]
    [FONT=Monaco]An existing version of PropGCC (containing propeller-elf-as older than 2.31.1) has been detected. PropWare requires propeller-elf-as 2.31.1 or higher - a new version will be installed.[/FONT]
    [FONT=Monaco]PropGCC will be installed to /Users/myUserName. Press enter to continue or type another existing path to download to a new directory.[/FONT]
    [/COLOR]
    

    Looks like you are using a newer branch of propgcc than the currently released version (release_1_0). Is that a requirement due to the needs of PropWare or did you just happen to use a newer propgcc for your implementation? I definitely don't want to step on my installed propgcc as I'm doing development work that depends on release_1_0 existing and its PATH set to /opt/parallax/bin.

    As implied above, I could allow PropWare to install propeller-elf-as & other executables into my user space (at: /Users/myLogin/), but I also don't want my other development work pointing at this new location, either. Do you set environment paths that I'll need to edit back to /opt/parallax/bin when I'm not using PropWare?


    Or, will PropWare run with propgcc release_1_0? If so, can I just mod INSTALL.py to remove installation of propeller-elf-as and/or other executables?


    Thanks,
    dgately
    Livermore, CA (50 miles SE of San Francisco)
  • DavidZemonDavidZemon Posts: 2,220
    edited October 2014 Vote Up0Vote Down
    dgately wrote: »
    Now I'm really going to be a pest :-)

    When I run the install process on a Mac OS X system that has a recently-built propgcc release_1_0 version installed, I get the following message:
    [COLOR=#000000][FONT=Monaco]$ python INSTALL.py [/FONT]
    [FONT=Monaco]An existing version of PropGCC (containing propeller-elf-as older than 2.31.1) has been detected. PropWare requires propeller-elf-as 2.31.1 or higher - a new version will be installed.[/FONT]
    [FONT=Monaco]PropGCC will be installed to /Users/myUserName. Press enter to continue or type another existing path to download to a new directory.[/FONT]
    [/COLOR]
    

    Looks like you are using a newer branch of propgcc than the currently released version (release_1_0). Is that a requirement due to the needs of PropWare or did you just happen to use a newer propgcc for your implementation? I definitely don't want to step on my installed propgcc as I'm doing development work that depends on release_1_0 existing and its PATH set to /opt/parallax/bin.

    As implied above, I could allow PropWare to install propeller-elf-as & other executables into my user space (at: /Users/myLogin/), but I also don't want my other development work pointing at this new location, either. Do you set environment paths that I'll need to edit back to /opt/parallax/bin when I'm not using PropWare?


    Or, will PropWare run with propgcc release_1_0? If so, can I just mod INSTALL.py to remove installation of propeller-elf-as and/or other executables?


    Thanks,
    dgately

    To compile PropWare from source requires the assembler listed above. What you could do is edit the Python script to not bother checking the version number (let me know if you need help with that. I didn't make any effort to document it). Once you run the installation script again, it will fail because propeller-elf-as will die. Once it does, just delete the entire `bin` folder and replace it with one from a binary distribution of the same branch. Do not run make or cmake (or the install script) after replacing the bin folder.

    To answer your other questions directly (which no longer matter if you follow my instructions above)...
    The install script does add the new version of PropGCC to the PATH in your .bashrc file. It also adds cmake to the PATH and creates two new variables: PROPWARE_PATH and PROPGCC_PREFIX.

    There should be some TODOs in the installation script in the MacInstaller class. I haven't yet figured out the best/least-bad way to set root environment variables so that GUI applications will have access to the PROPWARE_PATH and PROPGCC_PREFIX environment variables (they're used in the CMake files and are therefore required by an IDE reading from the CMake or Make files).
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
  • dgatelydgately Posts: 883
    edited October 2014 Vote Up0Vote Down
    To answer your other questions directly (which no longer matter if you follow my instructions above)...
    The install script does add the new version of PropGCC to the PATH in your .bashrc file. It also adds cmake to the PATH and creates two new variables: PROPWARE_PATH and PROPGCC_PREFIX.

    There should be some TODOs in the installation script in the MacInstaller class. I haven't yet figured out the best/least-bad way to set root environment variables so that GUI applications will have access to the PROPWARE_PATH and PROPGCC_PREFIX environment variables (they're used in the CMake files and are therefore required by an IDE reading from the CMake or Make files).

    Thanks!

    I'll take a look at the script to see about making it work in my environment and I'll make a script that can reverse any environment settings. Should allow me to use PropWare and still do my other development work!

    dgately
    Livermore, CA (50 miles SE of San Francisco)
  • DavidZemonDavidZemon Posts: 2,220
    edited October 2014 Vote Up0Vote Down
    dgately wrote: »
    Thanks!

    I'll take a look at the script to see about making it work in my environment and I'll make a script that can reverse any environment settings. Should allow me to use PropWare and still do my other development work!

    dgately

    Great :) Send me an email with some notes if you make any progress toward root env. vars on mac. I think that was my biggest hurdle.
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
  • StefanL38StefanL38 Posts: 2,275
    edited October 2014 Vote Up0Vote Down
    Hi David,

    OK i started at Creating a PropWare Application
    1. CMakeLists.txt OK I understand

    2. Write your Sourcecode - yeah! that's where I have to practice before going on with

    "3. At the terminal, enter your project's directory..... "

    will take some time to do this. I guess for learning coding in C is
    http://learn.parallax.com/propeller-c-start-simple

    I guess this will take several days (or maybe weeks) until I'm ready to go on with PropWare 3.

    David If you see a way to take a short path towards PropWare tell me so.
    Maybe a graphic that shows how it all plays together helps to get the overview?
    To get an overview I need information about which part is doing what.

    As far as I understand it I write sourcecode. Then I have to start the compiler. The compiler creates the compiled code that is downloaded into the propellers EEPROM.
    So does PropWare do all the details about where is which file on the harddisk , switching on/off compiler-options etc in the MakeFile?

    pretty unsure if I understand it right. Through writing this you know what my questions are and where to correct misunderstanding.

    best regards
    Stefan
    [x] <== SLAM in nail here to hook up the new screen! :lol:
  • DavidZemonDavidZemon Posts: 2,220
    edited October 2014 Vote Up0Vote Down
    Let's take a shortcut for the source code. Here's a real simple application for you:
    #include <PropWare/PropWare.h>
    #include <stdio.h>
    
    int main () {
        int numberOfTimesPrinted = 0;
    
        while (1) {
            printf("Hello, world! %d\n", numberOfTimesPrinted);
            numberOfTimesPrinted++;
            waitcnt(500*MILLISECOND + CNT);
        }
    
        return 0;
    }
    

    Sorry if there are any typos. It should compile but I just wrote it right here in the forums and haven't tested it.

    I can create a graphic when I get home for you.
    1. Prepare CMakeLists.txt file (don't have to do this first, but it makes working with your IDE a lot easier if this is the first step)
      • Your entire project is described within this file. You tell it where your source files are, you tell it what compilation flags are used, you tell it what the output should look like. Everything that can possibly describe your project is within this file.
        Thankfully, most of this is done for you (most of the work that I did with PropWare was making this step as easy as possible).
    2. Write source code
      • That's a whole semester (or life) long class in itself. I won't dive into it in this post
    3. Generate Makefiles and compile/test
      • As noted in CMake and Make Tutorial, Make is cool little program that incrementally compiles our program for us. CMake is a cool little program that writes the Make source code for us (because Make more complex than we need)
      • compiling is as simple as typing "make" at the terminal. Based on your CMakeLists.txt file from step 1, your program will be compiled with a specific set of compilation flags, source code, etc.
      • Testing your program is almost identical to compiling. Just add "debug" to the end of your Make command (aka, type "make debug" at the terminal).
        • "make debug" writes to RAM and starts a serial terminal with the Propeller for debugging purposes. EEPROM is not overwritten
        • "make run" writes to EEPROM and does not start a serial terminal with the Propeller
    Let's see if I can draw this in text...
    Prepare                 Write           Generate                      Compile
    CMakeLists.txt  =====>  source  =====>  Makefiles from  ===========>  code via
    file                     code           CMakeLists.txt      |         "make"
                                                                |
                                                                |
                                                                |         Debug program
                                                                |======>  on Propeller via
                                                                |         "make debug"
                                                                |
                                                                |
                                                                |         Write to Propeller
                                                                |======>  EEPROM via
                                                                          "make run"
    

    Notice that the last step is any one of the three: compile, debug, or write to EEPROM. They are not dependent on each other. Make is smart enough that if you type "make debug" or "make run" and your program isn't compiled yet (or the files have changed), it will [re]compile your program before attempting to program the chip.
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
  • DavidZemonDavidZemon Posts: 2,220
    edited October 2014 Vote Up0Vote Down
    Btw, it is my goal to write a plugin for CLion to aid in this process. It will be some time before that happens though. For step 1, a GUI interface will help you create a new project and your CMakeLists.txt file will be written for you, along with a starter C or C++ file. Can't help you with step 2 of course. Step 3 is already taken care of by CLion - I don't need to write a plugin for that :). For step 4, I would provide new run configurations that work correctly with CLion so that the "Play" and "Debug" buttons built into the IDE work correctly for microcontrollers.
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
  • pmrobertpmrobert Posts: 403
    edited October 2014 Vote Up0Vote Down
    David, I now have a Debian machine to hopefully do my development on. I would like to compile PropGCC on this box. What repository/link should I use to obtain the latest PropGCC source? Google's returning a few different locations with differing timestamps, etc., but I would like very much to sync up with what you're using.
    Thx, Mike
  • DavidZemonDavidZemon Posts: 2,220
    edited October 2014 Vote Up0Vote Down
    pmrobert wrote: »
    David, I now have a Debian machine to hopefully do my development on. I would like to compile PropGCC on this box. What repository/link should I use to obtain the latest PropGCC source? Google's returning a few different locations with differing timestamps, etc., but I would like very much to sync up with what you're using.
    Thx, Mike


    Do you mean PropGCC or PropWare? The post written below was based on you asking about PropWare - I didn't notice until just now that you typed GCC



    Original reply:

    release-2.0 is the most stable version. Updates come anywhere from once every couple days to once every couple weeks. The release-2.0 branch will always be what is *planned* for v2.0. When v2.0 comes out of beta and a *final* release is made, it will be merged back into master.

    release-2.0-nightly is where all of my development work goes. Updates might come anywhere between 2-3 times a week and 20 times per day. Of course, I try to ensure everything works before making a commit, but don't curse me out if I commit a bug to that branch ;). If you want to be on the bleeding-edge of PropWare, this is the branch.

    For anyone else reading this post that wants to know which binary distribution, just take "current". Don't worry about which branch/commit it is.
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
  • pmrobertpmrobert Posts: 403
    edited October 2014 Vote Up0Vote Down
    OK, PropWare I have figured out - you're pretty good at documentation. I was inquiring as to which version and location of the actual PropGCC compiler you have been using - I would prefer to build my own, that way there's no question as to the binaries' compatibility, etc., on my specific system.
  • DavidZemonDavidZemon Posts: 2,220
    edited October 2014 Vote Up0Vote Down
    pmrobert wrote: »
    OK, PropWare I have figured out - you're pretty good at documentation. I was inquiring as to which version and location of the actual PropGCC compiler you have been using - I would prefer to build my own, that way there's no question as to the binaries' compatibility, etc., on my specific system.

    Okay. I'm using the "default" branch from here. I think the version bundled with PropWare is one commit behind now, not sure. Haven't paid too much attention since the changes are pretty negligible.
    David
    PropWare: C++ HAL (Hardware Abstraction Layer) for PropGCC; Robust build system using CMake; Integrated Simple Library, libpropeller, and libPropelleruino (Arduino port); Instructions for Eclipse and JetBrain's CLion; Example projects; Doxygen documentation
Sign In or Register to comment.