-
• #2
Maybe you could strip this down to just one or two functions that exhibit the problem? And also check that is happens on one of our builds - preferably on one of our boards like the Pico.
If it says
WARNING: If specifying an object, it must be of the form {data : ..., count : N}
my guess somehow an object is getting passed into one of the functions (like write?)But actually my guess is you're building with an out of date firmware, and building for ESP8266 - I saw a regression that looked a bit like this yesterday and fixed it, and you might not have updated since then?
-
• #3
Here you are:
>f = new (require("FlashEEPROM"))(0x076000); ={ "flash": function () { [native code] }, "addr": 483328, "endAddr": 487424 } >f.read(1) =undefined >f.write(1, "hello") WARNING: If specifying an object, it must be of the form {data : ..., count : N} WARNING: If specifying an object, it must be of the form {data : ..., count : N} Uncaught Error: Function "set" not found! at line 1 col 123 ...int8Array(r.length+3&-4);a.set(r),r=a}return r.length&&this.... ^ in function "_write" called from line 1 col 289 ...ory!";this._write(r.end,t,e)} ^ in function "write" called from line 1 col 19 f.write(1, "hello") ^ >
As you might not see my edit in the previous post, the situation is the same with
git checkout tags/RELEASE_1V85
Edit
Same with current
git pull
-
• #4
Works fine for me on a Pico with 1v85...
>f.read(1) =undefined >f.write(1, "hello") =undefined >f.read(1) =new Uint8Array([104, 101, 108, 108, 111]) >0x076000 =483328
edit: moving this to ESP8266 - as this is not an issue with Espruino boards.
-
• #5
It's absolutely relevant with my build. How can I trace this issue? What am I doing wrong?
-
• #6
When you type
process.env.GIT_COMMIT
, what does it say?Out of interest, why exactly are you doing your own build? Don't the travis ones do what you need?
-
• #7
Well, I found the problem. I just forgot to rename new build folder after
git pull
. Nowprocess.env.GIT_COMMIT="498b9d4cc0f1fc5e0886c19a3b84ce64279aaf85"
and everything works great.The reason I build on my own is because both being able to do so, and keep up with your latest fixes :) Nothing related with a hack or something.
-
• #8
FYI: I moved these builds to a new repo: https://github.com/aktos-io/aktos-espruino-builds
-
• #9
Ok - however the absolute latest builds are automatically compiled and put online anyway.
- Travis (ESP8266 and others): http://www.espruino.com/binaries/travis/master/
- Original (built by a server here - for Pico and normal Espruino): http://www.espruino.com/binaries/git/commits/master/
- Travis (ESP8266 and others): http://www.espruino.com/binaries/travis/master/
-
• #11
@ceremcem
http://www.espruino.com/Reference#l_Flash_getFreerequire("flash").getFree()
This method returns an array of objects of the form {addr : #, length : #}, representing
contiguous areas of flash memory in the chip that are not used for anything.
-
• #12
Note that FlashEEPROM is smart enough that you can just leave the argument out, and it'll automatically use
require("flash").getFree()
-
• #14
I figured out the problem: It's all about my bundling script that uses uglifyjs where it drops
lastAddr
variable in FlashEEPROM by claiming "it's declared but not used". I changed appropriate flag of uglifyjs and all went ok.
A working code now outputs an error:
I built Espruino by myself from commit 3d4047bf4fe5ab52f7b583257e41eae24a7fc947.
EDIT
Situation is the same with
git checkout tags/RELEASE_1V85