-
• #2
What device are you using? Bangle.js, or something else?
Honestly I'm not sure you're going to have much luck trying to force the Web IDE in to uploading a file - the file upload there is designed to use Storage.
The best solution is:
- Go to http://www.espruino.com/File+Converter
- Upload your file
- Choose
Base 64 Flash Write
as the mode - Copy the code from the text box
- Paste it into the REPL of the Web IDE
And you should be sorted!
If you want to automate it, it should be reasonably easy to mash the File Converter code together with the Web Bluetooth example at http://www.espruino.com/Web+Bluetooth to make a website that will upload directly
- Go to http://www.espruino.com/File+Converter
-
• #3
Thanks for your feedback.
I'll do as suggested,and I'm playing with a fitness tracker based board nrf52832 -
• #4
Which tracker? BTW beware that you also need to erase the memory before writing,the file converter generated code does not do it for you.
Here is another example that rewrites bootloader in DK08 smartwatch https://github.com/fanoush/ds-d6/blob/master/espruino/DFU/DK08/DK08-bootloader.txt
-
• #5
I'm sorry, i'm late! @fanoush Thx for your reminder, i had a LENOVO HX03, and spent some time to learn stuff, flash, page, pipe etc... and tested your dsd6 init file ;-) worked fine, lots of help!
And i found a problem will brick my device when i used the following code on Webide's left sides:
require("Flash").read(1,'0x60400000')
The log:>>> Sending... index.js:92927 ---> "require(\"Flash\").read(1,'0x60400000')" index.js:92927 >>> Sent index.js:92927 BT> SEND ERROR: NotSupportedError: GATT operation failed for unknown reason. index.js:92927 BT> Disconnected (gattserverdisconnected)
As the address '0x60400000' is not exist, may be ??
Fortunately, the lower battery ;-) you know.
-
• #6
There is nothing at that address, see https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/memory.html?cp=4_2_0_7#memory , that's why Espruino now uses 0x60000000 as offset to map external SPI flash there. However HX03 does not have any external SPI flash(?)
As for reading single value from memory memory there is also peek8,16,32
-
• #7
Also worth noting you should just use
require("Flash").read(1,0x60400000)
and notrequire("Flash").read(1,'0x60400000')
- so you don't need the quotes. -
• #8
Mixed up
0x
, thax!
Hi!
I want to upload a file (big binary) to extranal Flash at a specific start address (0x0000...) in Web Ide, and i don't want do this with File Storage.
Can i use these apis just like
require("Flash").write(data, addr)
andE.pipe(source, destination, options)
?Will this work?Can some one give how to do it?
thanks