Shop OBEX P1 Docs P2 Docs Learn Events
Propeller II: Emulation of the P2 on FPGA boards (Prop123-A7/A9, DE0-NANO, DE2-115, etc) - Page 17 — Parallax Forums

Propeller II: Emulation of the P2 on FPGA boards (Prop123-A7/A9, DE0-NANO, DE2-115, etc)

1141517192024

Comments

  • David BetzDavid Betz Posts: 14,511
    edited 2013-01-06 18:35
    potatohead wrote: »
    I just downloaded everything. It was not clear that I needed to just overlay the special p2 build on top of the latest prop-gcc version.

    Is that true?
    You don't need anything other than what is in the prop2gcc zip file. I think you'll only get in trouble if you try to overlay it on top of another version of propgcc. What happened when you typed 'make run2'? Did you see the LEDs blink? I'm assuming you're running this on a DE2-115 board, right?
  • David BetzDavid Betz Posts: 14,511
    edited 2013-01-06 18:49
    David Betz wrote: »
    You don't need anything other than what is in the prop2gcc zip file. I think you'll only get in trouble if you try to overlay it on top of another version of propgcc. What happened when you typed 'make run2'? Did you see the LEDs blink? I'm assuming you're running this on a DE2-115 board, right?
    I looked at your make output a bit more and I think the problem is that you're using a copy of demos/common/common.mk from a non-p2 version of propgcc. I added code to common.mk to handle the new CHIP variable that tells gcc to compile for the p2. That code seems to be missing in your installation, probably because you overlayed one version of gcc onto another. That is why the program won't work. It wasn't compiled for the p2. Try using just the files from the prop2gcc zip file and nothing else and I think your problem will go away.
  • potatoheadpotatohead Posts: 10,253
    edited 2013-01-06 19:02
    Perhaps I was confused about the downloads... that makes a lot of sense!

    Can you link the one I'm supposed to use? I'll clear the directory and just try it again.
  • David BetzDavid Betz Posts: 14,511
    edited 2013-01-06 19:07
    potatohead wrote: »
    Perhaps I was confused about the downloads... that makes a lot of sense!

    Can you link the one I'm supposed to use? I'll clear the directory and just try it again.
    This is the one that supports the multi-cog demo on the DE2-115 board. The demos/fibo/p2 demo should work on either board. Remember to type 'make run2' instead of 'make run' since I haven't integrated P2 support into propeller-load yet. The 'run2' target runs the simpler p2load.

    http://code.google.com/p/propgcc/downloads/detail?name=prop2gcc-2013-01-02.zip&can=2&q=#makechanges
  • potatoheadpotatohead Posts: 10,253
    edited 2013-01-06 20:52
    I've got that one downloading. Clearly, I'm off in the weeds somewhere and just removed the gcc directory for a fresh start...
  • potatoheadpotatohead Posts: 10,253
    edited 2013-01-06 21:15
    Ok, that package is missing make and rm so far. I snagged those from the old directory. Rather than delete it, I just renamed it.

    Make all, make run2 = fail. I think I've got the wrong demos as there is no fibo/p2 directory. Off to look for that one. Think I'm almost there!
  • mindrobotsmindrobots Posts: 6,506
    edited 2013-01-06 21:39
    Doug,

    I'm up to late playing with this P2 stuff but I think I figured out the confusion.

    In David's p2test branch which he built from, he also made the changes to the demo sources for the make and added the fibo/p2 programs. If you clone the repository or download a .zip of the source you get that demo directory BUT the demos in propellergcc_v0_3_5_demos.zip that is on the wiki download page is ONLY the propgcc stuff (as it should be) and NOT any P2 stuff. You can either download the source .zip for about 500MB of download or we can upload the demos for P2 as a "work in progress" demos .zip for the wiki download page.

    I think I have that source on the laptop I'm on. If I do, I'll upload it as a quickie for you tonight and then we can work out the details with David later today (dang, It got too late too quick over here on the east coast!)

    By the way, the Win7 laptop I'm working on tonight has the normal propgcc installed in c:\propgcc and the P2 propgcc installed in c:]prop2gcc and seems to be working fine.
  • potatoheadpotatohead Posts: 10,253
    edited 2013-01-06 21:52
    Well, I'm close to done on this for the evening. No wonder I was having trouble. Again, that makes sense and was something I was beginning to suspect after not finding anything in any of the packages.

    Honestly, I was wanting to dip my toe in for a quick look and the ability to begin to port things. I'm not really where I want to go and setup a Linux for this machine, and it's still doing P1 stuff, which is all working nicely. That's kind of mid project too, something I hate to disturb.

    An upload would be great Rick. Pretty late there buddy. :) (I know how it is, but I can't go that distance tonight. Have many a time before though. Good fun. Get 'yer coffee in the morning, tea, whatever and go!)

    What does it take to build on Windows? Maybe I should just step back and do the work to clone and build... Maybe David can chime in with his build environment. Doing that would be a great exercise actually, and it won't be a burden going forward through the "let's just built it" phase.
  • mindrobotsmindrobots Posts: 6,506
    edited 2013-01-06 22:04
    The bad news, my .zip download of the source branch was corrupted. The good source tree is on my Mac so I won't be able to get to it until tomorrow morning (or actually this morning....actually, in too few hours from now! :frown:)

    I built it on my Mac last week and once David straightened out my repository problems, it built very easily (and worked!!). For windows, you go through similar steps but you need a gcc environment for Windows - mingw or cygwin (I appear to have both on my laptop...hmmmm). Then you just clone the repository and get the p2test branch (instructions a few posts back) and run the build. After a cup of coffee, you have a P2 propgcc to play with.

    It's a good exercise I was afraid of but glad I did!

    We'll straighten this out later today with David!

    Cheers!!
  • potatoheadpotatohead Posts: 10,253
    edited 2013-01-06 22:08
    Perfect. Well g-nite. Score the sleep you can. That's the right plan. Get a build going and work from there.

    I've got PASM for the last bit of my evening, and that's just perfect. No worries. Appreciate the quick look.
  • David BetzDavid Betz Posts: 14,511
    edited 2013-01-07 04:38
    potatohead wrote: »
    Perfect. Well g-nite. Score the sleep you can. That's the right plan. Get a build going and work from there.

    I've got PASM for the last bit of my evening, and that's just perfect. No worries. Appreciate the quick look.
    Did you ever get the multi-cog LED blinking demo working?
  • David BetzDavid Betz Posts: 14,511
    edited 2013-01-07 04:40
    mindrobots wrote: »
    Doug,

    I'm up to late playing with this P2 stuff but I think I figured out the confusion.

    In David's p2test branch which he built from, he also made the changes to the demo sources for the make and added the fibo/p2 programs. If you clone the repository or download a .zip of the source you get that demo directory BUT the demos in propellergcc_v0_3_5_demos.zip that is on the wiki download page is ONLY the propgcc stuff (as it should be) and NOT any P2 stuff. You can either download the source .zip for about 500MB of download or we can upload the demos for P2 as a "work in progress" demos .zip for the wiki download page.

    I think I have that source on the laptop I'm on. If I do, I'll upload it as a quickie for you tonight and then we can work out the details with David later today (dang, It got too late too quick over here on the east coast!)

    By the way, the Win7 laptop I'm working on tonight has the normal propgcc installed in c:\propgcc and the P2 propgcc installed in c:]prop2gcc and seems to be working fine.
    Ugh. I had forgotten that the release script doesn't include the demos directory. I'll fix that and upload a new zip file later today. Sorry!!
  • David BetzDavid Betz Posts: 14,511
    edited 2013-01-07 07:33
    David Betz wrote: »
    Ugh. I had forgotten that the release script doesn't include the demos directory. I'll fix that and upload a new zip file later today. Sorry!!
    I've uploaded the demos that work with the P2:

    http://code.google.com/p/propgcc/downloads/detail?name=prop2gcc-demos-2013-01-07.zip&can=2&q=#makechanges
  • mindrobotsmindrobots Posts: 6,506
    edited 2013-01-07 07:58
    Thanks! That should help! :smile:

    I didn't even think about it since I built Prop2GCC on my Mac and had the source there so just grabbed the demos. Last night I was on my Win7 laptop and all of a sudden it occurred to me that the P2 demo stuff wasn't around.
  • David BetzDavid Betz Posts: 14,511
    edited 2013-01-07 08:05
    mindrobots wrote: »
    Thanks! That should help! :smile:

    I didn't even think about it since I built Prop2GCC on my Mac and had the source there so just grabbed the demos. Last night I was on my Win7 laptop and all of a sudden it occurred to me that the P2 demo stuff wasn't around.
    I don't know why we don't include the demos in a normal PropGCC release. I'll have to talk with Steve about this. It seems silly to have to download a separate zip file.
  • jazzedjazzed Posts: 11,803
    edited 2013-01-08 14:57
    Where is the picture Chip posted that shows the device detected in the programmer for the DE2-115 FPGA board?

    Never mind, it's in the .zip file here.
  • Cluso99Cluso99 Posts: 18,066
    edited 2013-01-08 18:11
    Here are some pics of my DE0-nano setup. I am using my FT232 (my version of the PropPlug) to power the DE0 from my laptop over the USB connection. The FT232 is on the Smorgasboard.

    Cluso's DE0c.jpg
    Cluso's DE0b.jpg
    Cluso's DE0a.jpg
    389 x 519 - 86K
    519 x 389 - 76K
    519 x 389 - 64K
  • ctwardellctwardell Posts: 1,716
    edited 2013-01-08 18:14
    Cluso99 wrote: »
    Here are some pics of my DE0-nano setup. I am using my FT232 (my version of the PropPlug) to power the DE0 from my laptop over the USB connection. The FT232 is on the Smorgasboard.

    Cluso's DE0c.jpg
    Cluso's DE0b.jpg
    Cluso's DE0a.jpg

    Very Nice!
  • potatoheadpotatohead Posts: 10,253
    edited 2013-01-08 23:55
    Re: Did I get it working?

    Not yet. I won't have another shot for a day or so. I'll try the update David, then I'll move to plan B, which is to just setup to build. Good exercise for me anyway. Thanks for helping to sort it out. No worries here.
  • David BetzDavid Betz Posts: 14,511
    edited 2013-01-09 04:42
    potatohead wrote: »
    Re: Did I get it working?

    Not yet. I won't have another shot for a day or so. I'll try the update David, then I'll move to plan B, which is to just setup to build. Good exercise for me anyway. Thanks for helping to sort it out. No worries here.
    I built a new Windows zip file and uploaded it. This one is pretty much the same as the previous one except that it includes make.exe and the demos. I should be uploading another version soon that has SD card support on the DE2-115 board.
  • potatoheadpotatohead Posts: 10,253
    edited 2013-01-09 10:14
    How did you get SD card setup?

    Thanks! I'll report back on that package soon. Appreciated!
  • David BetzDavid Betz Posts: 14,511
    edited 2013-01-09 10:16
    potatohead wrote: »
    How did you get SD card setup?

    Thanks! I'll report back on that package soon. Appreciated!
    Chip made me a new DE2-115 configuration file with the SD pins mapped to P2 pins. I imagine he'll probably post it soon.
  • potatoheadpotatohead Posts: 10,253
    edited 2013-01-09 11:00
    Cool. I was kicking around just bread boarding one...
  • David BetzDavid Betz Posts: 14,511
    edited 2013-01-09 11:11
    potatohead wrote: »
    Cool. I was kicking around just bread boarding one...
    Would you be interested in trying to improve the performance of the SD driver? I'll attach the current one to this message.

    sd_driver2.s
  • David BetzDavid Betz Posts: 14,511
    edited 2013-01-09 13:13
    David Betz wrote: »
    Chip made me a new DE2-115 configuration file with the SD pins mapped to P2 pins. I imagine he'll probably post it soon.
    Here is the new DE2-115 configuration file that supports the SD card connection. Thanks Chip!!!

    The following pins are connected:

    Pushbuttons KEY2..KEY0 are mapped to Propeller pins P52..P50.
    The 18 slide switches are mapped to P49..P32.
    The 18 red LEDs are driven by P49..P32 outputs, though the inputs will always read the slide switch states.

    Pin Signal
    63 SD_DAT3
    62 SD_DAT2
    61 SD_DAT1
    60 SD_DAT0
    59 SD_CMD
    58 SD_CLK
    57 SD_WP_N

    de2-115-sd-support.zip
  • potatoheadpotatohead Posts: 10,253
    edited 2013-01-09 13:36
    That helps my answer. I have a little bit of time before I'm in New Orleans all next week. Will miss my P2 stuff, but will have fun too!

    Is there a C program you are testing with?
  • David BetzDavid Betz Posts: 14,511
    edited 2013-01-09 13:44
    potatohead wrote: »
    That helps my answer. I have a little bit of time before I'm in New Orleans all next week. Will miss my P2 stuff, but will have fun too!

    Is there a C program you are testing with?
    I've been using demos/filetest but I have to use a special Makefile to build it and I have to define the DE2_115 and CALL_MOUNT symbols at the top of filetest.c. This is because p2load doesn't support the variable patching that propeller-load uses to configure a program for a particular board. I'll add that later.

    To build:

    make -f Makefile.p2

    To load:

    p2load filetest.elf -t

    filetest.zip
  • Cluso99Cluso99 Posts: 18,066
    edited 2013-01-09 16:02
    David: I have just updated the first post to reference the new code posting. Way to go Chip :)

    Chip: If and only if you can spare the time... On the DE0 emulations, would it be possible to either
    1. wire the LED0-7 in parallel with the P0-7 pins within the FPGA (we could then see what is on P0-7 and therefore drive the leds via P0-7)
    2. (might be more difficult) Add P33-39 ports to output on LED0-7
  • David BetzDavid Betz Posts: 14,511
    edited 2013-01-09 17:58
    Cluso99 wrote: »
    David: I have just updated the first post to reference the new code posting. Way to go Chip :)
    Thanks Ray!
  • cgraceycgracey Posts: 14,133
    edited 2013-01-24 14:51
    Are SD_DAT3..SD_DAT1 needed, or is only SD_DAT0 required, due to licensed implementation issues?

    I ask because I'm getting the pin-out done for our DE2-115 add-on board and would like to consolidate things. Thanks.

    David Betz wrote: »
    Here is the new DE2-115 configuration file that supports the SD card connection. Thanks Chip!!!

    The following pins are connected:

    Pushbuttons KEY2..KEY0 are mapped to Propeller pins P52..P50.
    The 18 slide switches are mapped to P49..P32.
    The 18 red LEDs are driven by P49..P32 outputs, though the inputs will always read the slide switch states.

    Pin Signal
    63 SD_DAT3
    62 SD_DAT2
    61 SD_DAT1
    60 SD_DAT0
    59 SD_CMD
    58 SD_CLK
    57 SD_WP_N

    de2-115-sd-support.zip
Sign In or Register to comment.