Shop OBEX P1 Docs P2 Docs Learn Events
P2 FlexBASIC Error — Parallax Forums

P2 FlexBASIC Error

Hi all.. New to Propeller and this forum. I skipped P1 and now finally starting with P2 with P2 EDGE. Using Propeller Tool for the P2, had success with the Getting Started exercises at https://www.parallax.com/propeller-2/get-started/spin2/.

Next, followed similar get-started recipe https://www.parallax.com/propeller-2/get-started/flexbasic/FlexBASIC using FlexProp.exe, creating one line program:

print "hello, world"

Upon click of Compile & Run on P2 button, Propeller Output window shows following:

ERROR: got incorrect initial chksum: @@ (00 40 40)
Press enter to continue...

When I press enter, the window closes.

Other Info: P2 Dipswitch has 1 ON (LED Power), 2,3,4 OFF. Also tried with 1 and 3 ON - same error. Tried power cycling, PC reboot, reset button to no avail. Any ideas how to solve this?

Comments

  • Can you verify you are running the current FlexBASIC version? (Vers 5.2-ish)
    Are you using the Windows distribution?

  • Yes, FlexBASIC is 5.2.0 Windows distribution.

  • Is there any other open terminal window, by any chance? If something else is using the serial port you'll get download errors like that.

    Otherwise, you could try changing the BAUD rate setting under the "Ports" menu. If it's set really high then some systems might run into problems.

  • No other open terminal window. Tried changing BAUD rate setting from default 230.4K to 115.2K. Same issue. Also tried programming Flash instead of RAM with same issue (chksum error). Tried 3 other USB ports on my PC, same issue.

    Next, went back to Spin2, was able to load RAM and run programs. Yesterday, in Spin2, I experimented with loading Flash. Not sure how to clear Flash out, but that Flashed program perhaps is still resident there and causing contention on the port?

  • Cluso99Cluso99 Posts: 18,066

    This is how I test the flash on my RetroBlade2 boards using TAQOZ.
    The SFERASE erases the flash chip. I now use the S25FL256 and it doesn't completely erase using TAQOZ so I use 0 SFER4 as I only wrote to the lowest 4KB.

    '' For boards with FLASH...
    ''   Type "> " + <esc> which runs TAQOZ from ROM
    ''   Type the following TAQOZ commands terminating with <enter>
    ''      lsio                    and ensure pins P00-P61 are "~" ie tristate
    ''     .sf                      and observe flash info
    ''      0 $40 SF DUMP           flash dump s/be all FF's
    ''      @WORDS 0 $100 SFWRS     responds ok (writes to the flash)
    ''      0 $40 SF DUMP           and observe flash dump with txt '.DUPs..OVERw..SW' etc
    ''      SFERASE                 *** DOES NOT WORK WITH S25FL256 ***
    ''      0 SFER4                 *** USE WITH s25fl256 *** erases 4K block
    ''      0 $200 SF DUMP          and observe flash erased - all FF's
    
  • @synetcom : Yes, it's possible the program in flash is interfering somehow. Are you able to get into the ROM monitor or TAQOZ when using the FlexProp "Special" menu entries? If so you could use Cluso's method above to erase the flash.

    Another thing to check is whether you have an SD card inserted -- if you do, try removing it before running the program.

  • Thanks ersmith and Cluso99 for your help!

    The system I'm using is the Propeller 2 Developer Starter Bundle shown at https://www.parallax.com/product/propeller-2-developer-starter-bundle/
    There is no SD card or for that matter anything else plugged into the PP2 Edge Module Breadboard except for the P2 EDGE Module, the Prop Plug Rev E, and DC from the wall wart supply included in the kit.

    Flash Memory IC on the P2 EDGE Module is Windbond 25Q128JVSM with 128M-bit storage capacity.

    Using FlexProp Special menu entry, was able to get into TAQOZ. Using Cluso99's suggested commands (and variants thereof), was able to observe Flash contents erased to $ff everywhere. However, after all that, same error exists:

    ERROR: got incorrect initial chksum: @@ (00 40 40)
    Press enter to continue...

    Went ahead and ordered a second P2 Developer Starter Bundle today (needed it anyway) to help isolate. That is due-in on Friday, but open to any other suggestions before then.

  • ersmithersmith Posts: 5,900
    edited 2021-03-11 01:11

    @synetcom : it's more likely a software / system setup issue rather than a hardware problem, since your setup works with the Propeller Tool. One thing that's worth trying is to use the verbose output mode of loadp2. You can do that in FlexProp by going into Commands > Configure Commands... and editing the "Run command" line. Somewhere on the line it says something like:

    "%D/bin/loadp2" %P -b%r
    

    (there will be things before and after this, the stuff before is operating system dependent). Put "-v" between the loadp2 and the %P, so that part of the line reads:

    "%D/bin/loadp2" -v %P -b%r
    

    (leave everything else on the line the same, just insert -v). That'll give you a little more information about exactly what the loader is doing and at what point it's failing.

    Theoretically it should be possible to add a -SINGLE to the command line using the same procedure as above to use the built in (slow) ROM loader. That works for me to load things like LED blinkers, but it seems to leave the terminal in a bad state on Linux so that any serial output is not seen. I'm not sure if the same happens in Windows or not.

  • @ersmith: Inserted -v as you suggested - here's the result:

    trying \\.\COM3...
    P2 version G found on serial port \\.\COM3
    Setting load mode to CHIP
    Setting clock_mode to 12427f8
    Loading fast loader for chip...
    ERROR: got incorrect initial chksum:  @@ (00 40 40)
    Press enter to continue..._
    
    

    -SINGLE in place of -v results in:

    ( Entering terminal mode.  Press Ctrl-] to exit. )
    
    

    Not sure what to type in this mode (copy/paste the unedited RUN command and hit return?)

  • Cluso99Cluso99 Posts: 18,066

    Just a guess that you're expecting output on the terminal after loading but you're not seeing it.
    Try putting a waitms(2000) before you output anything as perhaps you're missing it because it's coming back too fast. When we launch PST we need a few seconds to manually get PST running. The terminal following the download is fast, but it's possible you're missing it. Otherwise post your whole program.

  • Ah, I think Cluso might be right, putting in a short delay (even 500 milliseconds) at the start of the program being run seems to fix the terminal problems in -SINGLE mode. I think the fast loader has that built in. I should add startup delays to the samples, I guess.

  • @synetcom : Here's an updated loadp2 that you could try to see if it works around the checksum version. To use it, rename the loadp2.exe in your flexprop\bin directory to something like loadp_old.exe (so you have a backup!) and then unzip this file into flexprop\bin. It has a sanity check on the checksum receive, so the fast loader (no -SINGLE) may work. It also tweaks the startup timing so it may work better in -SINGLE mode.

  • @Cluso99, ersmith: Success with new loadp2!

    Code I'm running is:

    print "hello, world"

    Compile / Run on P2 result is:

    trying \\.\COM3...
    P2 version G found on serial port \\.\COM3
    Setting load mode to CHIP
    Setting clock_mode to 12427f8
    Loading fast loader for chip...
    Sending header
    Loading C:/Users/PCi6/Desktop/flexprop/flexprop/hello.binary - 12628 bytes
    chksum: 3c OK
    ( Entering terminal mode.  Press Ctrl-] to exit. )
    hello, world
    
    

    This is with -v in the Run command. Will test -SINGLE mode later and post result. For now, we're good - thanks again for your help!

  • Thanks, @synetcom, glad the new loadp2 fixed your problem!

Sign In or Register to comment.