Shop OBEX P1 Docs P2 Docs Learn Events
Problem Loading program with Simple IDE - Page 2 — Parallax Forums

Problem Loading program with Simple IDE

24

Comments


  • David Betz wrote: »
    Hmmm... I hadn't tried EEPROM programming with the alternate clock settings. I'll try it later.

    Thank You
  • Bobby1066Bobby1066 Posts: 34
    edited 2018-11-22 00:36
    Hi David
    Bobby1066 wrote: »
    David Betz wrote: »
    Hmmm... I hadn't tried EEPROM programming with the alternate clock settings. I'll try it later.



    Have given this some great thought.

    Surely the answer lies with the prop end of the loader.

    If it could determine the crystal frequency after it was download then adjust itself to work with it.
    Maybe then the user program would download and run albeit at the wrong speed.
    All the user need do then is have the first few lines of their code check the frequency and adjust if required.

    Don't know if this is possible but seems feasible to me.

    Bob
  • I'm not sure that there is any way for a program running on the Propeller to determine the frequency of the crystal attached.
  • Bobby1066Bobby1066 Posts: 34
    edited 2018-11-22 14:30
    Hi David
    David Betz wrote: »
    I'm not sure that there is any way for a program running on the Propeller to determine the frequency of the crystal attached.

    Your totally correct. Without a fixed reference there is no way of working it out.

    Bob

  • Bobby1066Bobby1066 Posts: 34
    edited 2018-11-26 10:17
    Hi David

    Have been looking at the code for the proploader on Github. Is this the upto date version.

    I have found a typo in the SPIN code of the Packet Driver.


    1 ''*********************************************
    2 ''* Packet Driver *
    3 ''* (C) 2011 David Betz *
    4 ''* Based on: *
    5 ''* Full-Duplex Serial Driver v1.1 Extended *
    6 ''* (C) 2006 Parallax, Inc. *
    7 ''*********************************************


    76

    77 ' compute the ticks per bit from the baudrate
    78 baudrate := clkfreq / baudrate

    Has this been resolved in the released version.

    Bob


  • Bobby1066 wrote: »
    Hi David

    Have been looking at the code for the proploader on Github. Is this the upto date version.

    I have found a typo in the SPIN code of the Packet Driver.


    1 ''*********************************************
    2 ''* Packet Driver *
    3 ''* (C) 2011 David Betz *
    4 ''* Based on: *
    5 ''* Full-Duplex Serial Driver v1.1 Extended *
    6 ''* (C) 2006 Parallax, Inc. *
    7 ''*********************************************


    76

    77 ' compute the ticks per bit from the baudrate
    78 baudrate := clkfreq / baudrate

    Has this been resolved in the released version.

    Bob


    PS If this isn't the latest could I please have a copy of the latest to look at.

    Thank you

    Bob
  • I'm sorry but I won't have time to look at this for a few days. However, the code that is in the Parallax GitHub repository is the current code. The only changes not reflected in that code is the work I've been doing to get the clock parameters from the header of the binary file being loaded. I can't push those changes until I consult with Parallax.
  • Bobby1066Bobby1066 Posts: 34
    edited 2018-11-26 15:37
    That's OK

    77 ' compute the ticks per bit from the baudrate
    78 baudrate := clkfreq / baudrate

    should read
    78 bitticks:= clkfreq / baudrate ' Calculates clk pulses per bit

    allowing the driver to adapt to differing clock speeds.


    I'm afraid I don't have the setup to test this but it may solve my problem without altering the header files.
    If it works then my project C code would just need the first few instructions to adjust clock speed after loading.

    Bob


  • Bobby1066 wrote: »
    That's OK

    77 ' compute the ticks per bit from the baudrate
    78 baudrate := clkfreq / baudrate

    should read
    78 bitticks:= clkfreq / baudrate ' Calculates clk pulses per bit

    allowing the driver to adapt to differing clock speeds.

    Bob

    Thanks! Can you submit a pull request for this fix?

  • David Betz wrote: »
    Bobby1066 wrote: »
    That's OK

    77 ' compute the ticks per bit from the baudrate
    78 baudrate := clkfreq / baudrate

    should read
    78 bitticks:= clkfreq / baudrate ' Calculates clk pulses per bit

    allowing the driver to adapt to differing clock speeds.

    Bob

    Thanks! Can you submit a pull request for this fix?

    First time ever done that hope I did it correctly.

    Bob
  • Bobby1066 wrote: »
    David Betz wrote: »
    Bobby1066 wrote: »
    That's OK

    77 ' compute the ticks per bit from the baudrate
    78 baudrate := clkfreq / baudrate

    should read
    78 bitticks:= clkfreq / baudrate ' Calculates clk pulses per bit

    allowing the driver to adapt to differing clock speeds.

    Bob

    Thanks! Can you submit a pull request for this fix?

    First time ever done that hope I did it correctly.

    Bob
    Thanks!

  • David BetzDavid Betz Posts: 14,516
    edited 2018-11-30 03:57
    I just pushed a bunch of changes to the proploader repository. The main one is that proploader now defaults to getting clock settings from the binary file being loaded unless you specify a board configuration file using the command line option -b. In that case it will get its clock settings from the config file. The fast loader seems to work on all of the boards I've tried including the ActivityBoard, the Flip, and the Hydra. For the Hydra you need to invoke proploader with the "-b hydra" option and have the hydra.cfg file that comes with SimpleIDE. Failing that, you can use the INITIAL_CLKMODE macro I posted elsewhere to cause the clock mode to be XTAL1+PLL8X in the binary file.

    Also, this should work:
    proploader -D clock-settings=config -D clkfreq=80000000 -D clkmode=XTAL1+PLL8X -s foo.elf -r -t
    
  • Clock LoopClock Loop Posts: 2,069
    edited 2018-11-30 06:49
    nevermind, I realized i can download a previous version and look at what it installs and where.
  • Hi David

    Thank you for that.
    Can I be a nuisance but could you please post a windows exe of the updated proploader as I cant currently bulid one myself.

    Thank you in anticipation.

    Bob
  • Bobby1066 wrote: »
    Hi David

    Thank you for that.
    Can I be a nuisance but could you please post a windows exe of the updated proploader as I cant currently bulid one myself.

    Thank you in anticipation.

    Bob

    http://david.zemon.name:8111/repository/download/PropLoader_WindowsX86/2520:id/proploader.zip?guest=1
  • Thank you

    will test and confirm if working.

    Bob
  • I'm thinking of just getting rid of the new "clock-settings" config variable and keying off of the existence of the "clkfreq" and "clkmode" variables to decide whether to use the values in the binary. It seems like clock-settings is redundant.
  • Clock LoopClock Loop Posts: 2,069
    edited 2018-11-30 17:57
    DavidZemon wrote: »

    So many tricks, so little time to learn about them all.

    Jetbrains... i feel like jetbrains keeping up with it all. now i havta read about this...

    dang,... you have more in here... oh is that not public... sorry.. no idea.
  • DavidZemon wrote: »
    Bobby1066 wrote: »
    Hi David

    Thank you for that.
    Can I be a nuisance but could you please post a windows exe of the updated proploader as I cant currently bulid one myself.

    Thank you in anticipation.

    Bob

    http://david.zemon.name:8111/repository/download/PropLoader_WindowsX86/2520:id/proploader.zip?guest=1
    This link isn't working for me. Is your site up now?

  • Clock LoopClock Loop Posts: 2,069
    edited 2018-11-30 17:59
    David Betz wrote: »

    Works for me, just clicked it now. (its probably the port) use 80! lol

    ya know.. im just gonna delete the whole repo locally..... this reset hard head business seems to get me in trouble.
    worked..
    Odd, when I tried to update the head using
    git reset --hard HEAD
    git clean -xffd
    git pull
    

    When I tried to compile the rpi version I TOO ran into an issue.
    So i deleted the whole thing and ran git clone again. And all compile fine now. (win32 linux and rpi)
  • Maybe my work network is blocking that address. I'll try it when I get home.
  • Hi David

    Tried version from your link and still loads OK into RAM but fails into EEPROM

    Project Directory: K:/Bob Project/19-11-2018/

    SimpleIDE Version 1.1.2
    C:/Users/Bobby/Documents/SimpleIDE/Learn/Simple Libraries/
    C:/Users/Bobby/Documents/SimpleIDE/ Updated on: 2018-10-23

    propeller-elf-gcc.exe -v GCC 4.6.1 (propellergcc_v1_0_0_2408)
    openspin.exe -c -I C:/Program Files (x86)/SimpleIDE/bin/../propeller-gcc/spin/ -o cmm/Pulse1Hz.dat Pulse1Hz.spin
    Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2016 Parallax Inc. DBA Parallax Semiconductor.
    Version 1.00.78 Compiled on May 28 2016 12:06:45
    Compiling...
    Pulse1Hz.spin
    Done.
    Program size is 44 bytes
    propeller-elf-objcopy -I binary -B propeller -O propeller-elf-gcc --redefine-sym _binary_cmm_Pulse1Hz_dat_start=_binary_Pulse1Hz_dat_start --redefine-sym _binary_cmm_Pulse1Hz_dat_end=_binary_Pulse1Hz_dat_end --redefine-sym _binary_cmm_Pulse1Hz_dat_size=_binary_Pulse1Hz_dat_size cmm/Pulse1Hz.dat cmm/Pulse1Hz_firmware.o
    propeller-elf-gcc.exe -I . -L . -I C:/Users/Bobby/Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools -L C:/Users/Bobby/Documents/SimpleIDE/Learn/Simple Libraries/Utility/libsimpletools/cmm/ -I C:/Users/Bobby/Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libsimpletext -L C:/Users/Bobby/Documents/SimpleIDE/Learn/Simple Libraries/TextDevices/libsimpletext/cmm/ -I C:/Users/Bobby/Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c -L C:/Users/Bobby/Documents/SimpleIDE/Learn/Simple Libraries/Protocol/libsimplei2c/cmm/ -o cmm/BeatTimeInC_FullyWorking_01-11-2018_08_00 (1).elf -Os -mcmm -m32bit-doubles -fno-exceptions cmm/Pulse1Hz_firmware.o BeatTimeInC_FullyWorking_01-11-2018_08_00 (1).c -lsimpletools -lsimpletext -lsimplei2c -lsimpletools -lsimpletext -lsimpletools
    propeller-load -s cmm/BeatTimeInC_FullyWorking_01-11-2018_08_00 (1).elf
    propeller-elf-objdump -h cmm/BeatTimeInC_FullyWorking_01-11-2018_08_00 (1).elf
    Done. Build Succeeded!

    proploader.exe -e -r -I C:/Program Files (x86)/SimpleIDE/bin/../propeller-gcc/propeller-load/ -b bob -p COM3 cmm/BeatTimeInC_FullyWorking_01-11-2018_08_00 (1).elf

    Opening file 'cmm/BeatTimeInC_FullyWorking_01-11-2018_08_00 (1).elf'Downloading file to port COM3
    10260 bytes sent
    Verifying RAM
    Programming EEPROM
    ERROR: EEPROM checksum failed
    ERROR: Download failed
    10260 bytes sent

    Verifying RAM
    Programming EEPROM
    ERROR: EEPROM checksum failed
    ERROR: Download failed

    Bob
  • Sorry. I didn't have time to check the EEPROM writing yet.
  • No probs if you let me know when you have. No rush then I'll test it.

    Bob
  • Clock Loop wrote: »
    So many tricks, so little time to learn about them all.

    Jetbrains... i feel like jetbrains keeping up with it all. now i havta read about this...

    Indeed :) I am quite the JetBrains fanboy. But only because they make good products! I do try to keep up with a lot of different products (JetBrains competitors) and JetBrains is consistently with the best of them and usually better than the best of them. Their code review tool (Upsource) is great too.
    Clock Loop wrote: »
    dang,... you have more in here... oh is that not public... sorry.. no idea.

    All public. I actually just added more to the public view - no reason for it to be private. There's just one private build left, and that's my PropWare IDE server because no one else ever needs to be aware of its build status :P
    Clock Loop wrote: »
    Works for me, just clicked it now. (its probably the port) use 80! lol

    If I ever change the port, it will be because I figured out how to get lets-encrypt + apache + TeamCity working. Apache is already serving up many other sites from the same server, so 80 and 443 are already in use. I'd love to get TeamCity sitting behind Apache and secured through Let's Encrypt, but haven't bothered taking the time to learn apache (my wonderful dad, a life-long sys admin, did most of the setup for the server, i just manage my own stuff like TeamCity).
  • David BetzDavid Betz Posts: 14,516
    edited 2018-12-01 00:37
    I just pushed some new changes. I've removed the clock-settings variable. Now proploader uses the clkfreq and clkmode from the config file if one was specified and otherwise uses the settings from the binary file being loaded. There are also some new variables fast-loader-clkfreq and fast-loader-clkmode in case you want the fast loader to use different settings than the program being loaded. This could be useful if your program uses RCFAST at runtime but has a crystal and can take advantage of the fast loader at load time.

    I still haven't looked at the EEPROM programming problem. I'll do that next. Lastly, I'm going to add an option to allow bypassing the fast loader entirely. This would be useful for loading a program onto a board that doesn't have a crystal where the fast loader would never work anyway.

    These changes mean that the following command line would work for loading a program onto a Hydra board:
    proploader -s -D clkfreq=80000000 -D clkmode=XTAL1+PLL8X foo.elf -r -t
    
    Either that or just use this command if you have a hydra.cfg file:
    proploader -s -b hydra foo.elf -r -t
    
  • I just pushed a fix for the EEPROM programming issue. I was able to successfully program the EEPROM on my Hydra board. There is still some work to be done to allow programming boards that don't use an 80mhz clock but this should work for the Hydra and any other boards that run at 80mhz.
  • Bobby1066Bobby1066 Posts: 34
    edited 2018-12-01 21:51
    Hi David

    I've just installed C compiler on my computer under windows 7.
    20 years since I did any C programming. Think my setup is correct.

    Have tried to compile Proploader from Github & the compiler can't find IP_Loader.h

    I have looked at the Github src files and its not there but there is an IP_Loader.spin amongst the spin files.

    After my last error I'm being cautious. Is it missing? or am I doing something wrong?


    $ make
    make: git: Command not found
    make: git: Command not found
    VERSION (2018-12-01 21:30:01)
    make: git: Command not found
    gcc -Wall -DVERSION=\"" (2018-12-01 21:30:01)"\" -DMINGW -I/home/Bobby/proploader-msys-build/obj tools/split.c -o /home/Bobby/proploader-msys-build/bin/split.exe
    cd spin/; openspin -o /home/Bobby/proploader-msys-build/obj/IP_Loader.binary IP_Loader.spin
    Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2016 Parallax Inc. DBA Parallax Semiconductor.
    Version 1.00.78 Compiled on May 28 2016 12:06:45
    Compiling...
    IP_Loader.spin
    Done.
    Program size is 856 bytes
    /home/Bobby/proploader-msys-build/bin/split.exe /home/Bobby/proploader-msys-build/obj/IP_Loader.binary /home/Bobby/proploader-msys-build/obj/IP_Loader.h
    error: can't open '/home/Bobby/proploader-msys-build/obj/IP_Loader.binary'
    make: *** [Makefile:155: /home/Bobby/proploader-msys-build/obj/IP_Loader.h] Error 1


    Have tried to compile latest version of Openspin without success.


    $ make
    make -C PropellerCompiler CROSS= BUILD=/home/Bobby/OpenSpin-master/build/PropellerCompiler all
    make[1]: Entering directory '/home/Bobby/OpenSpin-master/PropellerCompiler'
    g++ -Wall -g -o /home/Bobby/OpenSpin-master/build/PropellerCompiler/SymbolEngine.o -c SymbolEngine.cpp
    In file included from PropellerCompilerInternal.h:16:0,
    from SymbolEngine.cpp:13:
    SymbolEngine.cpp: In member function ‘SymbolTableEntry* SymbolEngine::FindSymbol(const char*)’:
    PropellerCompiler.h:31:18: error: ‘stricmp’ was not declared in this scope
    #define _stricmp stricmp
    ^
    SymbolEngine.cpp:351:13: note: in expansion of macro ‘_stricmp’
    if (_stricmp(pSymbol->m_data.name, pSymbolName) == 0)
    ^~~~~~~~
    PropellerCompiler.h:31:18: note: suggested alternative: ‘strncmp’
    #define _stricmp stricmp
    ^
    SymbolEngine.cpp:351:13: note: in expansion of macro ‘_stricmp’
    if (_stricmp(pSymbol->m_data.name, pSymbolName) == 0)
    ^~~~~~~~
    PropellerCompiler.h:31:18: error: ‘stricmp’ was not declared in this scope
    #define _stricmp stricmp
    ^
    SymbolEngine.cpp:364:13: note: in expansion of macro ‘_stricmp’
    if (_stricmp(pSymbol->m_data.name, pSymbolName) == 0)
    ^~~~~~~~
    PropellerCompiler.h:31:18: note: suggested alternative: ‘strncmp’
    #define _stricmp stricmp
    ^
    SymbolEngine.cpp:364:13: note: in expansion of macro ‘_stricmp’
    if (_stricmp(pSymbol->m_data.name, pSymbolName) == 0)
    ^~~~~~~~
    PropellerCompiler.h:31:18: error: ‘stricmp’ was not declared in this scope
    #define _stricmp stricmp
    ^
    SymbolEngine.cpp:377:13: note: in expansion of macro ‘_stricmp’
    if (_stricmp(pSymbol->m_data.name, pSymbolName) == 0)
    ^~~~~~~~
    PropellerCompiler.h:31:18: note: suggested alternative: ‘strncmp’
    #define _stricmp stricmp
    ^
    SymbolEngine.cpp:377:13: note: in expansion of macro ‘_stricmp’
    if (_stricmp(pSymbol->m_data.name, pSymbolName) == 0)
    ^~~~~~~~
    make[1]: *** [Makefile:67: /home/Bobby/OpenSpin-master/build/PropellerCompiler/SymbolEngine.o] Error 1
    make[1]: Leaving directory '/home/Bobby/OpenSpin-master/PropellerCompiler'
    make: *** [Makefile:52: build/PropellerCompiler/libopenspin.a] Error 2



    Bob


  • IP_Loader.h gets created during the make process. It appears to be a hex dump (as an array of bytes) of the IP_Loader.spin compiled binary that gets used by the loader. Take a look in the Makefile to see where on your system that files gets stored.

    As an example: On a macOS system, all built files get placed in a directory named "proploader-macosx-build" that is created at the same level in the file system as the PropLoader directory. On WIN, there should be a similar path to that file. You may need to modify the the Makefile or set the path to an environment variable before you run make.

    dgately
  • dgately wrote: »
    IP_Loader.h gets created during the make process. It appears to be a hex dump (as an array of bytes) of the IP_Loader.spin compiled binary that gets used by the loader. Take a look in the Makefile to see where on your system that files gets stored.

    As an example: On a macOS system, all built files get placed in a directory named "proploader-macosx-build" that is created at the same level in the file system as the PropLoader directory. On WIN, there should be a similar path to that file. You may need to modify the the Makefile or set the path to an environment variable before you run make.

    dgately
    Yes, that is exactly correct. It is a generated file. You need openspin installed to build PropLoader.

Sign In or Register to comment.