compile and download to flash

Posted on
  • Hi,
    I have a espruino rev 1.3b board and I'm using linux throuth virtual box.
    I compiled the project, download, reset , in windows device manager, it is recognised as an unknown device, but I download the official one from espruino, it works fine, a com port.
    I tried these command:

     ESPRUINO_1V3=1 RELEASE=1 make serialflash
    sudo python scripts/stm32loader.py  -ew -k -p /dev/ttyACM0  ../espruino_1v81.581_espruino_1r3.bin  // this is the official bin file, it works.
    

    anybody can help me?

    Thanks,
    Anthony

  • Did you follow all the steps from building from windows VM and flashing from VM?

  • Hi,
    Yes, I have done that, make is ok,
    after run sudo ESPRUINO_1V3=1 RELEASE=1 make serialflash,download ok,
    then I press restart, in windows device manager: it is a unknown device,driver is not installed,
    but the bin file from espruino works fine.

    Thanks,
    Anthony

  • That's an odd one - are you flashing with make serialflash or are you flashing with your own call to stm32loader?

    As the Espruino board uses a bootloader, the binary that you build needs to be flashed at an offset of +10kB - so you need a special command to flash your binary,

    But if you're flashing using serialflash it should be fine and should flash at the correct address?

    The binary you download from the website is 10kB bigger - it has the bootloader stuck on the front of it, which is why you can flash it to the default address.

  • Hi,
    Thank you for your reply.

    • I tried both make serialflash and stm32loader.py
      ESPRUINO_1V3=1 RELEASE=1 make serialflash
      sudo python scripts/stm32loader.py -a 0x8002800 -ew -k -p /dev/ttyACM0 espruino_1v81.26_espruino_1r3.bin
    • ./scripts/create_espruino_image_1v3.sh
      this will create the bin with bootloader
      so I tried sudo python scripts/stm32loader.py -a 0x8000000 -ew -k -p /dev/ttyACM0 espruino_full.bin

    still unknown device

  • Wow, ok - it looks like what you're doing is spot on.

    What's the compiler version (arm-none-eabi-gcc --version)?

    Mine is 4.8.4 (https://launchpad.net/gcc-arm-embedded/4­.8/4.8-2014-q3-update/+download/gcc-arm-­none-eabi-4_8-2014q3-20140805-linux.tar.­bz2) - I did notice something was up with Espruino compiles using the newer compiler a while back, but haven't had a chance to track it down.

  • Hi Gordon,

    [anthony@localhost blog]$ arm-none-eabi-gcc --version
    arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.9.3 20150529 (release) [ARM/embedded-4_9-branch revision 227977]
    Copyright (C) 2014 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

  • Yeah, sorry about that - I reckon that's your problem. I just checked and the compiler I had trouble with here was a 4.9. I'll update the docs.

    I have no idea what the problem is though - obviously it's pretty frustrating. Last time there was a problem like this it was actually some register accesses in ST's USB library that were put out of order (I'm still not convinced it wasn't a compiler bug).

  • Actually no, forget that - I just finished compiling with 4.9.3 20150529 - your exact version - and it works fine when built from Git commit 7b73952a8cbf285d3af3ccecb997afb755b019df­

    Potentially it's still a bit flaky though. I've just uploaded my build - maybe you could see if that works?


    1 Attachment

  • Hi Gordon,

    I tested the Attachment, it is still not working,maybe the board I'm using is different from yours.
    I will try Git commit 7b73952a8cbf285d3af3ccecb997afb755b019df­.

  • Oh - sorry, I've been stupid. That was an image for a pico board. I'll try one for a normal Espruino

  • And I was right originally I'm afraid. The 4.9 compiler doesn't compile for the Espruino board for some reason (USB ends up broken). If you use the 4.8.4 compiler I linked then it should work.

  • Hi Gordon,

    I tested 4.8.4 compiler,
    it is working now,
    Thank you very much!

  • Quick update on this - -O0 works but -O1 doesn't, so presumably it's one of the optimisations.

    However compiling without any optimisations sucks - you have to disable pretty much everything to get it to build. Until we find out what the issue is I think it's best to use the older compiler.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

compile and download to flash

Posted by Avatar for anthony @anthony

Actions