Shop OBEX P1 Docs P2 Docs Learn Events
PropGCC on GitHub — Parallax Forums

PropGCC on GitHub

I thought I would give this new forum a try, just to see how it works for me. A general observation, this kind of looks like a categorized bulletin board, which may be a good thing. Also the vote thing could be a really effective way of breaking up some of the threads where you have two posters going at each other, OK so lets see...
To the main question, I just went to the PropGCC GitHub site, and cannot make heads or tails of the site. I was looking for the latest binary download zip for the latest PropGCC Windows 64bit version, and I did not find anything, am I looking in the wrong place? I thought that things would be so much more organized over at the GitHub site, but it looks like pure chaos, maybe for the person that is maintaining it, it is well organized.
The reason I am looking, I downloaded an Alpha 5 version of PropGCC, and inserted that into my existing SimpleIDE setup, now when I try to do a compile, I get errors like "segmentation fault", "test1.c:23:1: internal compiler error: in normalize_up, at sreal.h:194",..., etc.
David Betz mentioned that in one of the PropGCC builds, there is a provision for being able to do new COGs in XMMC mode; I am still trying to maximize the functionality of my DNA-RTC board. Can anybody help me?
Ray
 
«13

Comments

  • Heater.Heater. Posts: 21,230
    edited 2015-07-10 19:14
    In general github is not about downloading pre-built binaries of the projects that will work on whatever machine you may have.
    Rather it's a place for the developers to manage their development of the source code collaboratively. And for you to be able to checkout the source to build yourself. 
    Github is actually amazingly well organized. If the prop-gcc project it is hosting is well organized is another matter. 
    If the "official" downloads of prop-gcc, Simple IDE etc do not work for you it is time to say so.
    What kind of machine do you have? What OS? What OS version.  
  • Ray,

    The latest propgcc  builds can be found here. The linux tarball I grabbed today looks like it is alpha_v1_9_0.

    I'm not sure where the multi-cog XMMC code is as far as which release and how stable.

    I'm not that much of a c programmer anyway - it gives me a rash.

    I did try and build the release_1_0 and the master trunk from the Github source on my linux systems recently and both wentoff into the weeds with different errors but that could be me or my system as much as the code.


  • Yep, that is the same place I picked up GCC5 Win32 version. It does not like SimpleIDE or SimpleIDE does not like GCC5 Win32.
    Since I have Geany installed on my Windows 7 box, I am now using that to see how it works with GCC5 Win32, yes so far it is working. I am able to get an LED to blink on my DNA-RTC board. Talk about starting from scratch.
    I was able to get a high() and low() to work, but I am having trouble with creating a pause() to work. In PropGCC, for some reason, this does not work as expected: 'waitcnt((80000000*time)+CNT);'.
    Next I will have to decipher how to start a COG, and then set it up to run in XMMC mode, using the blinker program, that should tell me if COGs work in XMMC mode with the GCC5 Win32 edition.
    Ray
  • The latest binaries are a month and a half old unfortunately. An error occurred that seems to be unique to the build server. I'll see if I can find the time this weekend to debug it and get builds running again. The most recent successful build was 18 Apr 2015 06:38
  • I think I got cog_run() working as expected, but how do I get propeller-load to install XMMC mode? For the command line use of propeller-load, there is a -D setting, but I am not  sure if this is what is used to get my DNA-RTC board into XMMC mode. I guess I will have to search the PropGCC docs for an answer, if there is one available.
    Ray
  • yetiyeti Posts: 818
    edited 2015-07-11 03:31
    (((...))), but I am not  sure if this is what is used to get my DNA-RTC board into XMMC mode.



    Look for https://github.com/parallaxinc/propgcc/blob/master/loader/xmem-drivers/dna.cfg and read about propeller-load.I guess I will have to search the PropGCC docs for an answer, if there is one available.
    That's what docs are for... and you'll need some examples about the different memory models, https://github.com/parallaxinc/propgcc/tree/master/demos/fibo may be a good start for this topic.

    (The links I mentioned refer to the 1.9.x branch but for 1.0.x, they will not be much different after switching branches)
  • RsadeikaRsadeika Posts: 3,837
    edited 2015-08-06 21:15

    My preliminary conclusion is that COGs are not functioning in XMM or XMMC mode, my opinion of course. Below is the C program that I am using with Geany, and the Build commands:
    Compile - propeller-elf-gcc -Wall -c "%f"
    Build - propeller-elf-gcc -Wall -mxmmc -mfcache -o "%e" "%f"
    Execute - propeller-load -b DNA:SQI-SRAM -D var=cache-driver -p COM6 -r "./%e"
    The above listed build commands, I get everything working without errors and a good load, but, NO BLINKING LED. From that I derive that XMMC mode is started, but it is not running the COG in the XMMC space. So at this point I am not sure what else to try, only to assume that GCC5 Win32 is not setup to run COGs in the XMM/XMMC space.
    Ray
    /*
      test1.c
    */
    #include "propeller.h"
    #include <unistd.h>
    #include <cog.h>
    #include <math.h>
    #include <stdlib.h>
    
    void blink14();
    void high(int pin);
    void low(int pin);
    void pause(int time);
    int *cog_run(void (*function)(void *par), int stacksize);
    
    int main()
    {
      // Add startup code here.
        cog_run(blink14,128);
    //    cogstart(blink14, NULL, 256 + 4, 128 - 4);
     
      while(1)
      {
        // Add main loop code here.
    //    high(14);
    //    sleep(1);
    //    pause(500);
    //    low(14);
        sleep(1);
    //    pause(500);
      } 
    }
    
    void blink14()
    {
     while(1)
      {
        high(14);
        //pause(500);
        sleep(1);
        low(14);
        //pause(500);
        sleep(1);
      } 
    }
    void high(int pin)
    {
     int mask = 1 << pin;
     OUTA |= mask;
     DIRA |= mask;
    }
    void low(int pin)
    {
     int mask = 1 << pin;
     OUTA &= ~mask;
     DIRA |= mask;
    }
    void pause(int time)
    {
    // waitcnt((80000000*time)+_CNT);
    }
    int *cog_run(void (*function)(void *par), int stacksize)
    {
     int *addr;
      addr = malloc(stacksize += 4 + 176 + (stacksize * 4));
      *addr = 1 + cogstart(function, NULL, addr + 4, stacksize - 4);
      if(*addr == 0)
      {
        free(addr);
        return (int*) 0;
      }
      return addr;
    }
    


  • Just to make sure, I dug out my C3 board, and applied the same test. COGs DO NOT work in XMM/XMMC space on the C3 board, using GCC5 Win32. Although I did notice, on the C3 board, you could run a regular (COGless) program while using XMM/XMMC mode. On the DNA-RTC, you could not run anything while in the XMM/XMMC mode.
    So it seems that for the C3 board there is a better functioning external memory driver, which makes sense since the DNA-RTC board is not sold or serviced by Parallax.
    It is kind of a shame that one pays a pretty penny for these boards, and yet you cannot use them for full board functionality. For the past couple of years, every time the question of COGs in XMM/XMMC comes up, the answer is "Real soon now".
    So for my DNA-RTC board, I guess I could just pull the memory chip out, and use it for ...?
    As for the C3 board, I guess I can use the extra memory space as long as I write programs that do not use any COGs. Maybe there is a way to introduce interrupts (tasking) to replace the functionality of COGs.
    Ray
  • Multi-COG xmmc does work with the code on the default branch. What you have to realize though is that each COG that runs xmmc code needs its own cache and that requires a much larger stack to be passed to it. You will also probably want to reduce the size of the main cache as well. I've attached a sample program that will run on the QuickStart board using the xmmc memory model using the EEPROM as extended memory.
    There are instructions for compiling it at the start of the file. You can run it with the following command:
    propeller-load -b eeprom multi-cog-xmmc.elf -r


  • Thanks, David Betz. I used your example, after I modified it a little, and it seems to be working as expected for the C3 board. I hooked up two LEDs and both were blinking while in XMMC mode.
    For my DNA-RTC board, I could not get it to work. There were no compile errors, and it seemed to be loading the correct memory helper dat file, but no blinking LEDs, Not sure what is going on with that board. I guess it needs a special handling procedure.
    Ray
  • I have an early DNA board that I c

    Thanks, David Betz. I used your example, after I modified it a little, and it seems to be working as expected for the C3 board. I hooked up two LEDs and both were blinking while in XMMC mode.
    For my DNA-RTC board, I could not get it to work. There were no compile errors, and it seemed to be loading the correct memory helper dat file, but no blinking LEDs, Not sure what is going on with that board. I guess it needs a special handling procedure.
    Ray


    I have an early DNA board that I could try. Now I just have to find it! :-)
    By the way, how are you using the DNA board? Are you using the EEPROM external memory driver like my example or are you using its onboard SPI flash? If you're using the flash chips, what type do you have installed and what external memory driver are you using (the -b option in propeller-load)?
  • RsadeikaRsadeika Posts: 3,837
    edited 2015-08-06 21:11
    I am using Geany to work with the GCC5 Win32 setup. Here is what I am using:
    Compile - propeller-elf-gcc -Wall -c "%f"
    Build - propeller-elf-gcc -Wall -mxmmc -o "%e" "%f"
    Execute - propeller-load -b DNA:SQI-SRAM -D var=cache-driver -p COM6 -r "./%e"
    On the DNA board I tried all three versions, DNA:SPI-FLASH and DNA:SPI-SRAM, and none of them worked. I also have one of the early DNA-RTC boards. I n both tests I used the available memory and not the EEPROM.
    Hope this helps.
    Ray
    /*
      test1.c
    */
    #include "propeller.h"
    #include <unistd.h>
    //#include <cog.h>
    //#include <math.h>
    //#include <stdlib.h>
    //#ifdef __PROPELLER_USE_XMM__
    //#define MAX_COGS 7
    //#else
    //#define MAX_COGS 8
    //#endif
    static long stacks[8][16 + EXTRA_STACK_LONGS];
    void blink14();
    void blink13();
    void high(int pin);
    void low(int pin);
    void pause(int time);
    //int *cog_run(void (*function)(void *par), int stacksize);
    
    int main()
    {
      // Add startup code here.
        //cog_run(blink14,128);
        // Start blink14() COG -> XMMC
        cogstart(blink14, NULL, &stacks[1], sizeof(stacks[1]));
        // Start blink13() COG -> XMMC
        cogstart(blink13, NULL, &stacks[2], sizeof(stacks[2]));
     
      while(1)
      {
        // Add main loop code here.
    //    high(23);   // For C3 board test.
        //high(14); // For DNA-RTC board test.
    //    sleep(1);
    //    pause(500);
    // low(23);
        //low(14);
        //sleep(1);
        pause(500);
      } 
    }
    
    void blink14()
    {
     while(1)
      {
        //high(23);  // For C3 board test.
        high(14);  // For DNA-RTC board test.
        pause(1000);
        //sleep(1);
        //low(23);  // For C3 board test.
        low(14);  // For DNA-RTC board test.
        pause(1000);
        //sleep(1);
      } 
    }
    void blink13()
    {
      while(1)
      {
        //high(22);  // For C3 board test.
        high(13);  // For DNA-RTC board test.
        pause(500);
        //sleep(1);
        //low(22);  // For C3 board test.
        low(13);  // For DNA-RTC board test.
        pause(500);
        //sleep(1);
      }
    }
    void high(int pin)
    {
     int mask = 1 << pin;
     OUTA |= mask;
     DIRA |= mask;
    }
    void low(int pin)
    {
     int mask = 1 << pin;
     OUTA &= ~mask;
     DIRA |= mask;
    }
    void pause(int time)
    {
     // Not sure if this is correct, but it seems to work as expected.
     waitcnt(((CLKFREQ/1000)*time) + CNT);
    }
    
    
    
  • Well, one difference between what you're doing and what I'm doing is you're using GCC5 and I'm still using GCC4. Anyway, I found my DNA board and will try your sample code as soon as I wire up some LEDs to pins 13 and 14. 
  • David BetzDavid Betz Posts: 14,516
    edited 2015-07-12 02:45
    FYI, I hooked up LEDs to pins 13 and 14 and ran your program and it worked fine. I used the following commands to build and run:
    $ propeller-elf-gcc -mxmmc -Os -o test.elf test.c$ propeller-load -b dna:spi-flash test.elf -r 
    Maybe there is an issue with GCC5? I'll have to try building that but not tonight. Sorry!
  • This is concerning my early DNA-RTC board, it seems that the only setting that makes access to the XMMC is DNA:SQIHI setting, and this is not part of GCC5 Win32.
    I double checked this while using SimpIeIDE by trying to run a plain program in the different memory modes, the only one that worked was DNA:SQIHI, and using XMMC External Flash... So, I am not sure if it is just a quirk with my board or something has drastically changed with my hardware. Now I seem to recall a conversation about this with jazzed, back three or four years, and I remember he did confirm the issue, concerning DNA:SQIHI and XMMC External Flash...  , at that time. Not sure what can be done about this.
    Ray
  • I narrowed the problem down to a missing dna-nway.cfg file, which contains the [sqihi] stuff. When I moved the dna--nway.cfg to GCC5 appropriate area, and ran 'propeller-load -b dna-nway:sqihi -p COM6 -r test1.binary', it comes back with 'error: no external memory driver to load external image'. I also moved 'winbond_sqi_nway_flash_cache.dat' file, so I am not sure what the external memory driver it is reffering too. Man this is becoming a real big mess for a beginner like myself.
    Ray
  • Heater.Heater. Posts: 21,230
    Hardly surprising. You are using code at the cutting edge of development that has not been released yet and has been said by the developers to have issues and little testing done. As far as I understand th state of play at this time.
    It's very good that brave souls such as yourself do that though, it uncovers problems to need to be fixed earlier.
  • Just to get back to the OP question, if I had the gumption to compile the contents of GitHub for PropGCC, would I end up with GCC4 Win32 or GCC5 Win32 or both? It used to be that somewhere in the Parallax Inc world you could download the latest binaries for PropGCC, as sanctioned by Parallax, so where did it get moved to? When Parallax Semiconductor got sunk, did official support for PropGCC go also?
    The reason I ask is when PropellerIDE and SimpleIDE get stalled for many, many months, and the only alternative that used to be available, is to work with the latest and greatest PropGCC binaries, now what do you do? Or is the main goal of Parallax is to provide an area for PropGCC files, and if you want to go any further, have at it? Things are a changing around here.
    Ray


  • Heater.Heater. Posts: 21,230
    Good questions Ray. It's a mystery to me what is going on with prop-gcc and SimpleIDE now a days.
  • I narrowed the problem down to a missing dna-nway.cfg file, which contains the [sqihi] stuff. When I moved the dna--nway.cfg to GCC5 appropriate area, and ran 'propeller-load -b dna-nway:sqihi -p COM6 -r test1.binary', it comes back with 'error: no external memory driver to load external image'. I also moved 'winbond_sqi_nway_flash_cache.dat' file, so I am not sure what the external memory driver it is reffering too. Man this is becoming a real big mess for a beginner like myself.
    Ray


    I don't understand this. There is no dna-nway.cfg file in my copy of propgcc. Try using GGC4 the way I did and let me know if that work for you.
  • Good questions Ray. It's a mystery to me what is going on with prop-gcc and SimpleIDE now a days.

    We're not allowed to release any new versions of PropGCC until they are "qualified" whatever that means and there doesn't seem to be anyone with the time to do that. I don't know what's happening with SimpleIDE. I thought that version 1.0 was done.
  • Since this is Mon morning, and this thread has the potential of having an anchor attached, I will just say that I go along with whatever policies Parallax installs concerning the forum. This is there property and it is up to Parallax to provide a vehicle which suits the companies needs and is mostly beneficial for the forum visitors.
    As for the DNA-RTC board that I have been trying to make useful, it is going back into the box, that gets pushed to the back of the closet. Lessons learned, either design your own boards or just stick to whatever Parallax supports. Tired of  the chaos.
    The new darling on my desk is now the C3 board, which so far, has the potential to work as envisioned by me, for some experiments that I will be doing. It seems that with CMM5 Win32(is there a Win64 version?), it will allow the use of COGs in the XMM mode. There has always been talk about how "slow" it gets, using COGs in XMM mode, and whatever that means. I guess now I will be able to determine how the "slow" gets implicated in what I am doing, and I can determine what is best for my experiments.
    Sad to say I have noticed, as far as PropGCC is concerned, jazzed is gone, Dave Hine is showing up less and less, Eric Smith rarely stops by, David Betz is somewhat available, and Parallax is doing other "things". So, what does that tell you about the future of PropGCC.
    Ray
  • I'm not sure why you're having trouble with your DNA board. As I said earlier, I have an old DNA board as well and am able to get it to work with the version of PropGCC that is in the default branch on github. SwimDude0614 has prebuilt binaries with both GCC4 and GCC5. Unfortunately, I don't have the link handy. There really needs to be a page where we can post these links!
  • Heater.Heater. Posts: 21,230
    Ray,
    I have to take issue with the statement "This is [property] their property".
    Certainly it runs on Parallax owned servers and consumes electricity and bandwidth that they pay for. And no doubt legally they can claim ownership of the content of the database.
    That all means naught compared to the enormous amount of time and effort expended by the contributors to the forums over many years. All those questions and answers, advice, project descriptions etc etc etc.
    Anyone who has made a significant contribution to the forum has earned the right to complain and grumble when things are not going well. As many respected members here have done recently.
    I do hope your fears of this thread starting to sink, just because you are expressing the difficulties with prop-gcc, are ungrounded.
    Sadly I cannot offer any help having never tried to use prop-gcc on Windows or having any experience with your board. 

  • @David Betz, thank you for your contributions. I do not have the slightest idea as to why I am having problems with my DNA-RTC board. But, enough is enough, maybe someday down the road I just might pull it out of the cobwebs, and give it a try, again, or maybe not.
    @Heater., thank you for your contributions, but I take exception to your exception. I state my opinions here, and only my opinions, I do not speak for anybody else or even presume to know why other people make contributions. If it is for some kind of implied sweat equity in the Parallax forum, then maybe those people should be up front as to why they are really here. At least then I can decline to have that person make the contribution, for me.
    As I said earlier, this forum belongs to Parallax, and in my opinion, I am not looking for any kind of implied sweat equity in this property. When I cannot find the answers that I am looking for here, then I will go somewhere else. I consider my self to be a visitor here, and I act according to the Parallax established rules.
    On to other things, for the time being the C3 board, not sure how this will end...
    Ray


  • What release of PropGCC are you using? I showed you code that works if you compile it with GCC4. Is there any reason you can't do that? I am pretty sure that SwimDude0614 has an already built version of GCC4 for Windows on his TeamCIty side. Would that be sufficient?
  • Dave HeinDave Hein Posts: 6,347
    edited 2015-07-13 18:11
    Sad to say I have noticed, as far as PropGCC is concerned, jazzed is gone, Dave Hine is showing up less and less, Eric Smith rarely stops by, David Betz is somewhat available, and Parallax is doing other "things". So, what does that tell you about the future of PropGCC.

    I don't think Parallax is pushing for any changes to PropGCC or SimpleIDE, so the only activity on them would be bug fixes.  I think a lot of us are in holding mode waiting for the P2.  Once the P2 FPGA image is available there will be a flurry of activity on tools that are associated with it.
    I'm not sure if Parallax realizes how important the P2 is to their future.  If they had realized the importance they would have been much more focused on getting the P2 out ASAP.  Instead, they seem to have squandered some of their resources on P1V, the 1-2-3 FPGA board and other activities that have taken up some portion of Chip's time.  It also seems that Chip is doing most of the work himself rather than offloading some of his work to others.
  • As far as I can tell, Parallax doesn't even have time to help "qualify" changes to PropGCC. We have had a new version ready to go for well over a year. This is the one that supports multiple XMMC COGs with a new external memory driver architecture that is aligned to the one Chip created for P2-hot. It also has many other changes and bug fixes in it. However, it is not currently distributed with SimpleIDE so effectively no one is using it. In addition, Eric has been working on porting GCC5 to the P1. This is mostly working but needs some additional testing. As Rsadeika seems to have discovered, there are problems with the external memory driver support in that branch. I can help with that but I need to find time to build the GCC5 toolchain and test his program to see if it fails the same way for me as it does for him. I'll try to get to that soon but I'm also working on a port of Jeff Martin's WiFi loader for the ActivityBoard Wx.
  • As David Betz has pointed out, I have a this thread. I do apologize to Mac users - I do not know how to cross-compile for Mac and I don't have access to Mac, so I can not provide builds for that.
    Also, here's the links from that post, just to save you some time ;)
    GCC4Win32
    GCC5Win32
  • Hi David,
    Thanks for posting the links. I guess we need to ask Parallax to create a page that we can update that contains these links so people don't have to wade through the forums to find them.
    David
Sign In or Register to comment.