Shop OBEX P1 Docs P2 Docs Learn Events
mstimer always zero with XMMC External Flash Code Main Ram Data - Page 2 — Parallax Forums

mstimer always zero with XMMC External Flash Code Main Ram Data

2»

Comments

  • jazzedjazzed Posts: 11,803
    edited 2014-03-28 09:20
    I took the following actions with root rights.
    1. I deleted the /opt/parallax and /opt/parallax-win32 folders.
    2. I deleted the build and build-win32 folder.
    3. I did the "hg diff" and "hg revert --all" commands
    4. Created /opt/parallax/
    5. chmod 777 /opt/parallax/
    6. PATH=${PATH}:/opt/parallax/bin and export PATH=/opt/parallax/bin:${PATH}
    7. make -clean
    8. make
    9. make CROSS=win32

    The linux variant was build without errors.
    For the windows variant i got:" undefined reference to `_usleep'".
    The other error seem to be solved.

    Do i have to do chmod 777 /opt/parallax-win32/ aswell? Or do i need to add /opt/parallax-win32/ to the $PATH variable?
    Making progress.

    Yes, make /opt/parallax-win32 writable - sorry I skipped that. I don't recall adding /opt/parallax/win32/bin to my PATH.

    I'll retest cross-builds on linux to see if I can reproduce the usleep problem. I can also post a link to the resulting package.

    I just can't post a new package everytime there is a minor library file change.
  • jazzedjazzed Posts: 11,803
    edited 2014-03-28 14:30
    Hi.

    A Propeller GCC default branch i686 32-bit windows package is now available here:
    https://drive.google.com/file/d/0BzcfH7bdVTbtNkRRbmE5TUVtTnM/edit?usp=sharing

    A Propeller GCC default branch i686 32-bit linux package is available here:
    https://drive.google.com/file/d/0BzcfH7bdVTbtTGZVSHp1VVpwWHc/edit?usp=sharing

    I didn't have any trouble with usleep. Mega-sleep tends to elude me though.
  • BlackSoldierBBlackSoldierB Posts: 45
    edited 2014-03-31 01:00
    Thanks, maybe it gave that error because i was building as root. I will try a full rebuild with my normal account.

    I am now going to change the Simple Libraries so that they use the EXTRA_STACK_LONGS variable.

    EDIT: The user change didn't matter, still got the usleep error.
  • jazzedjazzed Posts: 11,803
    edited 2014-03-31 10:57
    I don't know what to tell you about the usleep issue. I build on Linux Mint i686 with the mingw cross-compiler package and have no problems. There are two other developers that build it also. You may be seeing something that we take for granted. Unfortunately I don't have time to chase the problem.

    Are you able to use the package I posted?
  • BlackSoldierBBlackSoldierB Posts: 45
    edited 2014-04-01 00:57
    Yeah your package works.

    Is there a fast way to build the simple libaries with specific settings?

    I didn't dothe following steps, because i didn't understand how to do it.
    Please download and build [URL="https://github.com/reltham/OpenSpin"]OpenSpin[/URL] and put it in your PATH.
    
  • ersmithersmith Posts: 6,054
    edited 2014-04-01 03:12
    EDIT: The user change didn't matter, still got the usleep error.

    Can you give us the context? What's it trying to build when it gets the undefined _usleep reference? Is this an error in building gcc, or some of the binutils, or another PC based tool? Or is it a problem building the Propeller libraries or other code to run on the propeller? Does it tell you what file is referencing _usleep?
  • BlackSoldierBBlackSoldierB Posts: 45
    edited 2014-04-01 03:20
    This is the output of the last couple of lines.
    Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2013 Parallax Inc. DBA Parallax Semiconductor.
    Compiled on Oct 21 2013
    Compiling...
    spin/flash_loader2.spin
    |-xmem_interface.spin
    Done.
    Program size is 4212 bytes
    /home/bas/propgcc/../build-win32/loader/obj/msys/flash_loader2.binary
    /home/bas/propgcc/../build-win32/loader/obj/msys/flash_loader2.c
    /home/bas/propgcc/../build-win32/loader/obj/msys/flash_loader2.o
    /home/bas/propgcc/../build-win32/loader/obj/msys/osint_mingw.o
    src/enumcom.c:41: warning: ‘GUID_CLASS_COMPORT’ initialized and declared ‘extern’
    /home/bas/propgcc/../build-win32/loader/obj/msys/enumcom.o
    /home/bas/propgcc/../build-win32/loader/obj/msys/PLoadLib.o:PLoadLib.c:(.text+0x1b9): undefined reference to `_usleep'
    collect2: ld returned 1 exit status
    make[1]: *** [/home/bas/propgcc/../build-win32/loader/bin/msys/propeller-load.exe] Error 1
    rm /home/bas/propgcc/../build-win32/loader/obj/propeller/dir-created /home/bas/propgcc/../build-win32/loader/obj/propeller/p2booter.o /home/bas/propgcc/../build-win32/loader/obj/propeller/p2loader.bin /home/bas/propgcc/../build-win32/loader/obj/msys/p2loader.c /home/bas/propgcc/../build-win32/loader/obj/msys/flash_loader2.binary /home/bas/propgcc/../build-win32/loader/obj/propeller/p2booter.bin /home/bas/propgcc/../build-win32/loader/obj/msys/p2flasher.c /home/bas/propgcc/../build-win32/loader/obj/propeller/p2flasher.o /home/bas/propgcc/../build-win32/loader/obj/propeller/p2loader.o /home/bas/propgcc/../build-win32/loader/obj/msys/flash_loader.binary /home/bas/propgcc/../build-win32/loader/obj/msys/flash_loader2.c /home/bas/propgcc/../build-win32/loader/obj/propeller/p2flasher.bin /home/bas/propgcc/../build-win32/loader/obj/msys/p2booter.c
    make[1]: Leaving directory `/home/bas/propgcc/loader'
    make: *** [/home/bas/propgcc/../build-win32/loader/loader-built] Error 2
    

    It looks like the error occurs when the loader is getting build.
  • jazzedjazzed Posts: 11,803
    edited 2014-04-01 10:44
    My loader build output looks like below. Maybe you can compare notes to find some differences?
    Building propeller-load
    make[1]: Entering directory `/home/steve/Projects/propgcc/loader'
    TOOLCC: i586-mingw32msvc-gcc
    CFLAGS: -DMINGW -Wall -Isrc/common -Isrc/runtime -Isrc/loader
    LDFLAGS: -DMINGW -Wall -Isrc/common -Isrc/runtime -Isrc/loader
    SPIN:
    /home/steve/Projects/propgcc/../build-win32/loader/bin/msys/bin2c.exe
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/propeller-load.o
    src/loader.c: In function ‘WriteFileToSDCard’:
    src/loader.c:1350: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘size_t’
    src/loader.c:1357: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘size_t’
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/loader.o
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/lmm-image.o
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/xmm-image.o
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/xmm-image2.o
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/pex-image.o
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/loadelf.o
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/packet.o
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/PLoadLib.o
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/p1image.o
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/p2image.o
    propeller-elf-gcc /home/steve/Projects/propgcc/../build-win32/loader/obj/propeller/p2loader.o
    binary /home/steve/Projects/propgcc/../build-win32/loader/obj/propeller/p2loader.bin
    bin2c /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/p2loader.c
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/p2loader.o
    propeller-elf-gcc /home/steve/Projects/propgcc/../build-win32/loader/obj/propeller/p2booter.o
    binary /home/steve/Projects/propgcc/../build-win32/loader/obj/propeller/p2booter.bin
    bin2c /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/p2booter.c
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/p2booter.o
    propeller-elf-gcc /home/steve/Projects/propgcc/../build-win32/loader/obj/propeller/p2flasher.o
    binary /home/steve/Projects/propgcc/../build-win32/loader/obj/propeller/p2flasher.bin
    bin2c /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/p2flasher.c
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/p2flasher.o
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/config.o
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/expr.o
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/system.o
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/port.o
    Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2013 Parallax Inc. DBA Parallax Semiconductor.
    Compiled on Oct 21 2013
    Compiling...
    spin/serial_helper.spin
    |-packet_driver.spin
    |-fsrw.spin
      |-safe_spi_c3.spin
    |-cache_interface.spin
    |-vm_start.spin
      |-cache_interface.spin
    Done.
    Program size is 10392 bytes
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/serial_helper.binary
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/serial_helper.c
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/serial_helper.o
    Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2013 Parallax Inc. DBA Parallax Semiconductor.
    Compiled on Oct 21 2013
    Compiling...
    spin/serial_helper2.spin
    |-packet_driver.spin
    |-fsrw.spin
      |-safe_spi_c3.spin
    |-xmem_interface.spin
    Done.
    Program size is 9808 bytes
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/serial_helper2.binary
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/serial_helper2.c
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/serial_helper2.o
    Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2013 Parallax Inc. DBA Parallax Semiconductor.
    Compiled on Oct 21 2013
    Compiling...
    spin/flash_loader.spin
    |-cache_interface.spin
    |-vm_start.spin
      |-cache_interface.spin
    Done.
    Program size is 4848 bytes
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/flash_loader.binary
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/flash_loader.c
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/flash_loader.o
    Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2013 Parallax Inc. DBA Parallax Semiconductor.
    Compiled on Oct 21 2013
    Compiling...
    spin/flash_loader2.spin
    |-xmem_interface.spin
    Done.
    Program size is 4212 bytes
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/flash_loader2.binary
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/flash_loader2.c
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/flash_loader2.o
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/osint_mingw.o
    src/enumcom.c:41: warning: ‘GUID_CLASS_COMPORT’ initialized and declared ‘extern’
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/enumcom.o
    /home/steve/Projects/propgcc/../build-win32/loader/bin/msys/propeller-load.exe
    /home/steve/Projects/propgcc/../build-win32/loader/propeller-load/winbond_spi_flash_xmem.dat
    /home/steve/Projects/propgcc/../build-win32/loader/propeller-load/sst_spi_flash_xmem.dat
    /home/steve/Projects/propgcc/../build-win32/loader/propeller-load/spi_sram_xmem.dat
    /home/steve/Projects/propgcc/../build-win32/loader/propeller-load/spi_sram24_xmem.dat
    /home/steve/Projects/propgcc/../build-win32/loader/propeller-load/winbond_sqi_flash_xmem.dat
    /home/steve/Projects/propgcc/../build-win32/loader/propeller-load/sst_sqi_flash_xmem.dat
    /home/steve/Projects/propgcc/../build-win32/loader/propeller-load/sqi_sram_xmem.dat
    /home/steve/Projects/propgcc/../build-win32/loader/propeller-load/c3_xmem.dat
    /home/steve/Projects/propgcc/../build-win32/loader/propeller-load/eeprom_xmem.dat
    /home/steve/Projects/propgcc/../build-win32/loader/propeller-load/winbond_sqi_flash_sram_xmem.dat
    /home/steve/Projects/propgcc/../build-win32/loader/propeller-load/sst_sqi_flash_sram_xmem.dat
    /home/steve/Projects/propgcc/../build-win32/loader/propeller-load/rampage2_xmem.dat
    /home/steve/Projects/propgcc/../build-win32/loader/propeller-load/synapse_xmem.dat
    /home/steve/Projects/propgcc/../build-win32/loader/propeller-load/sd_xmem.dat
    /home/steve/Projects/propgcc/../build-win32/loader/propeller-load/sd_driver.dat
    make[2]: Entering directory `/home/steve/Projects/propgcc/loader/sdloader'
    propeller-elf-gcc -Os -Wall -mcmm -c sd_loader.c -o /home/steve/Projects/build-win32/loader/obj/sd_loader.o
    /home/steve/Projects/build-win32/loader/obj/sd_loader.o
    propeller-elf-gcc -Os -Wall -mcmm -c fatread.c -o /home/steve/Projects/build-win32/loader/obj/fatread.o
    /home/steve/Projects/build-win32/loader/obj/fatread.o
    propeller-elf-gcc -Os -Wall -mcmm -c sdio.c -o /home/steve/Projects/build-win32/loader/obj/sdio.o
    /home/steve/Projects/build-win32/loader/obj/sdio.o
    propeller-elf-gcc -Os -Wall -mcmm -Wl,--defsym -Wl,__stack_end=0x5000 -o /home/steve/Projects/build-win32/loader/propeller-load/sd_loader.elf /home/steve/Projects/build-win32/loader/obj/sd_loader.o /home/steve/Projects/build-win32/loader/obj/fatread.o /home/steve/Projects/build-win32/loader/obj/sdio.o
    propeller-elf-gcc -Os -Wall -mcmm -c sd_cache_loader.c -o /home/steve/Projects/build-win32/loader/obj/sd_cache_loader.o
    /home/steve/Projects/build-win32/loader/obj/sd_cache_loader.o
    propeller-elf-gcc -Os -Wall -mcmm -c vm_start.S -o /home/steve/Projects/build-win32/loader/obj/vm_start.o
    /home/steve/Projects/build-win32/loader/obj/vm_start.o
    propeller-elf-gcc -Os -Wall -mcmm -o /home/steve/Projects/build-win32/loader/propeller-load/sd_cache_loader.elf /home/steve/Projects/build-win32/loader/obj/sd_cache_loader.o /home/steve/Projects/build-win32/loader/obj/fatread.o /home/steve/Projects/build-win32/loader/obj/sdio.o /home/steve/Projects/build-win32/loader/obj/vm_start.o
    rm /home/steve/Projects/build-win32/loader/obj/dir-created
    make[2]: Leaving directory `/home/steve/Projects/propgcc/loader/sdloader'
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/propeller-elf-image-size.o
    /home/steve/Projects/propgcc/../build-win32/loader/bin/msys/propeller-elf-image-size.exe
    rm /home/steve/Projects/propgcc/../build-win32/loader/obj/propeller/p2loader.o /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/p2flasher.c /home/steve/Projects/propgcc/../build-win32/loader/obj/propeller/p2loader.bin /home/steve/Projects/propgcc/../build-win32/loader/obj/propeller/p2flasher.o /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/flash_loader.binary /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/flash_loader2.c /home/steve/Projects/propgcc/../build-win32/loader/obj/propeller/p2flasher.bin /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/p2booter.c /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/flash_loader2.binary /home/steve/Projects/propgcc/../build-win32/loader/obj/propeller/dir-created /home/steve/Projects/propgcc/../build-win32/loader/obj/propeller/p2booter.o /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/p2loader.c /home/steve/Projects/propgcc/../build-win32/loader/obj/propeller/p2booter.bin
    make[1]: Leaving directory `/home/steve/Projects/propgcc/loader'
    Installing propeller-load
    make[1]: Entering directory `/home/steve/Projects/propgcc/loader'
    TOOLCC: i586-mingw32msvc-gcc
    CFLAGS: -DMINGW -Wall -Isrc/common -Isrc/runtime -Isrc/loader
    LDFLAGS: -DMINGW -Wall -Isrc/common -Isrc/runtime -Isrc/loader
    SPIN:
    propeller-elf-gcc /home/steve/Projects/propgcc/../build-win32/loader/obj/propeller/p2loader.o
    binary /home/steve/Projects/propgcc/../build-win32/loader/obj/propeller/p2loader.bin
    bin2c /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/p2loader.c
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/p2loader.o
    propeller-elf-gcc /home/steve/Projects/propgcc/../build-win32/loader/obj/propeller/p2booter.o
    binary /home/steve/Projects/propgcc/../build-win32/loader/obj/propeller/p2booter.bin
    bin2c /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/p2booter.c
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/p2booter.o
    propeller-elf-gcc /home/steve/Projects/propgcc/../build-win32/loader/obj/propeller/p2flasher.o
    binary /home/steve/Projects/propgcc/../build-win32/loader/obj/propeller/p2flasher.bin
    bin2c /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/p2flasher.c
    /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/p2flasher.o
    /home/steve/Projects/propgcc/../build-win32/loader/bin/msys/propeller-load.exe
    make[2]: Entering directory `/home/steve/Projects/propgcc/loader/sdloader'
    make[2]: Nothing to be done for `all'.
    make[2]: Leaving directory `/home/steve/Projects/propgcc/loader/sdloader'
    cp -f /home/steve/Projects/propgcc/../build-win32/loader/bin/msys/propeller-load.exe /opt/parallax-win32/bin
    cp -f /home/steve/Projects/propgcc/../build-win32/loader/bin/msys/propeller-elf-image-size.exe /opt/parallax-win32/bin
    cp -f /home/steve/Projects/propgcc/../build-win32/loader/propeller-load/*.dat /home/steve/Projects/propgcc/../build-win32/loader/propeller-load/*.elf /opt/parallax-win32/propeller-load
    cp -f xmem-drivers/*.cfg /opt/parallax-win32/propeller-load
    cp -f xmem-drivers/boards.txt /opt/parallax-win32/propeller-load
    rm /home/steve/Projects/propgcc/../build-win32/loader/obj/propeller/p2loader.o /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/p2flasher.c /home/steve/Projects/propgcc/../build-win32/loader/obj/propeller/p2loader.bin /home/steve/Projects/propgcc/../build-win32/loader/obj/propeller/p2flasher.o /home/steve/Projects/propgcc/../build-win32/loader/obj/propeller/p2flasher.bin /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/p2booter.c /home/steve/Projects/propgcc/../build-win32/loader/obj/propeller/dir-created /home/steve/Projects/propgcc/../build-win32/loader/obj/propeller/p2booter.o /home/steve/Projects/propgcc/../build-win32/loader/obj/msys/p2loader.c /home/steve/Projects/propgcc/../build-win32/loader/obj/propeller/p2booter.bin
    make[1]: Leaving directory `/home/steve/Projects/propgcc/loader'
    
    $
    
    
  • BlackSoldierBBlackSoldierB Posts: 45
    edited 2014-04-02 00:33
    I got this at line 19, while you didn't.
    src/PLoadLib.c: In function ‘sendlong’:
    src/PLoadLib.c:130: warning: implicit declaration of function ‘usleep’
    

    On line 91 i did got
    /home/bas/propgcc/../build-win32/loader/obj/msys/PLoadLib.o:PLoadLib.c:(.text+0x1b9): undefined reference to `_usleep'
    

    and you got
    /home/steve/Projects/propgcc/../build-win32/loader/bin/msys/propeller-load.exe
    

    After that i got an error while yours continues.

    Your propgcc source path is slightly different, but that shouldn't be the problem.

    What are the operating systems that the others are building on?
  • jazzedjazzed Posts: 11,803
    edited 2014-04-02 09:35
    I was thinking that the configuration stuff might offer more clues. Guess they are very similar if not identical.
    What are the operating systems that the others are building on?

    Linux. Not sure of the distribution(s) though.

    What distribution are you using?
  • ersmithersmith Posts: 6,054
    edited 2014-04-02 14:10
    What version of mingw32 are you using? I have a declaration for usleep in <unistd.h> (on my system that's in /usr/i586-mingw32msvc/include/unistd.h). I'm cross-compiling on Ubuntu 12.04, with the default mingw32 package. "i586-mingw32msvc-gcc -v" identifies itself as:
    i586-mingw32msvc-gcc -v
    Using built-in specs.
    Target: i586-mingw32msvc
    Configured with: /build/buildd/mingw32-4.2.1.dfsg/build_dir/src/gcc-4.2.1-2-dfsg/configure -v --prefix=/usr --target=i586-mingw32msvc --enable-languages=c,c++ --enable-threads --enable-sjlj-exceptions --disable-multilib --enable-version-specific-runtime-libs
    Thread model: win32
    gcc version 4.2.1-sjlj (mingw32-2)
    

    I would guess that your mingw32 may be older (and hasn't had usleep added to it yet).

    Eric
  • BlackSoldierBBlackSoldierB Posts: 45
    edited 2014-04-03 00:26
    What distribution are you using?

    Debian, the iso name is "debian-7.4.0-amd64-i386-netinst.iso".

    The propgcc guide uses debian-6.0.2.1-i386-netinst, but i don't think that can be the problem.
    What version of mingw32 are you using?

    i586-mingw32msvc-gcc -v outputs:
    Using built-in specs.
    Target: i586-mingw32msvc
    Configured with: /build/buildd-mingw32_4.2.1.dfsg-2-i386-16QVXY/mingw32-4.2.1.dfsg/build_dir/src/gcc-4.2.1-2-dfsg/configure -v --prefix=/usr --target=i586-mingw32msvc --enable-languages=c,c++ --enable-threads --enable-sjlj-exceptions --disable-multilib --enable-version-specific-runtime-libs
    Thread model: win32
    gcc version 4.2.1-sjlj (mingw32-2)
    

    It looks like i got the same version, so that shouldn't be the problem.
  • ersmithersmith Posts: 6,054
    edited 2014-04-04 16:56
    At this point I'm thoroughly mystified. Grasping at straws, but is the "mingw32-runtime" package installed on your system? It should be, but perhaps for some reason it isn't?

    usleep is provided by mingw32, so the problem is somewhere in there, not (AFAIK) in propgcc.
  • jazzedjazzed Posts: 11,803
    edited 2014-04-04 19:00
    Debian, the iso name is "debian-7.4.0-amd64-i386-netinst.iso".

    The propgcc guide uses debian-6.0.2.1-i386-netinst, but i don't think that can be the problem.
    Actually, the debian-6.0.2.1 recommendation predates the mingw cross compiler feature by a few years. I'll try a build with an old 6.0 VM.
  • jazzedjazzed Posts: 11,803
    edited 2014-04-04 21:19
    Ok, I get the undefined usleep issue on Debian 6.0. This is clearly a mingw library thing.

    Works fine on Mint16 and Ubuntu13 ... there are others to try of course. Not sure what the minimum version is.
    Building propeller-load
    make[1]: Entering directory `/home/steve/gcc/propgcc/loader'
    TOOLCC: i586-mingw32msvc-gcc
    CFLAGS: -DMINGW -Wall -Isrc/common -Isrc/runtime -Isrc/loader
    LDFLAGS: -DMINGW -Wall -Isrc/common -Isrc/runtime -Isrc/loader
    SPIN:
    /home/steve/gcc/propgcc/../build-win32/loader/bin/msys/bin2c.exe
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/propeller-load.o
    src/loader.c: In function ‘WriteFileToSDCard’:
    src/loader.c:1350: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘size_t’
    src/loader.c:1357: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘size_t’
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/loader.o
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/lmm-image.o
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/xmm-image.o
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/xmm-image2.o
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/pex-image.o
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/loadelf.o
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/packet.o
    src/PLoadLib.c: In function ‘sendlong’:
    src/PLoadLib.c:130: warning: implicit declaration of function ‘usleep’
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/PLoadLib.o
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/p1image.o
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/p2image.o
    propeller-elf-gcc /home/steve/gcc/propgcc/../build-win32/loader/obj/propeller/p2loader.o
    binary /home/steve/gcc/propgcc/../build-win32/loader/obj/propeller/p2loader.bin
    bin2c /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/p2loader.c
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/p2loader.o
    propeller-elf-gcc /home/steve/gcc/propgcc/../build-win32/loader/obj/propeller/p2booter.o
    binary /home/steve/gcc/propgcc/../build-win32/loader/obj/propeller/p2booter.bin
    bin2c /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/p2booter.c
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/p2booter.o
    propeller-elf-gcc /home/steve/gcc/propgcc/../build-win32/loader/obj/propeller/p2flasher.o
    binary /home/steve/gcc/propgcc/../build-win32/loader/obj/propeller/p2flasher.bin
    bin2c /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/p2flasher.c
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/p2flasher.o
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/config.o
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/expr.o
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/system.o
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/port.o
    Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2013 Parallax Inc. DBA Parallax Semiconductor.
    Compiled on Oct 21 2013
    Compiling...
    spin/serial_helper.spin
    |-packet_driver.spin
    |-fsrw.spin
      |-safe_spi_c3.spin
    |-cache_interface.spin
    |-vm_start.spin
      |-cache_interface.spin
    Done.
    Program size is 10392 bytes
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/serial_helper.binary
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/serial_helper.c
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/serial_helper.o
    Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2013 Parallax Inc. DBA Parallax Semiconductor.
    Compiled on Oct 21 2013
    Compiling...
    spin/serial_helper2.spin
    |-packet_driver.spin
    |-fsrw.spin
      |-safe_spi_c3.spin
    |-xmem_interface.spin
    Done.
    Program size is 9808 bytes
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/serial_helper2.binary
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/serial_helper2.c
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/serial_helper2.o
    Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2013 Parallax Inc. DBA Parallax Semiconductor.
    Compiled on Oct 21 2013
    Compiling...
    spin/flash_loader.spin
    |-cache_interface.spin
    |-vm_start.spin
      |-cache_interface.spin
    Done.
    Program size is 4848 bytes
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/flash_loader.binary
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/flash_loader.c
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/flash_loader.o
    Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2013 Parallax Inc. DBA Parallax Semiconductor.
    Compiled on Oct 21 2013
    Compiling...
    spin/flash_loader2.spin
    |-xmem_interface.spin
    Done.
    Program size is 4212 bytes
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/flash_loader2.binary
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/flash_loader2.c
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/flash_loader2.o
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/osint_mingw.o
    src/enumcom.c:41: warning: ‘GUID_CLASS_COMPORT’ initialized and declared ‘extern’
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/enumcom.o
    /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/PLoadLib.o:PLoadLib.c:(.text+0x1b9): undefined reference to `_usleep'
    collect2: ld returned 1 exit status
    make[1]: *** [/home/steve/gcc/propgcc/../build-win32/loader/bin/msys/propeller-load.exe] Error 1
    rm /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/p2booter.c /home/steve/gcc/propgcc/../build-win32/loader/obj/propeller/dir-created /home/steve/gcc/propgcc/../build-win32/loader/obj/propeller/p2booter.o /home/steve/gcc/propgcc/../build-win32/loader/obj/propeller/p2booter.bin /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/p2loader.c /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/flash_loader2.binary /home/steve/gcc/propgcc/../build-win32/loader/obj/propeller/p2loader.o /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/p2flasher.c /home/steve/gcc/propgcc/../build-win32/loader/obj/propeller/p2loader.bin /home/steve/gcc/propgcc/../build-win32/loader/obj/propeller/p2flasher.o /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/flash_loader.binary /home/steve/gcc/propgcc/../build-win32/loader/obj/msys/flash_loader2.c /home/steve/gcc/propgcc/../build-win32/loader/obj/propeller/p2flasher.bin
    make[1]: Leaving directory `/home/steve/gcc/propgcc/loader'
    make: *** [/home/steve/gcc/propgcc/../build-win32/loader/loader-built] Error 2
    
  • BlackSoldierBBlackSoldierB Posts: 45
    edited 2014-04-07 01:08
    Ok, i will download ubuntu 13.10
  • BlackSoldierBBlackSoldierB Posts: 45
    edited 2014-04-14 06:08
    After a lot of compiling it finally worked! :lol:

    Is there a trick to compile it the whole simple libraries with specific settings?
  • jazzedjazzed Posts: 11,803
    edited 2014-04-14 08:32
    Is there a trick to compile it the whole simple libraries with specific settings?
    Not yet.
  • BlackSoldierBBlackSoldierB Posts: 45
    edited 2014-04-18 08:40
    I got the following code working.
    #include "simpletools.h"
    
    using namespace std;
    
    unsigned int stack[EXTRA_STACK_LONGS + 25];
    
    void cog(void* par);
    
    int main(){
    
        low(26);
        low(27);
    
        print("Starting\n");
    
        high(26);
        
        cogstart(&cog, NULL, stack, sizeof stack);
    
        print("Done");
    
        return 0;
    }
    
    void cog(void* par)
    {
        while(1)
        {
            high(27);
    
            pause(500);
    
            low(27);
            
           pause(500);
        }
    }
    

    But the code below still produces 0. I altered the stack of the ms timer so it uses EXTRA_STACK_LONGS.
    Line 17 of mstimer.c changed to: static unsigned int stack[ EXTRA_STACK_LONGS + 40 + 25]; // Stack vars for other cog
    The librarie test code also produces 0.

    mstimer test code:
    #include "simpletools.h"  #include "mstimer.h"
     
    
     int main(){
         low(26);
    
         low(27);
     
    
         print("Starting\n");
     
    
         high(26);
     
    
    mstime_start(); 
    
         for (int i = 0; i < 1000; i++)
         {
             print("%d ", i);
         }
     
    
         print("\n");
     
    
         int ticks = mstime_get();
         mstime_stop();
    
         
    
         print("Total time= %d\n", ticks);
         high(27);
     
    
         return 0;
     }
     
    
    
  • jazzedjazzed Posts: 11,803
    edited 2014-04-18 11:20
    Did you change mstime as recommended earlier? The original code is hitting the 52 second clock miss problem.
  • BlackSoldierBBlackSoldierB Posts: 45
    edited 2014-04-22 01:10
    Yeah that fixed it, i totally forgot about that one.

    Did anyone test the Abdrive library with XMMC?

    When i use for example "drive_speed(64,64)" the wheels stutter.

    The calibration went without stuttering. This is the result of the interpolation table.
    Index   Servo Drive     Encoder Ticks/Second -----   -----------     --------------------
     0       -194            1000
    
     1       -189            171
     2       -184            169
     3       -179            169
     4       -174            167
     5       -169            167
     6       -164            169
     7       -159            170
     8       -154            167
     9       -149            167
     10      -144            167
     11      -139            167
     12      -134            167
     13      -129            167
     14      -124            165
     15      -119            165
     16      -114            162
     17      -109            165
     18      -104            162
     19      -99             158
     20      -94             160
     21      -89             154
     22      -84             155
     23      -79             154
     24      -74             148
     25      -69             144
     26      -64             144
     27      -59             135
     28      -54             133
     29      -49             124
     30      -44             118
     31      -39             112
     32      -34             101
     33      -29             94
     34      -24             87
     35      -19             76
     36      -14             67
     37      -9              61
     38      -4              51
     39      1               42
     40      6               32
     41      11              26
     42      16              15
     43      18              10
     44      20              8
     45      27              0
     46      34              7
     47      36              10
     48      38              15
     49      40              19
     50      42              23
     51      47              30
     52      52              39
     53      57              50
     54      62              59
     55      67              68
     56      72              76
     57      77              86
     58      82              95
     59      87              100
     60      92              111
     61      97              118
     62      102             125
     63      107             132
     64      112             137
     65      117             141
     66      122             144
     67      127             153
     68      132             152
     69      137             153
     70      142             158
     71      147             160
     72      152             160
     73      157             163
     74      162             165
     75      167             166
     76      172             166
     77      177             168
     78      182             164
     79      187             168
     80      192             170
     81      197             168
     82      202             165
     83      182             164
     84      187             168
     85      192             170
     86      197             168
     87      202             1000
     
    
     
    
     === RIGHT SERVO ===
     
    
     Table Entries = 88
     Zero Speed Index = 34
     
    
     Index   Servo Drive     Encoder Ticks/Second
     -----   -----------     --------------------
     0       -195            1000
     1       -190            169
     2       -185            169
     3       -180            172
     4       -175            166
     5       -170            168
     6       -165            162
     7       -160            162
     8       -155            162
     9       -150            162
     10      -145            162
     11      -140            159
     12      -135            157
     13      -130            151
     14      -125            151
     15      -120            144
     16      -115            145
     17      -110            135
     18      -105            130
     19      -100            123
     20      -95             115
     21      -90             109
     22      -85             103
     23      -80             94
     24      -75             86
     25      -70             77
     26      -65             66
     27      -60             57
     28      -55             48
     29      -50             40
     30      -45             34
     31      -40             22
     32      -35             12
     33      -33             7
     34      -25             0
     35      -17             11
     36      -15             14
     37      -13             19
     38      -11             23
     39      -6              34
     40      -1              39
     41      4               50
     42      9               58
     43      14              66
     44      19              75
     45      24              84
     46      29              93
     47      34              104
     48      39              110
     49      44              116
     50      49              126
     51      54              128
     52      59              136
     53      64              141
     54      69              147
     55      74              147
     56      79              156
     57      84              157
     58      89              159
     59      94              159
     60      99              164
     61      104             166
     62      109             164
     63      114             168
     64      119             166
     65      124             164
     66      129             167
     67      134             168
     68      139             167
     69      144             166
     70      149             171
     71      154             167
     72      159             171
     73      164             171
     74      169             170
     75      174             173
     76      179             167
     77      184             171
     78      189             169
     79      194             171
     80      199             171
     81      204             170
     82      179             167
     83      184             171
     84      189             169
     85      194             171
     86      199             171
     87      204             1000
     Done
    
    
  • BlackSoldierBBlackSoldierB Posts: 45
    edited 2014-04-23 04:45
    Mmmm using "drive_feedback(0)" seems to fix the stuttering.

    This might mean that the encoder function is running too slow.
Sign In or Register to comment.