-
• #27
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. -
• #28
On the other hand, nucle0 boards are incredibly cheap and provide lots of connectivity...
-
• #29
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!
-
• #31
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 -
• #32
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?
-
• #33
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_COMMIT":"d19c544b8a0e247524f41bf490fee7eb03fb387c","BOARD":"NUCLEOF401RE","CHIP":"STM32F401RET6","CHIP_FAMILY":"STM32F4","FLASH":524288,"RAM":98304,"SERIAL":"56005b00-0b513333-37343534","CONSOLE":"Serial2","EXPORTS":{"jsvLock":6661,"jsvLockAgainSafe":6625,"jsvUnLock":6573,"jsvSkipName":193093,"jsvMathsOp":17313,"jsvMathsOpSkipNames":115589,"jsvNewFromFloat":202021,"jsvNewFromInteger":202089,"jsvNewFromString":33209,"jsvNewFromBool":202045,"jsvGetFloat":79457,"jsvGetInteger":193809,"jsvGetBool":139461,"jspeiFindInScopes":93809,"jspReplaceWith":178577,"jspeFunctionCall":171857,"jspGetNamedVariable":89277,"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_COMMIT":"d19c544b8a0e247524f41bf490fee7eb03fb387c","BOARD":"NUCLEOF401RE","CHIP":"STM32F401RET6","CHIP_FAMILY":"STM32F4","FLASH":524288,"RAM":98304,"SERIAL":"56005b00-0b513333-37343534","CONSOLE":"Serial2","EXPORTS":{"jsvLock":6661,"jsvLockAgainSafe":6625,"jsvUnLock":6573,"jsvSkipName":193093,"jsvMathsOp":17313,"jsvMathsOpSkipNames":115589,"jsvNewFromFloat":202021,"jsvNewFromInteger":202089,"jsvNewFromString":33209,"jsvNewFromBool":202045,"jsvGetFloat":79457,"jsvGetInteger":193809,"jsvGetBool":139461,"jspeiFindInScopes":93809,"jspReplaceWith":178577,"jspeFunctionCall":171857,"jspGetNamedVariable":89277,"jspGetNamedField":58009,"jspGetVarNamedField":57625,"jsvNewWithFlags":197489}}>>>>> =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_COMMIT":"8e1efcf898350a290242d732631be15c36f53381","BOARD":"NUCLEOF401RE","CHIP":"STM32F401RET6","CHIP_FAMILY":"STM32F4","FLASH":524288,"RAM":98304,"SERIAL":"56005b00-0b513333-37343534","CONSOLE":"Serial2","EXPORTS":{"jsvLock":13789,"jsvLockAgainSafe":13777,"jsvUnLock":13753,"jsvSkipName":82997,"jsvMathsOp":50761,"jsvMathsOpSkipNames":128593,"jsvNewFromFloat":156705,"jsvNewFromInteger":157117,"jsvNewFromString":158673,"jsvNewFromBool":157045,"jsvGetFloat":59457,"jsvGetInteger":84653,"jsvGetBool":86897,"jspeiFindInScopes":159837,"jspReplaceWith":86581,"jspeFunctionCall":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_COMMIT":"8e1efcf898350a290242d732631be15c36f53381","BOARD":"NUCLEOF401RE","CHIP":"STM32F401RET6","CHIP_FAMILY":"STM32F4","FLASH":524288,"RAM":98304,"SERIAL":"56005b00-0b513333-37343534","CONSOLE":"Serial2","EXPORTS":{"jsvLock":13789,"jsvLockAgainSafe":13777,"jsvUnLock":13753,"jsvSkipName":82997,"jsvMathsOp":50761,"jsvMathsOpSkipNames":128593,"jsvNewFromFloat":156705,"jsvNewFromInteger":157117,"jsvNewFromString":158673,"jsvNewFromBool":157045,"jsvGetFloat":59457,"jsvGetInteger":84653,"jsvGetBool":86897,"jspeiFindInScopes":159837,"jspReplaceWith":86581,"jspeFunctionCall":175133,"jspGetNamedVariable":124777,"jspGetNamedField":42141,"jspGetVarNamedField":87629,"jsvNewWithFlags":156473}}>>>>> =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.
-
• #34
One more detail, the compiler doesn't work apparently with the Nucleo.
-
• #35
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
to00 80 01 20 AD D2 02 08
(so the 8th byte from00
to08
) - Try and flash again with the mbed bootloader and see if it works?
- Open up the official firmware I linked
-
• #36
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...
-
• #37
@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
-
• #38
@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... -
• #40
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...
-
• #41
@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.
-
• #42
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
-
• #43
Thanks for letting me know... And your board came with that firmware on it as well?
-
• #44
No.
I updated to this firmware with st's firmware upgrade tool (java version).
Don't remember what the original firmware version was. -
• #45
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. -
• #46
Thanks - I've filed an issue for it now: https://github.com/espruino/Espruino/issues/742
-
• #47
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 -
• #48
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.
-
• #49
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 -
• #50
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.
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!