-
• #2
great!
-
• #3
Updated a Pico to 1v88, with the new editor.
I tested the first example in the released.I had to put {} in the for loop, and it show faults in the right editor
1 Attachment
-
• #4
Yes - the editor itself isn't expecting any ES6 functionality. That was updated on GitHub today (so wouldn't be in the version that you have to test with). Espruino itself should be fine though.
-
• #5
Talking about promises, I just got this error message:
Uncaught Error: Unhandled promise rejection: Error: Function "b" not found!
Does it means that we absolutely need at anytime to give both resolve AND reject callbacks?
Is it possible that it worked with 1v87.XXX but not anymore with 1v88 ? -
• #6
@Jean-Philippe_Rey what code did you paste in? The character
b
isn't even in the example code, so I guess you tried some different code?new Promise((resolve,reject) => { resolve("Wohoo!"); }).then( a => { console.log(a); });
-
• #7
@Gordon I tried the method
getStatus()
of the module RN2483 (LoRa)
https://github.com/espruino/EspruinoDocs/blob/master/devices/RN2483.js#L61>lora.getStatus() ["sys get hweui\r\n" =undefined ] "AAAAAAA" <--- "AAAAAAA" ] "AAAAAAAAAAAAAAAA\r\n" <--- "AAAAAAAAA\r\n" ["sys get vdd\r\n" ] "3" <--- "3" ] "3233\r\n" <--- "233\r\n" ["mac get appeui\r\n" ] "0" <--- "0" ] "00000000000000" <--- "0000000000000" ] "0000000000000000\r\n" <--- "00\r\n" ["mac get deveui\r\n" ] "0" <--- "0" ] "AAAAAAAAAAAAA" <--- "AAAAAAAAAAAA" ] "AAAAAAAAAAAAAAA\r\n" <--- "AA\r\n" ["mac get band\r\n" ] "8" <--- "8" ] "868\r\n" <--- "68\r\n" ["mac get dr\r\n" ] "5" <--- "5" ] "5\r\n" <--- "\r\n" ["mac get rxdelay1\r\n" ] "1" <--- "1" ] "1000\r\n" <--- "000\r\n" ["mac get rxdelay2\r\n" ] "2" <--- "2" ] "2000\r\n" <--- "000\r\n" Uncaught Error: Unhandled promise rejection: Error: Function "b" not found! >
-
• #8
It's because it got right to the end of
lora.getStatus()
and tried to call the callback function, which doesn't exist because you didn't specify it.Try
lora.getStatus(console.log)
:)Unfortunately the module gets minified, so what would have been a helpful variable name like
callback
just gets turned intob
... -
• #9
ooooh that's totally true. I ever forget to give it the callback :-/ sorry for wasting your time with such beginners issues...
-
• #10
No problem - you had me panicked for a while ;)
-
• #11
Flashed the 1v88 version onto several original Espruino 1.3 boards resulting in just the red LED on reset.
One worked on reset but reverted to the red LED when powered down and then back up again.I tried it with both the web IDE and command line.
1v87 works on all the boards.
1v88 works fine on the PicosJamie
-
• #12
Ok, thanks for letting me know - I'd tested it quite recently, but obviously not with the release version! I'll see if I can get that sorted tonight.
edit: That's a really odd bug- as you said, just tried here and my board worked great at first, even after a reset - but failed after a power off and on. It possibly explains why it passed the quick test I did before releasing.
-
• #13
Ok, try again now. I've found the problem and updated the Original Espruino's image with the fix.
Turns out it was to do with the Low Speed oscillator. The F1 behaves very slightly differently to the F4, and the startup code got stuck waiting for the RTC to initialise - unfortunately if you previously had a good firmware on the device then when you put the new one on everything will keep working until you power it off (as the RTC is already set up).
-
• #14
That did it.
I initially assumed the board wasn't getting updated properly as one did work.
Just for reference; there is a 32.768kHz crystal on the original Espruino boards I tried.Excellent work. Thanks Gordon.
-
• #15
Further to this; after leaving the boards powered down for some time they again did not reset properly.
As mentioned I have 32.768kHz crystals connected to these three boards but I do not have the 12pF caps mounted since they all worked fine without them.
However, if I hold my finger over the 32.768kHz crystal leads they do reset properly and also reset properly if left powered after the initial successful boot.
So it seems they may now require the capacitors. I will update this post when I dig up some appropriate caps.
-
• #16
after leaving the boards powered down for some time they again did not reset properly.
...even with the new firmware? and it was fine on the older firmware?
I've tried on the 1v4 boards and they seem fine (crystal + capacitors). It's possible that without capacitors the oscillator ran for a bit and then stopped, and it's causing that function to get stuck somewhere else waiting for the RTC to respond.
-
• #17
Do you have any advice for building these on windows using Vagrant for the NRF52832DK? I have tried out the current vagrant setup but believe the version of arm-none-eabi-gcc it installs in the provision.sh script may not be compatible with the current master branch?
https://github.com/espruino/Espruino/blob/master/scripts/provision.sh
From what I can tell based on this link:
https://travis-ci.org/espruino/Espruino/jobs/175343830you are building with the current version:
arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 5.4.1 20160919 (release) [ARM/embedded-5-branch revision 240496]Right now on gcc-arm-none-eabi-4_9-2015q1 it mostly works but fails at the end with this:
GEN espruino_1v88.180_nrf52832.lst GEN espruino_1v88.180_nrf52832.hex Merging SoftDevice scripts/hexmerge.py /vagrant/targetlibs/nrf5x/components/softdevice/s132/hex/s132_nrf52_3.0.0_softdevice.hex espruino_1v88.180_nrf52832.hex -o tmp.hex make: scripts/hexmerge.py: Command not found make: *** [espruino_1v88.180_nrf52832.hex] Error 127
-
• #18
@Gordon
Yes, even with the new firmware.
I've tried it with 7pF caps on (the closest I have at the moment) with the same result.Espruino 1v87 (using the binary from the website) has started up fine so far after numerous unpluggings etc. It reverts to start up problems when 1v88 is flashed on again.
Also, with 1v88 loaded the web ide has trouble connecting:
something like "Can't find STM bootloader"Edit: An Espruino 1.3 without a crystal works fine with 1v88.
-
• #19
With 1v87 it appears that holding my finger on the crystal leads actually STOPS the LSE from starting up, possibly because it does not detect the crystal.
With 1v88 it seems to detect the crystal and attempts to use the LSE even though it hasn't started up.
Checked with peek32(0x40021020), RCC_BDCR register, after reset.
-
• #20
Okay I figured out my own problem :)
on line 2080 of makefile@echo FIXME - had to set --overlap=replace python scripts/hexmerge.py --overlap=replace $(SOFTDEVICE) $(NRF_BOOTLOADER) $(PROJ_NAME).hex -o tmp.hex
and line 2086 of makefile
python scripts/hexmerge.py $(SOFTDEVICE) $(PROJ_NAME).hex -o tmp.hex
I had to add the "python" preface which was missing before the call to hexmerge.py - this fixed the merging problem.
Also to fix the vagrant setup problems I changed the provision.sh by adding the top three lines and commenting out the lower ones.
sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa sudo apt-get update sudo apt-get install gcc-arm-embedded # download known working version of arm-none-eabi-gcc [#sudo](https://forum.espruino.com/search/?q=%23sudo) mkdir ~/gcc-temp [#cd](https://forum.espruino.com/search/?q=%23cd) ~/gcc-temp [#sudo](https://forum.espruino.com/search/?q=%23sudo) wget 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 [#cd](https://forum.espruino.com/search/?q=%23cd) /usr/local [#sudo](https://forum.espruino.com/search/?q=%23sudo) tar xjf ~/gcc-temp/gcc-arm-none-eabi-4_8-2014q3-20140805-linux.tar.bz2 # apply setup config to add compiler to PATH # from stackoverflow i.e http://stackoverflow.com/a/28279205
I also edited the vagrant_setup.sh to include the correct path to new version of gcc-arm-embedded
export PATH="$PATH:/usr/local/gcc-arm-embedded/bin/"
I am not sure this is all correct but when I upload hex files for the NRF52832DK they now show up as bluetooth devices and some basic commands work :)
You can see the changes on my fork of Espruino here https://github.com/espruino/Espruino/compare/master...clowrey:master
-
• #21
@hilo90mhz Thanks for that - looks like vagrant probably hasn't been used in a while (I think most people just build directly on Linux)
@jlawson strange - there was another change in there that I can remove as well. I'll give it a try on some 1v3 boards here.
-
• #22
Ok, I've just produced a new build (It'll be at http://www.espruino.com/binaries/git/commits/b4edf13c51c825ca8ed032d7e31dec7a2759a20f within the hour). Could you try that? I've just removed all the RTC code changes that were there for the F1, so all being well it should behave exactly the same as 1v87.
-
• #24
Ahh - thanks for letting me know - looks like after the server move my build machine stopped uploading the builds. Hopefully it'll be fixed soon.
There's a regression in 1v88 I found today that I'd like to get fixed, so I'll push out a proper 1v89 build soon anyway I think.
-
• #25
@Gordon, for an original Espruino board (v1.4b) running 1v89, code entered right after a reset of an example right out of Mozilla Developer Network Arrow Function page ...
var max=(a,b)=>(a>b)?a:b; max; // returns function (b) { native code } max(4,6); // hangs indefinitely???
Hangs, and usually eventually generates an out of memory error message.
function max(a,b) { return (a>b)?a:b; }; // works fine
This one's a massive release - containing a whole raft of improvements that were originally developed for Puck.js - which will be going into production early next week!
You can check out a full list of improvements here but in summary - and with a bit more info:
ES6 additions
ES6 Template Literals - the following kind of stuff now works, so could really tidy up service webpages:
ES6 Arrow Functions - this'll keep a lot of JS developers happy too. For instance:
Promises now work pretty well too, and are used in Puck.js's BLE Central Mode API. Chaining works great, as does catching exceptions thrown inside promises. They even work with arrow functions:
(Sadly none of the above made it to the micro:bit, as it's just too short on Flash/RAM at the moment. They're in the Original Espruino, Pico, Wifi, and Puck.js though)
Improvements
opendrain_pullup
(so no resistor is needed for short runs on OneWire now)E.lockConsole()
for use withE.setPassword()
save()
anddump()
now keep track of whether pin mode had been forced or notfs.readFile
(andFile.read
) now use Flat Strings to allow more memory efficient readsnew Bob() => "Bob {}"
process.on(
uncaughtException, ...)
to catch exceptions along with the exact place in code that they happenedFixes
E.dumpLockedVars()
in non-release builds to help debug memory leaks in librariesSo loads of stuff... Sadly I had to remove the VGA/TV output from the Original Espruino to make room for it. It's still in Pico/WiFi boards though - let me know if you were using it on the Original board and I'll see what I can do to get it back in (however I don't think it has ever been used!).
There'll also be a new Web IDE release coming soon too.