Announcement

Collapse
No announcement yet.

scriptC isn't writing files to RAW sdcard properly

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • scriptC isn't writing files to RAW sdcard properly

    Hi

    (Scripts samples at the bottom of this post)

    If I use Workshop3 to compile and upload to the picaso SGC, I can run script from RAW just fine.

    If I upload the compiled scripts with scriptC, any non-zero offset script fails to load and the picaso hangs.

    I have no clue if I'm using the utility incorrectly since it has no documentation. I can't find the writePCuSD() command in any of the 4DSystems documentation. I trust the information from a forum moderator that the number is the byte offset from the beginning of the RAW partition. The scriptC output suggests that each file is 512 bytes (aka 1 sector). I've spaced all my files out by that much.
    I don't know what else to do. It's not working.

    Please help!



    example scriptC upload script:
    //-----------
    #Run(Picaso,com4,256000,5,Wrap)
    $timeon
    $writePCuSD('s50m.4ds','H:',OverWrite,0x00000000)
    $writePCuSD('S25m.4ds','H:',OverWrite,0x00001000)
    //-----------

    //-----------
    // s50m.4dScript
    #Compile(Picaso,COM4,9600,5,Wrap)
    #Origin 0x00000000
    //do stuff then...
    StringG(0,0,0,0,0,0,"z")
    Exit
    //-----------

    //-----------
    // s25m.4dScript
    #Compile(Picaso,COM4,9600,5,Wrap)
    #Origin 0x00001000
    //do stuff then...
    StringG(0,0,0,0,0,0,"z")
    Exit
    //-----------

  • #2


    The destination of the $writePCuSD command is the sector where the output will be written

    The destination of the "Run Script (4DSL) Program from Card (RAW) - @50hex" command is a byte address.

    So for
    Sector 0x1000
    we get
    Byte 0x20000

    As each sector is 512 bytes long.

    Are you trying to execute there?

    Have you looked at using Workshop 4 - PICASO Serial Command Set Reference Manual as a way of doing this? Maybe you could even write one script in 4DGL and call it from serial with different parameters?
    Mark

    Comment


    • #3


      Thank you so much.

      I did not know the proper syntax for the writePCuSD command and I couldn't find it.

      I've changed my write2sd.4dscript to this and i am able to reference multiple scripts as I would expect:
      //---
      #Run(Picaso,com4,256000,5,Wrap)
      $timeon
      $writePCuSD('s50m.4ds','H:',OverWrite, 0)
      $writePCuSD('S25m.4ds','H:',OverWrite, 1)
      //--

      and in code
      PICASORunScriptRAW(0x00,0x00,0x00,0x00); // s50m.4ds at sector 0 / 0 byte offset
      PICASORunScriptRAW(0x00,0x00,0x02,0x00); // s25m.4ds at sector 1 / 512 byte offset

      This is all I needed. Passing params to a script which in turns calls other scripts might work. I'll look into it later now that I have a working solution.

      Thank you again.

      ps: maybe you can post a link to the documentation for the writePCuSD command?

      Comment

      Working...
      X