Help running espruino on the F401 Nucleo

Posted on
Page
of 3
Prev
/ 3
Next
  • And furthermore, mbed recompiled bin do flash correctly by drag and drop, while olders don't.
    The bin's found on Dr Azzy web site flash only through st-link utility. On the other hand, they work!

  • Ah, interesting constraints.
    I've also been reading similar issues as you point out. The whole ST-Link thing is really a complete disaster, IMHO.

  • On the other hand, nucle0 boards are incredibly cheap and provide lots of connectivity...

  • Hmm, interesting.

    Could you use a hex editor and write the first 8 bytes of a bin file that works and one that doesn't? If they're hex files, just the second line would be enough.

    This would be really frustrating. Flash memory is mapped to both 0x00000000 and 0x08000000 - so both addresses are valid. Espruino uses a reset vector at 0x00000000 because it sometimes produces smaller code, but it's possible that some idiot at ST has changed their bootloader so that you can ONLY upload code that runs from 0x08000000!

  • @Gordon,
    I think they have to be able to add new features and processors which implies some compatibility issues.
    Will check those bytes soon

  • So here are some hexdump of various files: Apparently, the code coming from mbed online compiler is different from the one obtained by @DrAzzy on the espruino build as it places the second vector at $08xxxxxx while espruino places it at 0x20xxxxxx.

    Compiled on Filename Hexdump
    13 October 2014 ds18b20_test_NUCLEO_F401RE.bin 00 80 01 20 b1 01 20 08 b9 01 20 08 bb 01 20 08 bd 01 20 08 bf 01 20 08 c1 01 20 08 20 20 20 20
    18 October 2015 espruino_1v81.79_nucleof401re.bin 00 80 01 20 d9 2a 03 20 55 24 03 20 51 24 03 20 4d 24 03 20 41 24 03 20 3d 24 03 20 20 20 20 20
    18 October 2015 get_serial_number_NUCLEO_F401RE.bin 00 80 01 20 b1 01 20 08 b9 01 20 08 bb 01 20 08 bd 01 20 08 bf 01 20 08 c1 01 20 08 20 20 20 20

  • Have you tried the proper Espruino build from the website download page?

    I just checked and it's:

    00 80 01 20 AD D2 02 00
    

    Which is at least not a RAM address?

    It could just be that there's something up with @DrAzzy's builds?

  • Well, that one flashed correctly and run only through st-link, never by drag and drop.
    So I didn't checked further...
    The official one did not flash through the standard copy/paste under windows 8.1 64 bits.
    That said, it flashed using st-link utility and runs from the web ide.

    Screen capture with both @DrAzzy and official Espruino for NucleoF401RE board.

    Connected
    >
    =undefined
    >echo(0);
    <<<<<{"VERSION":"1v81.79","BUILD_DATE":"­Oct 18 2015","BUILD_TIME":"00:27:36","GIT_COMMI­T":"d19c544b8a0e247524f41bf490fee7eb03fb­387c","BOARD":"NUCLEOF401RE","CHIP":"STM­32F401RET6","CHIP_FAMILY":"STM32F4","FLA­SH":524288,"RAM":98304,"SERIAL":"56005b0­0-0b513333-37343534","CONSOLE":"Serial2"­,"EXPORTS":{"jsvLock":6661,"jsvLockAgain­Safe":6625,"jsvUnLock":6573,"jsvSkipName­":193093,"jsvMathsOp":17313,"jsvMathsOpS­kipNames":115589,"jsvNewFromFloat":20202­1,"jsvNewFromInteger":202089,"jsvNewFrom­String":33209,"jsvNewFromBool":202045,"j­svGetFloat":79457,"jsvGetInteger":193809­,"jsvGetBool":139461,"jspeiFindInScopes"­:93809,"jspReplaceWith":178577,"jspeFunc­tionCall":171857,"jspGetNamedVariable":8­9277,"jspGetNamedFie
    Connected
    >ld":58009,"jspGetVarNamedField":57625,"­jsvNewWithFlags":197489}}>>>>>
    =undefined
    =undefined
    >echo(0);
    <<<<<{"VERSION":"1v81.79","BUILD_DATE":"­Oct 18 2015","BUILD_TIME":"00:27:36","GIT_COMMI­T":"d19c544b8a0e247524f41bf490fee7eb03fb­387c","BOARD":"NUCLEOF401RE","CHIP":"STM­32F401RET6","CHIP_FAMILY":"STM32F4","FLA­SH":524288,"RAM":98304,"SERIAL":"56005b0­0-0b513333-37343534","CONSOLE":"Serial2"­,"EXPORTS":{"jsvLock":6661,"jsvLockAgain­Safe":6625,"jsvUnLock":6573,"jsvSkipName­":193093,"jsvMathsOp":17313,"jsvMathsOpS­kipNames":115589,"jsvNewFromFloat":20202­1,"jsvNewFromInteger":202089,"jsvNewFrom­String":33209,"jsvNewFromBool":202045,"j­svGetFloat":79457,"jsvGetInteger":193809­,"jsvGetBool":139461,"jspeiFindInScopes"­:93809,"jspReplaceWith":178577,"jspeFunc­tionCall":171857,"jspGetNamedVariable":8­9277,"jspGetNamedField":58009,"jspGetVar­NamedField":57625,"jsvNewWithFlags":1974­89}}>>>>>
    =undefined
    >reset();
    =undefined
     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v81.79 Copyright 2015 G.Williams
    >Loading -134610944 bytes from flash...
    >
    Disconnected
    >
    Connected
    >
    =undefined
    >echo(0);
    <<<<<{"VERSION":"1v81","BUILD_DATE":"Oct­  8 2015","BUILD_TIME":"16:05:33","GIT_COMMI­T":"8e1efcf898350a290242d732631be15c36f5­3381","BOARD":"NUCLEOF401RE","CHIP":"STM­32F401RET6","CHIP_FAMILY":"STM32F4","FLA­SH":524288,"RAM":98304,"SERIAL":"56005b0­0-0b513333-37343534","CONSOLE":"Serial2"­,"EXPORTS":{"jsvLock":13789,"jsvLockAgai­nSafe":13777,"jsvUnLock":13753,"jsvSkipN­ame":82997,"jsvMathsOp":50761,"jsvMathsO­pSkipNames":128593,"jsvNewFromFloat":156­705,"jsvNewFromInteger":157117,"jsvNewFr­omString":158673,"jsvNewFromBool":157045­,"jsvGetFloat":59457,"jsvGetInteger":846­53,"jsvGetBool":86897,"jspeiFindInScopes­":159837,"jspReplaceWith":86581,"jspeFun­ctionCall":175133,"jspGetNamedVariable":­124777,"jspGetNamedFi
    Connected
    >eld":42141,"jspGetVarNamedField":87629,­"jsvNewWithFlags":156473}}>>>>>
    =undefined
    >echo(0);
    <<<<<{"VERSION":"1v81","BUILD_DATE":"Oct­  8 2015","BUILD_TIME":"16:05:33","GIT_COMMI­T":"8e1efcf898350a290242d732631be15c36f5­3381","BOARD":"NUCLEOF401RE","CHIP":"STM­32F401RET6","CHIP_FAMILY":"STM32F4","FLA­SH":524288,"RAM":98304,"SERIAL":"56005b0­0-0b513333-37343534","CONSOLE":"Serial2"­,"EXPORTS":{"jsvLock":13789,"jsvLockAgai­nSafe":13777,"jsvUnLock":13753,"jsvSkipN­ame":82997,"jsvMathsOp":50761,"jsvMathsO­pSkipNames":128593,"jsvNewFromFloat":156­705,"jsvNewFromInteger":157117,"jsvNewFr­omString":158673,"jsvNewFromBool":157045­,"jsvGetFloat":59457,"jsvGetInteger":846­53,"jsvGetBool":86897,"jspeiFindInScopes­":159837,"jspReplaceWith":86581,"jspeFun­ctionCall":175133,"jspGetNamedVariable":­124777,"jspGetNamedField":42141,"jspGetV­arNamedField":87629,"jsvNewWithFlags":15­6473}}>>>>>
    =undefined
    >reset();
    =undefined
     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v81 Copyright 2015 G.Williams
    > 
    
    

    So it seams to be a problem just with those restrictions mentionned above by ST.

  • One more detail, the compiler doesn't work apparently with the Nucleo.

  • It is probably because the IDE times out waiting for the process.env data at 9600 baud.

    @asez73 since you have a hex editor running, could you just:

    • Open up the official firmware I linked
    • Change 00 80 01 20 AD D2 02 00 to 00 80 01 20 AD D2 02 08 (so the 8th byte from 00 to 08)
    • Try and flash again with the mbed bootloader and see if it works?
  • This is all going over my head. I know I have been able to flash working Espruino binaries via drag and drop.

    I don't see how my builds could be different - I think I'm using the same compiler version and build process as the official nucleo builds. Unless @Gordon changed the compiler version at some point?

    Basically, I have no clue how to fix my builds...

  • @Gordon, it worked. The official and "shifted to 0x80 8th byte" did flash immediatly by copy/paste to my D: drive.
    I edited the official file using directly ST-link utility which allow to change a byte and save as a new file the .bin opened.

    About the compiler there is an error message in the webide, I will look at it later, so far no problem.


    1 Attachment

    • Capture2.PNG
  • @DrAzzy, It also is a bit over my head...
    You, probably, did not upgraded your firmware and other things since a year which makes it invisible to you. I could flash by drag and drop before upgrading, see above.
    Anyway, things are getting clearer now: ST silently added some constraints, while updating everything, that are incompatible with the linker parameters setup in some makefile of Espruino.
    On a mid to long term basis, I think we are condamned to follow ST about this kind of change.
    Now I don't really understand why you have a different version of Espruino. Except for you use the latest version while the official one is 1v81 so...

  • @Gordon, the compiler emits an error message that looks like:
    "Compiler not active as no process.env.EXPORTS available... Are you sure you upgraded to the latest firmware".

  • My script syncs the github repo and calls the usual build script - so it should come out the same as the official ones, I would think...

  • @asez73 - yes, the compiler issue is because the Web IDE couldn't get into about the board (and why you get the rubbish in the console when you connect) - I'll have to increase the time it waits for a reply.

    @DrAzzy I'm not sure why your build would be different - it's actually pretty hard to believe. Things would have to be drastically different to relocate all that stuff into RAM - and it just wouldn't work.

  • confirming that st-flash works but not drag & drop

    details :
    OS X 10.11.1
    ST-LINK firmware: V2J24M11
    stlink 1.1.0 (installed via homebrew)
    espruino 1v81
    flash command:

    st-flash write espruino_1v81_nucleof401re.bin 0x08000000
    
  • Thanks for letting me know... And your board came with that firmware on it as well?

  • No.
    I updated to this firmware with st's firmware upgrade tool (java version).
    Don't remember what the original firmware version was.

  • Hi all,
    Just to mention that, on Ubuntu also, the Espruino interpreter for Nucleo needs the same modification to flash it from it's original binary file.
    The Nucleo's firmware has been updated to 2VJ25M13 and there is no improvement on this point so far.
    That is just set the 8th byte to 0x08 in Espruino's binary file.
    Then drag and drop it to your Nucleo device folder to flash.

  • Thanks - I've filed an issue for it now: https://github.com/espruino/Espruino/iss­ues/742

  • Hi all;
    I am not sure if this is the best thread for this question but here it goes. Do any of the Nucleo builds have the on board USB enabled. I threw together a quick and dirty wiring harness to grab A12 an A11 off the morpho connector (with the pull up to DP) but cannot get anything to print to the USB port. All my attempts at writing to the USB come back with "undefined" error messages.
    With respect to the discussion above; I have been using ST Link to load Espruino on the non-official boards successfully for a while. However, with the last ST-Link firmware upgrade doing loads from my XP box became unreliable; ST-link loads from Win7 continue to work well. The mass storage loads have never been reliable for me.
    Chris Z

  • The F401 builds are not built with USB support enabled, neither Gordon's nor my nightlies. I think the decision was made because the board did not break out the pins to a USB connector. You could try building the firmware yourself with that enabled though, and seeing if it worked.

    I downgrade the STLink firmware on my Nucleos so drag+drop works again.

  • DrAzzy
    Thank you for the reply; its good to know which thing not to chase sometimes. I assume that making sure the board is not running at 16 MHz will also be critical to getting the USB working correctly. My goal is to get something running with an "Arduino Yun Shield" that is gathering dust; this requires that the serial port be on the shield connector rather than the ST-Link side. Trying to have a functional USB console after moving the jumpers around. Time to bite the bullet and set up a build environment.
    Chris Z

  • Hi @user6546,
    So, the port of Espruino to the Nucleo F401RE doesn't need the USB functionality mainly because it has an equivallent USB connection through the ST-Link v2 integrated one. This makes it an mbed compatible board.
    As a result, the USB port is under control of the ST-link and seen from Espruino's side as a serial port...

    The various difficulties, mentionned above, are just about flashing Espruino on a Nucleo board. They do not impact the functionnalities under Espruino.

    That said, it could be interesting to have the usb available on this board as it is OTG on the STM32F4.
    I think getting USB to work would need to break apart the ST-link board thus freeing the serial port used, design some accessory board providing the correct STM32F4 pins as well as a steady 5V power supply and the proper USB connector. Just to add, some HSI or LSI are provided by the ST-link part to the Nucleo, this is to consider too, specially for USB.
    On the Espruino interpreter side, you will have to reconfigure the serial link used with the ST-link part and let it behave as a USB port. The Pico is doing so but that's to be carefully studied as there is no bootloader in the Nucleo board port of Espruino.

    Quite a lot of work actually, specially compared to the Pico beeing readily available.

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

Help running espruino on the F401 Nucleo

Posted by Avatar for Rob @Rob

Actions