Shop OBEX P1 Docs P2 Docs Learn Events
Monte python and the P2 — Parallax Forums

Monte python and the P2

This Christmas turn out to be very interesting. First I got and Anki Vector robot to play with. I became interested because of what it could do but was not happy it was based on a phone processor.

Anyway the SDK to talk to the robot is all in Python. The only way to talk to the robot is through Python and you can only talk to the robot. You cannot download any code to the robot only interact with it through Python.

For the most part that worked very well and working with the robot at that level was very natural.

Then I got my P2 Eval board for Christmas and found that by hitting greater than and a space along with an ESC I could bring up a Forth prompt TAQOZ#. From there I could easily blink an LED. That was crazy.

Now if that was a Python prompt >>> Oh my god. I’m not a Python fan and actually don’t like Python yet but after working with the Vector robot and seeing where Python seems to be going it is the latest buzz language.

I’m a C language fan and have been for decades and that’s not going to change. I have used no less than 10 languages in my past but C is still the universal common ground and it works and it works well.

I took a look at the Micro python code and also the pyboard which is based on STM32. No surprise there as that is my second chip of choice. I know it’s very difficult to work with these chips but it works.

I found that Micro Python has been ported to the Pic, and teensy boards of all things and even the ESP line of chips. Well to port this to the P2 is not going to happen without a C compiler. All of these devices have a C compiler.

I took a look at the propGCC and found that to be just short of a nightmare. How was that ever developed? I love the Simple IDE tools and the compiler and loader are just amazing. Now that I see how it was made I am at awe. Face it, if I had to use SPIN to build my programs I would not probably be using the Prop chip today. A lot of the devices I interface too are based on C code or C libraries.

I built a Linux server in the cloud and download the code and got it to compile with some jockeying around. It was a virtual server so I could just delete it if it didn’t work. I still don’t see how that could be turned into a P2 compiler. I did see however there were some references to the P2 in it already.

The problem I see at hand here is that the P2 is now out and to build Python into it is a little too late. The window of opportunity has passed and even though it’s not a tool I would use nor would I use Forth for that matter but it is the latest shinny tool in the tool box and would go a long way to making the P2 better.

Even now I am at a little disadvantage with writing code for the P2 because of the lack of tools.

I am also a little concerned that the Forth is in ROM. Things like Python are constantly changing and having something burned in with no way to update it is bad karma. Even the firmware to boot my PC was just updated last week.

Mike

Comments

  • Mike,

    TAQOZ is meant to be a way to explore the chip and do basic hardware testing.

    I believe Peter is adding more to the version for the respin, but I'll leave it to him to discuss.

    Do some looking around, I know there are some folks looking to port MicroPython to the P2.

    Keep it mind these are also engineering samples and these will allow people to start building tools that should be ready by the respin and general release.

    C.W.
  • I heard production run is scheduled for early next year which makes a timeline impossible to get these tools ready for prime time. I don't even know if I will be using the P2 in future designs as the reason I like the P1 is it is simple to pick up and use.

    If I want to build something compilated I can use an STM chip which is more widely used.

    Mike

  • Yes, the P2 is more complicated than the P1. BUT, you don't have to use that complexity. You can pretty much program it as if it were a big P1 if you want. The Smart Pins are also just pins. Yes, there are some differences but there is still a subset of the P2 functionality that should be as easy to use as the P1. Don't give up on it yet!
  • I find the spattering of code throughout this side to be confusing and hard to follow.

    It would be nice to box up some of this code and use GitHub or something to put the code out there. Then if an update needs to be added or requires some tooling it can be nicely put together. I like just using git to download everything and then run the code.

    Having to find Pnut or fastspin or spin2gui or something to try some code out is not working for me.

    I have to go through at least 10 different blog post to get up to speed with what is going on here.

    Mike
  • David BetzDavid Betz Posts: 14,511
    edited 2018-12-26 15:41
    I agree. It would be nice if there was a central repository for all of the tools and sample code.
  • I think we have too many sous chefs and no head chef. I don't know if that is Eric, or Dave or maybe David or even Chip.

    Someone put the propgcc together and I'm all for building the server and downloading the code and compiling it but when it doesn't taste good I need to know what ingredient is missing to make it work.

    I looked over the GNU stuff and found that it supports many of the systems I worked on in the past. STM, SPARC, AS400, PowerPC, RS6000, PDP-11, and even IBM 390. No mention of P1 though.

    I don't know how to build a C compiler for the P2 but I can write C code.

    Mike
  • I think Jeff Martin from Parallax will likely coordinate all of this eventually. We're still in the very early stages right now.
  • ErNaErNa Posts: 1,742
    Leadership needs talent. And people to follow. So if there is a talent in the forum, we just don't know: here is the chance. If you ever had the chance to visit a restaurant: your meal was prepared by the many, not by the chef. And, aside of all the tasty meal on the card: it's always me who decides, what will be served and only me decide, it the meal served was perfect. The less sophisticated I am, the more easy I will be pleased. So, I'm currently absolute happy with what I have, and if I really see a need to do it better, I know, I have to do it on my own.
    Maybe I run for president in my rowing club! Merry christmas to all
  • I think what is already available is quite usable. The problem isn't the tools or examples. The problem, if there is one, is in finding them.
  • iseries wrote: »
    The problem I see at hand here is that the P2 is now out and to build Python into it is a little too late. The window of opportunity has passed and even though it’s not a tool I would use nor would I use Forth.

    Here I think it's our misunderstanding... The P2 is NOT out. The silicon is not final. Those devices which are in people's hands are for finding silicon bugs and developing toolchains.
    I am also a little concerned that the Forth is in ROM. Things like Python are constantly changing.

    Well, FORTH is not like python, it's more like C insomuch as it hasn't really changed that much in decades.

    Welcome to the party, we're glad to have you.

    Now you know it's not too late for you to contribute to its direction I hope you'll be encouraged to work with us. :)

    Additionally, as a teaser - there is the potential LATER for a product with custom ROMs for anyone who wishes to develop it that was mentioned a while ago.

    If you can get python to fit in that ROM it's not beyond the realm of possibility that someone may want to fund a run on ICs that have that in ROM.

    To be clear, I'm not saying parallax is doing this - I'm saying that at one point custom ROMs as a product was mentioned.

    Obviously, a long way off, but the potential is amazing, isn't it?
  • iseries wrote: »

    I am also a little concerned that the Forth is in ROM. Things like Python are constantly changing and having something burned in with no way to update it is bad karma. Even the firmware to boot my PC was just updated last week.

    Mike
    There is a big difference between Forth and other languages that makes it reasonable to have Forth in ROM. The basic premise of Forth is that the user can (will) extend it. Peter has already done this defining words to set the clock speed (in EXTEND). Since I kept forgetting to identify the P2ES before I tried to set the clock, I modified words to do that before setting the speed. To make that a "permanent" part of the language I would add it to EXTEND, save it to the flash memory (TAQOZ word BACKUP) and use ^R to restore to the dictionary after rebooting. That can also be done to fix words in ROM that might have errors.

    Tom
  • potatoheadpotatohead Posts: 10,254
    edited 2018-12-26 17:46
    The other thing about ROM is in P2, it is not memory mapped.

    When P2 starts, the ROM is dumped to RAM,a region can be write locked, and then the boot cycle begins.

    New, better, different code can be the first thing loaded.

    In TAQOS, one can paste a. bigger dictionary into a terminal and very considerably expand the system on the fly too.

    Nothing, but the boot options and process, is set in stone.

    I suspect the release ROM will be improved over this first sample.

    However it all goes, it was made completely possible to ignore the ROM with zero impact. Many users will not even realize it is there. We included one for testing and in the future debug / test work to be possible sans anything but serial comms.

    The other plan is a bootable image with a full on chip SPIN + PASM development system. Forth will get similar, because that exists now and is production proven.

    One will be able to use a P2 to develop for P2. Who know what else may happen along these lines? Will be fun times.

    All that said, a bog standard compile, upload, run C environment is planned.

    Right now, the big need is testing on the chip, toolchains, and common circuits as well as smart pin modes and features.

    Just writing PASM to do stuff will help.
  • David Betz wrote: »
    I think what is already available is quite usable. The problem isn't the tools or examples. The problem, if there is one, is in finding them.
    We know the problem, but no one seems to support solutions:

    Solving The Documentation Problem - Opinions Please
    Idea: "Propeller Plumbers" organization on Github.
    [github] rosco-pc/propeller-wiki/wiki

    Please: Discussion in one of the mentioned places.
  • jmgjmg Posts: 15,148
    iseries wrote: »
    The problem I see at hand here is that the P2 is now out and to build Python into it is a little too late. The window of opportunity has passed and even though it’s not a tool I would use nor would I use Forth for that matter but it is the latest shinny tool in the tool box and would go a long way to making the P2 better.

    That does not make sense.
    P2 is not quite out now yet, it is merely sampling in small numbers of ES versions, and still being tested/revised, so it is not 'too late' for anything on the software side. Python is on the road map.
    iseries wrote: »
    Even now I am at a little disadvantage with writing code for the P2 because of the lack of tools.
    It is very early days, did you look at fastspin, which has Spin/Basic/PASM and some C already ?
    iseries wrote: »
    I am also a little concerned that the Forth is in ROM. Things like Python are constantly changing and having something burned in with no way to update it is bad karma. Even the firmware to boot my PC was just updated last week.
    That also makes little sense, as the P2 is not a ROM only device. You can load any forth you like.
    The ROM is small, and there for bootloading, and other items were fitted into ROM. Looks very flexible to me.

  • yeti wrote: »
    David Betz wrote: »
    I think what is already available is quite usable. The problem isn't the tools or examples. The problem, if there is one, is in finding them.
    We know the problem, but no one seems to support solutions:

    Its sad that Parallax doesn't get off the stick and assign someone at HQ to work on this, maybe with an RFP-thread in the forum for interested folks to contribute?
    At this point its well past time for this to have been discussed considering where we're at with production.
    Its pretty weird to see a company which seems to depend upon hard core forumistas for development, and evangelizing, which they seem to be stepping up to do, and not doing some simple management and assistance with getting it consolidated in a useful form/format.
    This doesn't need a Sr. Engineer to assist with, isn't there anyone at HQ who might be interested and could be tasked with spending 2-3 hr's a week in making this happen?
  • Parallax has said they will have a "tools meeting" shortly after the P2-Eval boards ship. Since the boards have already shipped, I expect the meeting to be early in January. We're currently in the holiday period where people are likely not available for meetings.
  • David BetzDavid Betz Posts: 14,511
    edited 2018-12-27 00:50
    koehler wrote: »
    At this point its well past time for this to have been discussed considering where we're at with production.
    There are no production P2 chips yet and there likely won't be any for a while. There is time to get the tools story together.

  • I think we also have to realize that the P2 is based on the SPIN language and as far as I know that is done and running on the chip. To have C and Python are just nice to haves as it increases there customer base.

    As with the original P1 is was never built to run C. Someone had to come up with a way to make that work.

    Mike
  • David BetzDavid Betz Posts: 14,511
    edited 2018-12-27 01:47
    iseries wrote: »
    I think we also have to realize that the P2 is based on the SPIN language and as far as I know that is done and running on the chip. To have C and Python are just nice to haves as it increases there customer base.

    As with the original P1 is was never built to run C. Someone had to come up with a way to make that work.

    Mike
    I don't believe this is true. Parallax now uses C for their educational efforts and those are the primary focus of the company at least at present. I think C will be important to them on P2 like it now is on P1. Spin, of course, will also be important. Also, the P2 is not "based on the Spin language". General language support including both C and Spin and probably other languages as well was taken into account during the P2 design process.
  • Spin 2 is not done. We have a good guess at it in ersmiths multi language compilier.

    The P2 runs PASM, and unlike the P1, can do so outside the COG memory. In this sense, it is a multi-core chip ready to be driven by any language.

    Chip will do SPIN 2, and likelt a self hosted dev environment.

    Parallax will do C and other things to support education as they always do. I suspect some other things may be seen and targeted at various niches as we see this all flesh out.

    Others are likely to toss in with whatever they think may make sense.

    You, reader, can do what you want. Many of us plan on doing things we want. The more the merrier.

    As for management...

    Give it a bit of time. There is no rush. We are on engineering sample chips for good reason. Amazingly, they are almost fully functional, but could use improvements and bug fixes. That is where we are now.

    People can proceed to develop and test. Out of all that, Chip gets what he needs to make the respin worth it, and likely production ready. On Semi has Parallax on a program that works with all that is going on right now.

    Let the holidays pass. Then it can get a bit more formal. Until then, some of us know enough to help others out and the central repository will fall quite nicely out of that.




  • None of that is a surprise.
    However even here at the nerve center of discussion by the most knowledgeable prop-heads we still see everybody and their aunt asking about how to get this or that, who has a link to something somewhere, and on and on.

    A common GitHub or BitBucket would be a great place to start corraling as many efforts as possible, if Parallax doesn't want to host. Heck, even an updateable Stickie in this forum for each offering with links would be useful in the short term.

    IDK, maybe this'll be all sorted out at the tools meeting.
  • There is - theoretically - a GitHub at https://github.com/propeller now advertised as propeller 2 development repository. But not updated in any form since 29 days.

    just saying...

    Mike
Sign In or Register to comment.