Shop OBEX P1 Docs P2 Docs Learn Events
how to configure proploader for different clkmode — Parallax Forums

how to configure proploader for different clkmode

Hi,

I have to run my propeller at 5MHz instead of the usual 80MHz.
So I just set the _CLKMODE in the main spin file:
_CLKMODE = xtal1 ' Only 5MHz to be measurable by an AVR running at 16MHz
_XINFREQ = 5_000_000

Now I have problems with proploader.
Instead of directly uploading the binary it ripples through different baudrates until it finally ended up at lowest(?) speed.
proploader -D baudrate=115200 -p $DEVICE -r $BINARY

 Opening file 'sobel.bin'
 Downloading file to port /dev/ttyUSB0
 Stepping down to 460800 baud     
 Downloading file to port /dev/ttyUSB0
 Stepping down to 230400 baud     
 Downloading file to port /dev/ttyUSB0
 Stepping down to 115200 baud     
 Downloading file to port /dev/ttyUSB0
 Using single-stage download      
 Downloading file to port /dev/ttyUSB0
 1456 bytes sent                  
 Verifying RAM
 Download successful!

I tried different setting via -D they change nothing in the behavior of proploader.

Why does my program runtime setup influenced the upload process?
And why are the -D-variables ignored?
And how to fix these issues to not wait multiple seconds for the upload?

Comments

  • There are three different baud rate variables. I think you want "fast-loader-baudrate". However, you'll have to set the "fast-loader-clkmode" and "fast-loader-clkfreq" variables as well if you use a non-standard clock.
  • BeanBean Posts: 8,129
    edited 2019-07-12 21:41
    I use SimpleIDE and I have the same problem. Can you tell me how to change "fast-loader-clkmode" and "fast-loader-clkfreq" ?

    I use it to compile .spin files and the only board available is "Generic" and I don't see a generic.cfg file.

    I guess my question then is "How do I pick a different board when using .spin ?".

    Or is there a way to tell SimpleIDE to not use the fast loader and just load the normal way ?

    Thanks,
    Bean
  • Bean wrote: »
    I use SimpleIDE and I have the same problem. Can you tell me how to change "fast-loader-clkmode" and "fast-loader-clkfreq" ?

    I use it to compile .spin files and the only board available is "Generic" and I don't see a generic.cfg file.

    I guess my question then is "How do I pick a different board when using .spin ?".

    Or is there a way to tell SimpleIDE to not use the fast loader and just load the normal way ?

    Thanks,
    Bean
    Sorry, I don't know anything about SimpleIDE. Check with Jeff Martin at Parallax for SimpleIDE questions.

  • I now have the following setup, but is still does not work:
    proploader -D "fast-loader-baudrate=115200" -D "fast-loader-clkmode=xtal1" -D "fast-loader-clkfreq=5000000" -p $DEVICE -r $BINRAY
    

    I get the exact same output
  • RalfStRalfSt Posts: 19
    edited 2019-07-13 09:09
    Sorry, I just copied your varaible names. In the help-output they are shown different. After fixing the names they get appied. Sadly there is no uniform naming. (I'll write a bug-report for this)
    proploader -D "fast-loader-baud-rate=115200" -D "fastloader-clkmode=xtal1" -D "fast-loader-clkfreq=5000000" -p $DEVICE -r $BINARY
    

    I still have the situation that the binary gets downloaded twice:
     Downloading file to port /dev/ttyUSB0
     Using single-stage download      
     Downloading file to port /dev/ttyUSB0
     1456 bytes sent                  
     Verifying RAM
     Download successful!
    

    Is there a way to avoid this?
    At least the process is fast again, thank you :)
  • Hmm... You're right about the names not being consistent. I'll look into changing that. Also, you don't need the -clkfreq or -clkmode settings if you're using the standard ones. I misread your original post and thought you were saying that you were using non-standard settings.

    I'll have to look but it might not really be downloading the file twice. It might just be that the message is displayed twice. That's a bug of course but not as serious a bug as if the download really is done twice. Thanks for reporting this.
  • FYI, this is the default configuration if you don't have a .cfg file:
    baudrate: 115200
    loader-baud-rate: 115200
    fast-loader-baud-rate: 921600
    rxpin: 31
    txpin: 30
    sdspi-do: 22
    sdspi-clk": 23
    sdspi-di: 24
    sdspi-cs: 25
    
    The rxpin and txpin variables really aren't needed. They are there for historical reasons and should probably be removed. Also, note that it is really "fast-loader-clkmode" not "fastloader-clkmode". That's that difference is just a help text bug.
  • In looking at this more it seems what you really need to do is to add this to the command line and forget the other variables:
    -D loader=rom
    
    That may get rid of your duplicate load messages.
  • I just made an observation:

    I had some jitter issues with the UART so I had to increase the clock speed to 10MHz. (-D "fastloader-clkmode=xtal1+pll2x")
    In this situation proploader directly comes with the "Using single-stage download" instead of first downloading the binary using another method.
  • RalfSt wrote: »
    I just made an observation:

    I had some jitter issues with the UART so I had to increase the clock speed to 10MHz. (-D "fastloader-clkmode=xtal1+pll2x")
    In this situation proploader directly comes with the "Using single-stage download" instead of first downloading the binary using another method.
    As I mentioned above, your command line should really be:
    -D "fast-loader-clkmode=xtal1+pll2x"
    
    Also, I don't think the quotes are really necessary.
  • Really, the fast loader is a lot faster for large programs. It's based on Jeff Martin's loader protocol and Parallax wanted to use it for all loads. That's why it's kind of awkward to disable it.
  • What does "loader = rom" do different?

    Is there any documentation for proploader beside the --help option?

    ps.: I use "" around the parameter to make it more obvious that this is an argument to a program and not an equation that gets evaluated by the shell (like $((1+1)) ). It's syntactic sugar to improve the readability of my script files :)
  • RalfSt wrote: »
    What does "loader = rom" do different?

    Is there any documentation for proploader beside the --help option?

    ps.: I use "" around the parameter to make it more obvious that this is an argument to a program and not an equation that gets evaluated by the shell (like $((1+1)) ). It's syntactic sugar to improve the readability of my script files :)
    loader=rom just means to use the ROM loader that is built into the Propeller rather than the fast loader. In fact, the ROM loader is always used even when using the fast loader because the fast loader loads a helper program using the ROM loader before it starts loading your program. Most of the configuration parameters are needed for this helper program so it knows what the clock settings are for the board you are using. The ROM loader doesn't need to know the clock settings since it always runs in RCFAST mode.

Sign In or Register to comment.