Shop OBEX P1 Docs P2 Docs Learn Events
p2load: A Loader for the Propeller II - Page 6 — Parallax Forums

p2load: A Loader for the Propeller II

13468911

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2013-03-29 14:04
    Baggers wrote: »
    Ok, cool, I'll have a look, later though, taking the girls out, while the sun is out, it's cold, but not snowing at least haha :D
    OT: Thought you were in the middle of a blizzard. My daughter & her fiance are winging their way to London as we speak (2nd engagement party) :)
  • BaggersBaggers Posts: 3,019
    edited 2013-03-29 15:32
    Cluso99, London is about 250+ miles away :D we've had snow but today was sunny ( albeit very cold haha )
  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-29 19:30
    Baggers wrote: »
    Hi David,

    Here's an example file...
    load the testcard.bin to $8000
    then load the program, I've attached the source, and object and bin file.

    Let me know how you get on.

    Cheers,
    Jim.

    Attachment not found.

    Okay, I think I loaded this successfully. I get an image on my TV but it looks a bit garbled. What should it look like?
    david-betzs-macbook-pro:test dbetz$ p2load testcard.bin,8000 BaggersNPotatoheads_16_bit_graphics_driver_NTSC.BIN
    Found propeller version 32 on /dev/cu.usbserial-A700fKXl
    Loading 'testcard.bin' at 0x00008000
    ................................................................................................
    Loading 'BaggersNPotatoheads_16_bit_graphics_driver_NTSC.BIN' at 0x00000e80
    ..
    
  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-29 19:56
    Okay, here is what I did. I didn't end up adding the -x or -r options because it isn't really possible to split the load up into multiple invocations of p2load. This is because the first thing that p2load does is goes out looking for a serial port with a Propeller attached and doing that messes up any loader that might already be running on the Propeller. So, I ended up just allowing multiple files to be loaded on the same command line. You can mention as many files as you like on the command line. Each file can optionally be followed by a comma and a hex address where the file should be loaded. If you precede a file with -s the first 0xe80 bytes will be stripped off of it before it is loaded. That allows something like what Sapieha asked for originally:
    p2load -s prog.obj data1.bin,2000 data2.bin,3000 -t
    

    I've also added a -c option that will let you do a COGNEW to start a COG passing it a parameter. I'm expecting this will probably be a mailbox address. The following example will do a COGNEW of the COG image at 0x2000 passing it the parameter 0xf00.
    p2load prog.obj -c 2000:f00
    
    I'm doing a build now to make sure I didn't break anything and then I'll check this in and build a Windows version.
  • potatoheadpotatohead Posts: 10,261
    edited 2013-03-29 22:00
    David, thanks for working on this. Makes things a lot faster. Appreciated.

    IMHO, this is a very good loader now. We can use many different approaches to get data and code into a P2.
  • Cluso99Cluso99 Posts: 18,069
    edited 2013-03-29 23:47
    Thanks David. Look forward to trying it out soon.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-30 04:06
    I'm still wondering why the test image that Bagger's supplied is garbled on my screen. Is it possible that this is a big-endian image rather than little-endian as you'd expect on the Propeller?
  • BaggersBaggers Posts: 3,019
    edited 2013-03-30 05:13
    Hi David, just saw this, will grab loader and have a look when I get back.

    btw, it should be the same as mine, as the data is little endian.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-30 05:16
    Baggers wrote: »
    Hi David, just saw this, will grab loader and have a look when I get back.

    btw, it should be the same as mine, as the data is little endian.
    I'm not sure what's happening then. I can recognize the image but it is garbled. All I do is write byte-for--byte directly into hub memory. I don't do any swapping.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-30 05:17
    I just updated the top post in this thread with a Windows version of p2load that can load multiple files at a time. It also has the untested feature allowing you to launch COG images. This is described in the top post.
  • BaggersBaggers Posts: 3,019
    edited 2013-03-30 05:18
    Just had a quick look, yeah that data for the bitmap was wrong :D should work with the new version :)
  • BaggersBaggers Posts: 3,019
    edited 2013-03-30 05:19
    Just checked with new data, yeah works a treat, thanks, and soooooo much faster :D
    Nice one matey!
  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-30 05:20
    Baggers wrote: »
    Just checked with new data, yeah works a treat, thanks, and soooooo much faster :D
    Nice one matey!
    Thanks! I can probably make p2load even faster by getting rid of the ACK after every packet. The link should be reliable so that probably isn't really necessary.

    Could you send me the revised image file so the picture on my TV will look better? :-)
  • Bill HenningBill Henning Posts: 6,445
    edited 2013-03-30 06:18
    Nice work David!

    This will come in very handy for a lot of us.
    David Betz wrote: »
    Okay, here is what I did. I didn't end up adding the -x or -r options because it isn't really possible to split the load up into multiple invocations of p2load. This is because the first thing that p2load does is goes out looking for a serial port with a Propeller attached and doing that messes up any loader that might already be running on the Propeller. So, I ended up just allowing multiple files to be loaded on the same command line. You can mention as many files as you like on the command line. Each file can optionally be followed by a comma and a hex address where the file should be loaded. If you preceed a file with -s the first 0xe80 bytes will be stripped off of it before it is loaded. That allows something like what Sapieha asked for originally:
    p2load -s prog.obj data1.bin,2000 data2.bin,3000 -t
    

    I've also added a -c option that will let you do a COGNEW to start a COG passing it a parameter. I'm expecting this will probably be a mailbox address. The following example will do a COGNEW of the COG image at 0x2000 passing it the parameter 0xf00.
    p2load prog.obj -c 2000:f00
    
    I'm doing a build now to make sure I didn't break anything and then I'll check this in and build a Windows version.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-30 06:50
    Sorry for the flurry of updates. I forgot that someone asked for an option to start the ROM monitor instead of the user program. I've added the -m option to do that. You still need to use -t to get into terminal mode so you can interact with the monitor.

    To load a program and enter the monitor type something like this:
    p2load prog.BIN -m -t
    

    I also fixed a bug that was preventing the use of the -b option to change the baud rate. So you can now try this to load Bagger's image display code even faster:
    p2load -b 230400 testcard.bin,8000 BaggersNPotatoheads_16_bit_graphics_driver_NTSC.bin
    

    I've updated the top post with the new Windows version.
  • ColeyColey Posts: 1,110
    edited 2013-03-30 07:57
    It worked for me, thanks a lot David :thumb:
  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-30 08:06
    Coley wrote: »
    It worked for me, thanks a lot David :thumb:
    I'm glad it worked for you! Let me know if there is anything else it needs to be useful.
  • SapiehaSapieha Posts: 2,964
    edited 2013-03-30 08:34
    Hi David.

    Nice work.


    If You will consider that request so.
    Now only Initial COMxx port setting that can handle Ports bigger as 9


    David Betz wrote: »
    I'm glad it worked for you! Let me know if there is anything else it needs to be useful.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-30 08:36
    Sapieha wrote: »
    Hi David.

    Nice work.


    If You will consider that request so.
    Now only Initial COMxx port setting that can handle Ports bigger as 9
    It should already be able to handle any COM port.
  • SapiehaSapieha Posts: 2,964
    edited 2013-03-30 08:46
    Hi David.

    Sorry. Don't see flag for COM's before I posted my post.

    Thanks
    David Betz wrote: »
    It should already be able to handle any COM port.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-30 08:48
    Sapieha wrote: »
    Hi David.

    Sorry. Don't see flag for COM's before I posted my post.

    Thanks
    No problem. It should also auto-detect your COM port. Is that not working for you?
  • SapiehaSapieha Posts: 2,964
    edited 2013-03-30 08:57
    Hi David.

    Auto works for me. BUT I have some things that dont like auto scans - Had big problems with that in PropellerTools before them added manually control for COM's.


    But I have Question / Request for one more -flag as last one in command line ============== -r address,parameter
    If that are possible for You?

    David Betz wrote: »
    No problem. It should also auto-detect your COM port. Is that not working for you?
  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-30 09:30
    Sapieha wrote: »
    Hi David.

    Auto works for me. BUT I have some things that dont like auto scans - Had big problems with that in PropellerTools before them added manually control for COM's.


    But I have Question / Request for one more -flag as last one in command line ============== -r address,parameter
    If that are possible for You?

    Okay, I'll add that. I'll make it the same as the syntax for -c though:

    -r address:parameter

    I hope that's okay.

    By the way, I said in my original post that I hadn't tested the -c option but it turns out it uses the same internal mechanism as -m that starts the ROM monitor so I'm pretty sure it will work for starting other COG images as well.
  • SapiehaSapieha Posts: 2,964
    edited 2013-03-30 09:40
    Hi David.

    Thanks.
    I think that with that last one -- We have very good testing tool for Prop II.

    And that looks very good --- -r address:parameter


    David Betz wrote: »
    Okay, I'll add that. I'll make it the same as the syntax for -c though:

    -r address:parameter

    I hope that's okay.

    By the way, I said in my original post that I hadn't tested the -c option but it turns out it uses the same internal mechanism as -m that starts the ROM monitor so I'm pretty sure it will work for starting other COG images as well.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-30 10:31
    Sapieha wrote: »
    Hi David.

    Thanks.
    I think that with that last one -- We have very good testing tool for Prop II.

    And that looks very good --- -r address:parameter
    I've updated the top post with a new version of p2load that supports the -r option. Sorry it took so long! I had started a Windows build of all of propgcc and that takes FOREVER!
  • BaggersBaggers Posts: 3,019
    edited 2013-03-30 10:38
    Hi David, much kudos mate, I just typed

    p2load -b 1000000 testcard.bin,8000 BaggersNPotatoheads_16_bit_graphics_driver_NTSC.bin

    It worked super fast! So, nice one! I doubt I'll need to add serial support to P2Prep, this is awesome, thanks matey!

    Cheers,
    Jim.
  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-30 10:42
    Baggers wrote: »
    Hi David, much kudos mate, I just typed

    p2load -b 1000000 testcard.bin,8000 BaggersNPotatoheads_16_bit_graphics_driver_NTSC.bin

    It worked super fast! So, nice one! I doubt I'll need to add serial support to P2Prep, this is awesome, thanks matey!

    Cheers,
    Jim.
    Glad to be of assistance. Can I ask you for a favor though? How about a binary of that image you send before that will display correctly on my TV? :-)
  • SapiehaSapieha Posts: 2,964
    edited 2013-03-30 10:43
    Hi David.

    I think I don't understand something.

    F:\-Morph-Temp\_NANO_\Emulator\P2Terminal_cordic\p2load._M>p2load -v driver_NTSC.obj -r e80:0
    Trying COM1
    error: hardware lost
    Trying COM9
    Found propeller version 32 on COM9
    Loading 'driver_NTSC.obj' at 0x00000e80
    .
    Loading 'e80' at 0x00000e80
    error: can't open 'e80'

    David Betz wrote: »
    I've updated the top post with a new version of p2load that supports the -r option. Sorry it took so long! I had started a Windows build of all of propgcc and that takes FOREVER!
  • David BetzDavid Betz Posts: 14,516
    edited 2013-03-30 10:45
    Sapieha wrote: »
    Hi David.

    I think I don't understand something.

    F:\-Morph-Temp\_NANO_\Emulator\P2Terminal_cordic\p2load._M>p2load -v driver_NTSC.obj -r e80:0
    Trying COM1
    error: hardware lost
    Trying COM9
    Found propeller version 32 on COM9
    Loading 'driver_NTSC.obj' at 0x00000e80
    .
    Loading 'e80' at 0x00000e80
    error: can't open 'e80'
    Oops! Sorry about that. Will be fixed in a second.
  • SapiehaSapieha Posts: 2,964
    edited 2013-03-30 10:47
    Hi David

    Thanks

    David Betz wrote: »
    Oops! Sorry about that. Will be fixed in a second.
Sign In or Register to comment.