Shop OBEX P1 Docs P2 Docs Learn Events
Cluso's Propeller OS V1.14 - now with SPIN/PASM Compiler, EEPROM Read/Write :) - Page 3 — Parallax Forums

Cluso's Propeller OS V1.14 - now with SPIN/PASM Compiler, EEPROM Read/Write :)

135

Comments

  • Cluso99Cluso99 Posts: 18,066
    edited 2013-09-03 03:33
    Update V0.77

    OS_....zip is the OS source
    PropOS....zip is the compiled OS
    VB6....zip is the VB6 install program for file transfers to/from the PC
    VB6....zip is the VB6 source

    The OS commands GETCPM & PUTCPM now have destination filename that default to source filename.
    GETCPM has the added options for –T (text) and –B (binary) but the code to strip back to Ctl-Z for text files is not working yet.

    Two new commands GETFAT & PUTFAT are implemented. They are enabled by the VBminiTerm2 program. To use this...
    Unzip the VB6...zip files and then run the setup.exe. This will install my VB6miniTerm2.exe program.
    Run the VB6miniTerm2 program for file transfers as follows:
    Set your PropPlug comm port no (My default is 8. There may be problems with ports >8)
    Then click on “Enable” and you will see the open comm port message.
    To check you are talking to the RamBlade, click DTR and click again. You should see the OS startup messages. This is a poor terminal program.

    Now you are ready to try a file transfer:

    Click on the GET button to copy to the PC and insert a filename you wish to transfer & its PC location (_HELP.TXT is a text file on the SD card).
    The transfer should work and gives a message when complete.

    Click on the PUT button to copy from the PC, so select the file you wish to transfer (must be 8+3 filename). The file must NOT exist on the SD card.
    The transfer should work and gives a message when complete.

    To close the VB6 program, first click on Disable, then Exit.
    OS_20130903d.zip
    PropOS_077_5MHz.zip
    PropOS_077_6-5MHz.zip
    VB6miniTerm2setup.zip
    VB6miniTerm2_20130903b.zip
  • I have successfully installed the version from the post above onto a Propeller Activity Board.

    At first, I was unclear on how it is installed. I was unclear about which of the multiple files provided in the post above were required for a successful installation. Perhaps I could contribute by thoroughly documenting my process.

    I began by taking notes. The notes eventually turned into a list of steps. Care was taken to make very little assumptions about the reader's skill level.

    The resulting document waits for another proofread while in Google Docs before it is imported to and formatted for this message board.

    These tasks will occur after some rest.
  • Cluso99Cluso99 Posts: 18,066
    Thanks pidzero.

    Up to now, I mostly used PropOS to run on my RamBlade and that comes pre compiled. I just email the files with install instructions.

    However with my new board it does not have the SRAM and so it does not run CPM.

    I have also been working on Kyes pass section for potential use in P2. Part of that process has allowed me to shrink his past section. I need to put this into the full PropOS. I will get to this in the next day or so, plus I have a new hub dump command working that needs to be added into the help text file.

    My ultimate dream is to add Michael Park's Sphinx compiler into PropOS. I would also like to get USB LS or FS emulation working properly too. Lastly I'd like to get CPM bios to use FAT - not sure if it's doable but if it can be done there is a lot of CPM code that could work too. Oh, forgot I need to make the FAT PASM cog hub resident. This makes it easier for people to write programs that can be used like an extension to PropOS.

    Just need a few more hours in the day ;)

    Note: I would love to incorporate Peters fantastic Tachyon (forth) but I just cannot get my head around RPN :(
  • pidzeropidzero Posts: 23
    edited 2015-12-15 00:13
    [edit][/edit]
    Development of the following document was first mentioned on these posts:
    http://forums.parallax.com/discussion/comment/1358284/#Comment_1358284
    http://forums.parallax.com/discussion/comment/1358304/#Comment_1358304


    A Thorough, Step-by-Step Guide For Installing Cluso99’s “Prop OS” on a Propeller Activity Board.
    This text is based on the source zip archive available on this post: http://forums.parallax.com/discussion/comment/1204709/#Comment_1204709

    The information accumulated within exceeds the information provided on a single post by drawing on information from a number of other posts on the same discussion thread and other discussion threads from the Parallax Discussion Forum.

    This text is intended for a less-experienced Propeller developer that has never installed a program requiring more than simply pressing F11 in Propeller Tool.

    Because all of Prop OS’s commands (programs) are compiled and stored on the SD, EEPROM space is conserved. There are a number of benefits to storing programs on SD. One example would be running your own programs without the need for reprogramming EEPROM each time.

    First, some basic assumptions:
    * You have at least a basic understanding of SPIN. (For this example, you will need to know how to change a few constants.)
    * You know what a .zip file is and how to extract its contents.
    * You know what the Windows Command Prompt is, or, at very, very least, can follow a few simple instructions.
    Hardware Requirements:
    * Propeller Activity Board,
    * USB cable,
    * microSD card, (I’m testing with the 2GB card available on Parallax’s site. Later I may test with SDHC cards.)
    * A way to put files on microSD. (My PC has no SD reader, so I email the files to an Android with a microSD slot to meet this requirement.)

    Software Requirements:
    * Windows. (I’m testing with Win10Pro, but it should work the same on any version, back to XP.)
    * Propeller Tool -- It is important that this is installed before connecting USB. If it’s not installed yet, install it before you begin. https://www.parallax.com/downloads/propeller-tool-software
    If you are ready to begin, follow the steps below.

    Objective: Installing Prop OS on the Propeller Activity Board.
    For the scope of this text, a successful installation will mean producing the Prop OS command shell to USB serial.

    Part 1. Workspace preparation.
    The Prop OS source is contained within a single .zip file. The archive contains a number of files. Other included files will generate more output files. It is suitable to start with a new folder to contain all the associated files.

    Step 1. Create “TopFolder”.
    Create a new folder on the desktop. You can call it whatever you want, but here we’ll call it “TopFolder”. If you chose another location, you’ll need to know its path later when we use the Windows Command Prompt.

    Step 2. Collect the source .zip archive into “TopFolder”
    Although there are a number of files provided on the post, our installation will draw upon only the OS source .zip archive, which includes a compiler:
    “OS_20130903d.zip” (or technically “100094.zip”, as it is stored on the server) -- http://forums.parallax.com/uploads/attachments/53023/100094.zip

    Download it, and save it to the folder we created in step 1, “TopFolder”.

    Step 3. Extraction.
    Open “TopFolder”. We see the following file:
    100094.zip

    Extract the zip into a new folder of the same name. Now, “TopFolder” contains the following:
    100094.zip (the .zip we downloaded)
    100094 (a folder with the contents of the aforementioned .zip archive)

    Part 2. Configuring and Preparing Prop OS for the Propeller Activity Board.
    It is necessary to change certain settings to accommodate the Activity Board’s resources.

    The following steps refer to files in “TopFolder/10094”, so navigate there now.

    Step 1. Modify “_hwdef.spin”.
    “_hwdef.spin” is the file that contains certain constants which give Prop OS information about connected hardware. A number of changes are required for use with the Activity Board.

    Here are the required changes, in order of appearance:
    _XINFREQ_ = 5_000_000 (instead of 6_500_000)
    
    _SDpin_CS  = 25 (instead of 3)
    _SDpin_DI  = 24 (instead of 2)
    _SDpin_CLK = 23 (instead of 1)
    _SDpin_DO  = 22 (instead of 0)
    
    _KBDpin_CLK = -1 (instead of 27)
    _KBDpin_DAT = -1 (instead of 26)
    _MOUSE_CLK  = -1 (instead of 25)
    _MOUSE_DAT  = -1 (instead of 24)
    
    _AUDIO_1 = 26 (instead of -1)
    _AUDIO_2 = 27 (instead of -1)
    
    _TVbasepin = -1  (instead of 12)
    _TVpinmask = $00 (instead of $07)  
    
    _VGAbasepin = -1  (instead of 16)
    _VGApinmask = $00 (instead of $FF)
    
    Save the file and close it. Make a copy of your revised ”_hwdef.spin” file to “TopFolder”. This will aid in preparing Prop OS source of another version. Rather than make the same edits again, we simply drop-in the editted “_hwdef.spin” from “TopFolder”.

    Step 2. Compile Prop OS.
    The PropOS source .zip archive contains a SPIN compiler called “homespun.exe”. We’ll need this to compile SPIN source that will be stored on SD.

    It is ideal to use Windows Command Prompt for the next few steps. Let’s open it, now.

    Press WinKey+R, type CMD, press Enter.

    In the Command Prompt window, navigate to “TopFolder/100094”. If “TopFolder” is on the desktop as in this example, you would type:
    CD %USERPROFILE%\Desktop\TopFolder\100094
    
    and press Enter.

    Some of the following steps will vary depending on whether you are performing a “fresh-installation”, or you are only updating core files.

    “Fresh-Installation”: If you need to generate all the necessary OS commands (files) to be stored on SD, a command script called “OS.BAT” has been provided to facilitate the process. To execute it, type:
    OS
    
    and press Enter.

    “Update-Only”: For this, we only need to compile one file, “_OS.spin”. The .BAT script provided to facilitate this is called “HW.BAT”. To use it, type:
    HW
    
    and press Enter.

    In either event, you see the output of the necessary files being generated. Don’t close the Command Prompt window yet; we still need it.

    Step 3. Isolate the files to put on microSD.
    Now, we collect the necessary files for the microSD into a new folder. We can do this easily from the Command Prompt.

    “Fresh-Installation”:
    First, create a folder called “toSD”. Type:
    MD toSD
    
    and press Enter.

    Move the compiled binaries into “toSD”. Type:
    MOVE *.CMD toSD
    
    and press Enter.

    Copy text files (like “_HELP.TXT”) into “toSD”. Type:
    COPY *.TXT toSD
    
    and press Enter.

    Exit the Command Prompt by typing:
    EXIT
    
    and pressing Enter.

    “Update-Only”: The OS still needs the other files, but because they are already compiled and stored on SD it is only necessary to replace “_OS.CMD” on the SD. We don’t need to round up all the necessary files with the commands above, only “_OS.CMD” needs to be copied to SD.

    Step 4. Put the files in “TopFolder/100094/toSD” on microSD (root folder).
    I lack an SD/microSD card reader in my PC, so I simply bring the files to another device that offers this support.

    Put the files from “toSD” (or only _OS.CMD if you are updating) in the root folder of your microSD card. The following tree illustrates the required Prop OS files co-existing with various user files and folders:
    \
    \_cmd.cmd
    \_copy.cmd
    \_del.cmd
    \_diff.cmd
    \_dir.cmd
    \_dircpm.cmd
    \_free.cmd
    \_getcpm.cmd
    \_getfat.cmd
    \_help.cmd
    \_ls.cmd
    \_mapcpm.cmd
    \_os.cmd
    \_program.cmd
    \_putcpm.cmd
    \_putfat.cmd
    \_reboot.cmd
    \_ren.cmd
    \_testsd.cmd
    \_type.cmd
    \_used.cmd
    \_ver.cmd
    \anyOtherUserFiles1.ext
    \anyOtherUserFiles2.ext
    \anyFolder1\
    \anyFolder1\anyFile
    \anyFolder2\
    

    Note: I have not actually tested with co-existing files having long filenames. Here, I’m illustrating Prop OS and user file coexistence. Formatting microSD is not necessary. Prop OS, however, cannot access long filenames or any folder below root. This limitation is brought on by the object that provides access to the file system.

    Part 3. Programming the OS into EEPROM of the Propeller Activity Board.
    By now, we have a fully prepared SD card which will be required for the OS to operate. All that’s left is to program the EEPROM, which will load the OS on boot.

    Step 1. Connect USB to Propeller Activity Board.
    Plug the USB cable into the Activity Board.

    Step 2. Open “TopFolder/100094/_OS.spin” with Propeller Tool and set it as the Top Object File.
    You may open “_OS.spin” into the Propeller Tool by simply double-clicking the file “_OS.spin” located in “TopFolder/100094/”.

    To set “_OS.spin” as the Top Object File, right-click on the file’s tab (at the top of the edit window) and click, “Top Object File”. This can also by selecting “_OS.spin” from the dialog under “File > Select Top Object File”, or by pressing Ctrl-T.

    Step 3. Program the EEPROM.
    With “_OS.spin” visible in the Propeller Tool editor, press Ctrl-F11 to program the EEPROM.

    Part 4. Testing for a successful installation.
    If we have successfully prepared Prop OS, it should already be booted and running on the Activity Board. To test, we connect to the Prop OS command shell over USB serial.

    Step 1. Open Parallax Serial Terminal.
    Parallax Serial Terminal is a standalone program, but it can be accessed from within Propeller Tool by pressing F12. (You may find it helpful to create a convenient shortcut on the Desktop or Task Bar. You can copy the shortcut from within “Start Menu > Programs > Parallax Inc” to do this.)

    Step 2. Configure the terminal.
    Select the appropriate COM port. If you don’t know what it is, you may need to test each COM port listed until you find it.

    Select 115200 as the baud rate.

    Step 3. Connect and verifying communication.
    Click “Enable” to connect. If instead you see “Disable”, you are already connected.

    Because the OS booted before you connected, it is already waiting patiently at a command shell prompt. To solicit a response, press Enter in the transmit window (near the top in Parallax Serial Terminal). Doing this produces a result in the receive window:
    Command not found, try help
    SD:>
    

    Now, send the VER command. Type:
    VER
    
    and press Enter.

    The result should be:
    *** Propeller SD card Operating System v0.7x ***
    ------------------------------------------------
     Derived from KyeDOS...
       by Kwabena W. Agyeman & J. Moxham & Cluso99
        & acknowledgements to M. Park (Sphinx) etc
    
     Hardware: Cluso's ???
     ClockFreq 080000000Hz, ClockMode $F, Cog 0
     SD card on pins 22,23,24,25
     Serial  on pins 30,31, Mode 00, Baud 00115200, Cog 1
     Screen size: 080 x 040
     <LF> is OFF
     Resident Cogs : 1 2   This Cog: 0
     Cogs available: 3 4 5 6 7 (=5)
    
    SD:>
    

    If you received these messages in the Parallax Serial Terminal, congratulations! You have successfully installed Prop OS.

    Objective Completed.
  • @Cluso99
    Sometimes, when I can code no more and must retire for the day, YouTube videos of various Propeller-based projects lull me to sleep.

    But turn off Auto-play, or wake up to the weird part of YouTube.
  • Cluso99Cluso99 Posts: 18,066
    pidzero wrote: »
    @Cluso99
    Sometimes, when I can code no more and must retire for the day, YouTube videos of various Propeller-based projects lull me to sleep.

    But turn off Auto-play, or wake up to the weird part of YouTube.
    Many thanks for doing this.

    There are some points that I can make...
    It is only necessary to modify _hwref and then compile _os.spin because this contains everything that varies in the hardware.
    When compiling _os.spin with PropTool, it is necessary to set _os.spin as the top object. Compiling and downloading to the eeprom is done with Ctl-F11 (not F11).

    Since you do not have an SD reader on your PC, you can use a USB to microSD reader to write to the microSD on the PC. They are $1 on eBay but don't last that long due to the cheap connector not being gold flash. Other multi card readers to USB also work fine. Then just use windows explorer to copy files.



  • Cluso99 wrote: »
    It is only necessary to modify _hwref and then compile _os.spin because this contains everything that varies in the hardware.
    I understand that _OS.spin compiles to include _hwref.spin. I don't know what you mean when you say, "It is only necessary to modify _hwref and then compile _os.spin...". Have I included unnecessary steps?
    Cluso99 wrote: »
    When compiling _os.spin with PropTool, it is necessary to set _os.spin as the top object. Compiling and downloading to the eeprom is done with Ctl-F11 (not F11).
    My results appeared successful to me, but I'll need to study the differences between F11 and Ctrl-F11, as well as the purpose of setting _os.spin as Top Object in PropTool compared to simply having it visible in the editor when compiling/programming.
    Cluso99 wrote: »
    Since you do not have an SD reader on your PC, you can use a USB to microSD reader to write to the microSD on the PC. They are $1 on eBay but don't last that long due to the cheap connector not being gold flash. Other multi card readers to USB also work fine. Then just use windows explorer to copy files.
    Great idea--making development easier!

    I'm happy to correct the technical errors and to improve the quality of the documentation.
  • Cluso99Cluso99 Posts: 18,066
    pidzero wrote: »
    Cluso99 wrote: »
    It is only necessary to modify _hwref and then compile _os.spin because this contains everything that varies in the hardware.
    I understand that _OS.spin compiles to include _hwref.spin. I don't know what you mean when you say, "It is only necessary to modify _hwref and then compile _os.spin...". Have I included unnecessary steps?
    The way the PropOS works is that it uses the top part of hub to contain the resident parts and driver interface. Therefore, the hardware info is contained here and the drivers for console input and console output remain resident. So, _OS.spin contains the only part that changes in PropOS meaning the other xxxx.cmd files do not need to be recompiled for a hardware change.

    I have yet to make the fat PASM driver resident in hub.

    You may have noticed that PropOS also can detect a few different hardware such as my RamBlades and TriBlade. I need to look at the schematic of you dev board and I will be able to detect it also.
    Cluso99 wrote: »
    When compiling _os.spin with PropTool, it is necessary to set _os.spin as the top object. Compiling and downloading to the eeprom is done with Ctl-F11 (not F11).
    My results appeared successful to me, but I'll need to study the differences between F11 and Ctrl-F11, as well as the purpose of setting _os.spin as Top Object in PropTool compared to simply having it visible in the editor when compiling/programming.

    F11 only compiles the file in the current window. Whereas Ctl-F11 compiles the whole file and sub files. BUT it is necessary to set the top file in PropTool !!!
    Otherwise PropTool will compile the last used Top File which may not be the one you are viewing. It's a trap for newcomers!
    Cluso99 wrote: »
    Since you do not have an SD reader on your PC, you can use a USB to microSD reader to write to the microSD on the PC. They are $1 on eBay but don't last that long due to the cheap connector not being gold flash. Other multi card readers to USB also work fine. Then just use windows explorer to copy files.
    Great idea--making development easier!

    I'm happy to correct the technical errors and to improve the quality of the documentation.

    Many thanks for your work :)

    Sometime today I hope to release my new hardware board ;)
  • Cluso99Cluso99 Posts: 18,066
    BTW PropOS uses drivers to talk to the console input and output, so it's possible to replace these with a keyboard and video driver easily. Again, only _os.spin requires recompiling. My 1pin TV and keyboard drivers can be substituted easily.
  • Cluso99Cluso99 Posts: 18,066
    pidzero,
    After downloading the compiled _os.spin to eeprom with PropTool and Ctl-F11, you can switch to PropTool's terminal screen using F12.
  • Cluso99Cluso99 Posts: 18,066
    PropOS v0.80

    Version V0.80 supports a new command

    HUBDUMP <addr> <lines>

    where <addr> is an address in hex (without the "$") and <lines> is the number of 16 byte (4 longs) lines to be displayed.
    Display shows both hex and ASCII output, typical of most dumps.

    Below are v0.80 files compiled for the P8XBlade2
    See a few posts above for instructions to compile for other hardware by pidzero (many thanks).
    The file labelled source contains the compiler, source files, batch file os.bat to compile all files, and the compiled files and others.
    The file without the source name contains all files to be copied to the root in the FAT16/32 SD card. Note for different hardware you will need to change _hwdef.spin and recompile _os.spin.
  • Cluso99 wrote: »
    The way the PropOS works is that it uses the top part of hub to contain the resident parts and driver interface. Therefore, the hardware info is contained here and the drivers for console input and console output remain resident. So, _OS.spin contains the only part that changes in PropOS meaning the other xxxx.cmd files do not need to be recompiled for a hardware change.
    I understand that _OS.spin requires a re-compile on hardware changes or when installing a different version of PropOS (_OS.spin). Meanwhile, any unchanged compiled files/commands/programs simply remain in-place on SD, and it is unnecessary to recompile and replace the entire OS. However, any time _OS.spin requires recompile, it is necessary to both program EEPROM and copy _OS.cmd to SD.

    The document would benefit by providing this information.

    Part 2 now reflects this.
    Cluso99 wrote: »
    F11 only compiles the file in the current window. Whereas Ctl-F11 compiles the whole file and sub files. BUT it is necessary to set the top file in PropTool !!!
    Otherwise PropTool will compile the last used Top File which may not be the one you are viewing. It's a trap for newcomers!
    Part 4 now reflects this.

    I think I understand how "Set as Top, Ctrl-F11" is preferable, but I need more help understanding why it is necessary.

    First, lets assume _OS.spin has been set as Top. Open _OS.spin in Propeller Tool.

    It is my understanding that pressing F11 will:
    * Compile _OS.spin and the included objects (and their included objects, etc)
    * Program EEPROM.

    And pressing Ctrl-F11 will:
    * Compile Top (_OS.spin, in this case) and the included objects (and their included objects, etc)
    * Program EEPROM.

    Aside from logical designation, I do not understand how compiling is affected.
    Cluso99 wrote: »
    After downloading the compiled _os.spin to eeprom with PropTool and Ctl-F11, you can switch to PropTool's terminal screen using F12.
    This is good to know, and I've added it.
    Cluso99 wrote: »
    Many thanks for your work :)

    Sometime today I hope to release my new hardware board ;)
    That sounds exciting! I'd like to learn more about your boards.
  • Cluso99Cluso99 Posts: 18,066
    pidzero wrote: »
    Cluso99 wrote: »
    F11 only compiles the file in the current window. Whereas Ctl-F11 compiles the whole file and sub files. BUT it is necessary to set the top file in PropTool !!!
    Otherwise PropTool will compile the last used Top File which may not be the one you are viewing. It's a trap for newcomers!
    Part 4 now reflects this.

    I think I understand how "Set as Top, Ctrl-F11" is preferable, but I need more help understanding why it is necessary.

    First, lets assume _OS.spin has been set as Top. Open _OS.spin in Propeller Tool.

    It is my understanding that pressing F11 will:
    * Compile _OS.spin and the included objects (and their included objects, etc)
    * Program EEPROM.

    And pressing Ctrl-F11 will:
    * Compile Top (_OS.spin, in this case) and the included objects (and their included objects, etc)
    * Program EEPROM.

    Aside from logical designation, I do not understand how compiling is affected.
    If you change tabs in PropTool and look at say FullDuplexSerial and do Ctl-F11, PropTool will not compile FullDuplexSerial but insteadwhatever top file you selected last (including last time you ran PropTool).
    When you do an F11, PropTool only compiles the current file from the current active tab. I am unsure whether it in fact compiles the any child files. used for debugging or compiling an object rather than a complete program.

    Links to my boards are in my signature below (except the new P8XBlade2 which has just been released today - see the forum)



  • Cluso99,
    I'm not at all familiar with CPM, so I'm not sure if it's by design, but entering a command that has a length of 0 after being tokenized generates "Command not found, try help". As far as I know, there are only two cases where it is possible to have a zero-length tokenized commandline.

    <CR> or <any number of spaces><CR>

    Either way, would it be suitable to treat this situation with exception?

    In executeCommand of _CMD.spin, I add an if to handle this exception:
        str.tokenizeString(@commandline)
        if str.Len(@commandline)                            ' if trimmed command line has length<>0
          \runFilename(string("_"), @commandline, string(".CMD")) ' load/run file if found
          \runFilename(string(" "), @commandline, string(".BIN")) ' load/run file if found
          shellCommands(@commandline)                         ' try inbuilt commands
          PrintStringCR(string("Command not found, try help"))
    

    I recognize the error does not break function, however I think this could be especially helpful if command script processing were added later (introducing _ECHO, _REM, _PAUSE, etc.)

    No need for a 100% emulation of MS-DOS, but _ECHO, _REM, and _PAUSE seem ubiquitous enough to include (when command script processing is added).
  • Cluso99Cluso99 Posts: 18,066
    I deliberately wanted to inform the user to look at help if they type something wrong. Just my opinion to help new users.
  • Cluso99Cluso99 Posts: 18,066
    Here is the latest version PropOS v0.87

    _OS_v087_20160106.zip

    TYPE <filename> [-Hnn]
    Type (display) the file to the stdout device
    [-Hnn] if not used, displays the file as text (characters & $7F)
    [-Hnn] if used, displays the file in HEX and ASCII, nn bytes/line (default=16 if nn omitted)

    CLEAR
    Writes the clearscreen character to the stdout device
    (previously an internal command)

    ECHO <text>
    Echo (writes) the <text> to the next line of the stdout device

    Other minor fixes and tweeks.

    Attached code includes both source and compiled (for 12MHz PLL8)

    To change SD pins and/or Xtal:
    (1) edit _hwdef.spin
    (2) recompile _OS.spin (top object) with PropTool
    (3) program into eeprom
  • pidzero wrote: »
    No need for a 100% emulation of MS-DOS....

    Thank God! ;)


    dgately
  • Actually, I've been playing with PropOS v0.84 on the new P8XBlade2 and it's working well! I built a small LED blinker program binary with Propeller IDE, copied it to the SD, attached 3 LEDs & a switch to the P8XBlade2 and now can happily run my program, watch the LEDs light and on button press, reboot to the OS.

    I'll try v0.87, soon...

    Thanks Cluso!

    dgately
  • Cluso99Cluso99 Posts: 18,066
    dgately,
    Thanks and pleased its working nicely for you.

    You can examine hub ram and rom with HUBDUMP <addr> <lines>
    Try this
    HUBDUMP F800 80
    You will see the Parallax copyright message and web address.

    I am going to expand this command (or add a new one) to be able to modify hub ram too, like I did with my P2 debugger before P2Hot.
  • Cluso99Cluso99 Posts: 18,066
    edited 2016-01-21 07:11
    -deleted-
  • Cluso99Cluso99 Posts: 18,066
    edited 2016-01-21 07:09
    Here is how I updated my eeprom to the latest version without downloading from PropTool...
    (Note if you are using one of my boards, you will require the WE (write enable) link to enable eeprom writing)

    1. Copy files from the PC to the SD card: *.cmd, _os.bin, _eeprom_lo.eep, _help.txt
    2. Insert the SD card into your prop card and power up
    3. From the command prompt SD:> program the lower 64KB of the eeprom using the command
    SD:>PROGRAM EEPROM_L.EEP -WL
    4. From the command prompt reboot the prop using
    SD:>REBOOT
    5. You will now see the new version booting.
    SD:>dir *.eep
    EEPROM_L.EEP
    SD:>program eeprom_l.eep -wl
    i) Program eeprom_l.eep to EEPROM Lower 32KB
     Locating eeprom_l.eep
    0000: 00 5A 62 02 6E 94 10 00 BC 31 2C 39 5C 00 68 39 .Zb.n....1,9\.h9
    0010: CC 07 08 09 4C 00 38 00 B0 03 40 00 48 07 00 00 ....L.8...@.H...
    0020: 8D 07 00 00 95 07 00 00 A2 07 00 00 BE 07 00 00 ................
    0030: E4 1F 00 00 E4 1F 00 00 CC 07 00 00 CC 07 E8 02 ................
    0040: 20 26 D0 05 C8 2A 08 07 94 2D 1C 07 BC 2D 20 07  &...*...-...- .
    0050: 74 2E 24 07 89 00 00 00 00 00 7C 5C 39 1F 1E 69 t.$.......|\9..i
    0060: 3A 01 C2 00 6D 3B 03 02 01 00 65 3B 04 C4 B4 00 :...m;....e;....
    0070: CD 38 38 6F CD 34 3F 92 75 74 3B 30 00 FF 00 E8 .88o.4?.ut;0....
    0080: 3B 30 00 FF 00 FC 0A 14 3B 4E 08 1C 09 65 3B 06 ;0......;N...e;.
    0090: 32 EA 00 CD 38 38 6F CD 34 04 80 8C 74 3B 37 38 2...88o.4...t;78
    00A0: 00 00 E8 3B 37 38 00 00 FC 0A 18 39 17 16 69 3B ...;78.....9..i;
    00B0: 33 19 1A 18 65 3B 06 32 EA 00 CD 38 38 6F CD 34 3...e;.2...88o.4
    00C0: 04 80 65 74 3B 38 80 00 00 E8 3B 38 80 00 00 FC ..et;8....;8....
    00D0: 0A 14 3B 77 16 15 14 65 3B 06 32 EA 00 CD 38 38 ..;w...e;.2...88
    00E0: 6F CD 34 04 80 42 74 3B 30 00 80 00 E8 3B 30 00 o.4..Bt;0....;0.
    00F0: 80 00 FC 0A 13 3B 8F 0E 0D 0C 65 3B 05 B8 D8 00 .....;....e;....
     Programming first 16KB block...00000100
     Programmed first 16KB block
    0000: 00 5A 62 02 6E 94 10 00 BC 31 2C 39 5C 00 68 39 .Zb.n....1,9\.h9
    0010: CC 07 08 09 4C 00 38 00 B0 03 40 00 48 07 00 00 ....L.8...@.H...
    0020: 8D 07 00 00 95 07 00 00 A2 07 00 00 BE 07 00 00 ................
    0030: E4 1F 00 00 E4 1F 00 00 CC 07 00 00 CC 07 E8 02 ................
    0040: 20 26 D0 05 C8 2A 08 07 94 2D 1C 07 BC 2D 20 07  &...*...-...- .
    0050: 74 2E 24 07 89 00 00 00 00 00 7C 5C 39 1F 1E 69 t.$.......|\9..i
    0060: 3A 01 C2 00 6D 3B 03 02 01 00 65 3B 04 C4 B4 00 :...m;....e;....
    0070: CD 38 38 6F CD 34 3F 92 75 74 3B 30 00 FF 00 E8 .88o.4?.ut;0....
    0080: 3B 30 00 FF 00 FC 0A 14 3B 4E 08 1C 09 65 3B 06 ;0......;N...e;.
    0090: 32 EA 00 CD 38 38 6F CD 34 04 80 8C 74 3B 37 38 2...88o.4...t;78
    00A0: 00 00 E8 3B 37 38 00 00 FC 0A 18 39 17 16 69 3B ...;78.....9..i;
    00B0: 33 19 1A 18 65 3B 06 32 EA 00 CD 38 38 6F CD 34 3...e;.2...88o.4
    00C0: 04 80 65 74 3B 38 80 00 00 E8 3B 38 80 00 00 FC ..et;8....;8....
    00D0: 0A 14 3B 77 16 15 14 65 3B 06 32 EA 00 CD 38 38 ..;w...e;.2...88
    00E0: 6F CD 34 04 80 42 74 3B 30 00 80 00 E8 3B 30 00 o.4..Bt;0....;0.
    00F0: 80 00 FC 0A 13 3B 8F 0E 0D 0C 65 3B 05 B8 D8 00 .....;....e;....
     Locating eeprom_l.eep
     Verifying first 16KB block...
     Verified first 16KB block
    4000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    4010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    4020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    4030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    4040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    4050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    4060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    4070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    4090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    40A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    40B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    40C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    40D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    40E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    40F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
     Programming second 16KB block...00000100
     Programmed second 16KB block
     Locating eeprom_l.eep
     Verifying second 16KB block...
    4000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    4010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    4020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    4030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    4040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    4050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    4060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    4070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    4090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    40A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    40B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    40C0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    40D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    40E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    40F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
     Verified second 16KB block
     Eeprom programmed successfully
    i) EEPROM written.
    SD:>reboot
    i) Rebooting propeller from eeprom...
    
    
    *** Cluso's Propeller Operating System v0.90 ***
    ------------------------------------------------
     (see 'VER' for acknowledgements)
     Locks used: --------
     SD Driver Cog = 2
     Hardware: Cluso's P8XBlade2
     ClockFreq 096000000Hz, ClockMode $6E, Cog 0
     SD card on pins 12,13,14,15
     Serial  on pins 30,31, Mode 00, Baud 00115200, Cog 1
     Screen size: 080 x 040
     <LF> is OFF
     Resident Cogs : 1 2   This Cog: 0
     Cogs available: 3 4 5 6 7 (=5)
     Booting from SD card...
    SD:>
    
  • Cluso99Cluso99 Posts: 18,066
    Attached is v0.90

    The code now defaults to 5.00MHz PLL16X with SD on pins P0..P3.

    If you are using the RamBlade/RamBlade3/TriBlade#2/P8XBlade2/CpuBlade7 then PropOS will automatically detect these and use the default crystal and I/Os for these boards.

    There is a new command DNLOAD. This program, when called runs a modified "booter" that will work with PropTool downloading without using the reset (DTR) line. F7, Ctl-F10 and Ctl-F11 works fine.
    SD:>DNLOAD

    Note that since RESET is not used, it may be necessary to remove power to reboot. Ctl-F10 will download to hub ram and run the program, and Ctl-F11 will download to hub ram and then program to eeprom and ultimately run the program.
  • Cluso99 wrote: »
    Attached is v0.90

    The code now defaults to 5.00MHz PLL16X with SD on pins P0..P3.

    If you are using the RamBlade/RamBlade3/TriBlade#2/P8XBlade2/CpuBlade7 then PropOS will automatically detect these and use the default crystal and I/Os for these boards.

    There is a new command DNLOAD. This program, when called runs a modified "booter" that will work with PropTool downloading without using the reset (DTR) line. F7, Ctl-F10 and Ctl-F11 works fine.
    SD:>DNLOAD

    Note that since RESET is not used, it may be necessary to remove power to reboot. Ctl-F10 will download to hub ram and run the program, and Ctl-F11 will download to hub ram and then program to eeprom and ultimately run the program.
    Thanks! Seems to work nicely. Should I be able to use the DNLOAD command with propeller-load?
  • Cluso99Cluso99 Posts: 18,066
    I am hoping all downloaders will work. Please try it and let me know.
  • Cluso99 wrote: »
    I am hoping all downloaders will work. Please try it and let me know.
    I did try and it didn't work. However, that may not be your problem. When I exited my terminal program to run propeller-load, that may have reset the Propeller. Do you have the RES line physically disconnected on this board?

  • Cluso99Cluso99 Posts: 18,066
    edited 2016-01-22 01:31
    Yes, I removed the reset link/line. The code just sits there waiting for the download. If the download fails, or its an identifier (F7) it just responds and goes back to the start waiting for a new download.
    The only points of failure where it locks are if the eeprom program fails (you don't know the state its let in) and some of the transmission errors (again where the state is uncertain - some of these I can probably fix to go again).

  • Cluso99Cluso99 Posts: 18,066
    Self-host SPIN/PASM compiling under PropOS is getting closer...

    I have now converted Michael Park's Sphinx Propeller Compiler (modelled after his homespun compiler) to run under PropOS. LEX and LINK both are working but CODEGEN needs more code space :(
    Currently looking to see how to split codegen into two modules.
  • Cluso99Cluso99 Posts: 18,066
    edited 2016-01-29 01:01
    Here is a new Propeller Bootloader...

    For the eeprom versions see two posts below. The binary versions are for download/programming using Ctl-F11

    * Runs FullDuplexSerial on P30/31 at 115,200 baud
    * Loads & Runs a file "_BOOT_P1.BIN" or "_OS.CMD" from a FAT16/32 SD card
    * Filename, Serial pins and SD pins can be changed simply and recompiled
    * Designed to be programmed into the lower 32KB EEPROM for booting an SD file

    This permits you to change the file booted on the SD card without the need to reprogram the EEPROM.

    Pre-compiled versions posted for...

    P8XBlade2/CpuBlade7
    "_BOOT_OS_P8XBlade2.binary"
    * For P8XBlade2 & CpuBlade7
    * 12MHz PLLx8 (96.000MHz)
    * Serial on P30/31
    * SD on P12..P15

    Default 5MHz PLLx16, SD P0..P3
    "_BOOT_OS_5MHzX16_0-3.binary"
    * For many general propeller boards plus SD
    * 5MHz PLLx16 (80.000MHz)
    * Serial on P30/31
    * SD on P0..P3 (DO/CLK/DI/*CS)

    Alternate instructions to program EEPROM directly from SD card
    Presumes you already have my OS running on your propeller
    You will require the WE (write enable) link on my board shorted
    1. Rename "_BOOT_OSxxx.binary" to "_BOOT.EEP"
    2. Copy file "_BOOT.EEP" from PC to the SD card
    3. Insert the SD card into your prop card and power up
    4. From the command prompt "SD:>" program the lower 64KB of the eeprom using the command
    SD:>PROGRAM _BOOT.EEP -WL
    5. From the command prompt reboot the prop using
    SD:>REBOOT

    Notes:
    * There is a 1 second delay in the boot program to allow the serial terminal to be ready. You can disable this in the source if you wish, and recompile with PropTool.
    * This version does not auto-select the hardware, even though _OS.CMD does auto-select. (next version???)
  • Cluso99 wrote: »
    Here is a new Propeller Bootloader...

    I'm getting the following result, when I try to program the EEPROM, following these instructions:
    SD:>SD:>program _BOOT.EEP -WL
    t) File size +00009944 - must be 32KB
    

    And, yes the file size is just under 10K... Was that size expected?

    dgately
  • I guess you have to save as EEPROM not BINARY.

    Binary has the actual size of the program, Eeprom is always 32k.

    Enjoy!

    Mike
Sign In or Register to comment.