New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
E.openFile() erroneously returns undefined #1768
Comments
I think this is to do with memory issues on ESP32. Basically FAT support on ESP32 uses massive (4k?) sectors to match the flash's page size, which means it has to allocate bags of memory each time you use a file. Sometimes memory gets fragmented and it just can't allocate those blocks. You could try |
That could be the cause if there are separate heaps for Espruino and the code Espruino is running. I compared the results of I used Storage until I found this example. The changes resulted in significant improvements to my project. Right now I have an ugly work around to the My previous web server based on Storage overcame problems that may have been consigned to history. Espruino has become a lot more stable and feature complete so I can probably do a much better job now. What would really be persuasive is if Storage supported streams. |
It'll be to do with memory fragmentation, not actual usage. If you use one of the cutting edge builds your problem might well go away - or at the very least you can use
There's now |
Looking at it, this seems like a duplicate of this issue: #1559 Again it would be super helpful if you could try on a cutting edge firmware. |
Good point.
Well, that'll be an addition to my jobs list then 👍
I will get back to you. Thank you for your time on this. |
@opichals Thanks. Useful to know. |
I downloaded http://www.espruino.com/binaries/travis/master/espruino_2v04.384_esp32.tgz and flashed my board. The flash succeeded but I get the below error when the board boots. After the first failed attempt, I read README_flash.txt which showed me that I should have included some additional parameters to what I have been using up until now (baud, flash_mode and flash_freq). I made the changes to my bash script that I use to flash the Espruino but I got the same result.
|
Looks like due to whatever reason, the binary became bigger and bigger.
Therefore it does not fit anymore into partition.
Looking into past versions, there is a big step from 2v00(1.1mb) to
2v01(1.3mb)
Up to 2v04 size is still ok for partition size
But in master size grows by another 11kb and this is the mysterious drop
which causes an overflow
Am Fr., 6. März 2020 um 12:23 Uhr schrieb DVR Ltd <notifications@github.com
…:
@gfwilliams <https://github.com/gfwilliams>
I downloaded
http://www.espruino.com/binaries/travis/master/espruino_2v04.384_esp32.tgz
and flashed my board. The flash succeeded but I get the below error when
the board boots.
After the first failed attempt, I read README_flash.txt which showed me
that I should have included some additional parameters to what I have been
using up until now (baud, flash_mode and flash_freq). I made the changes to
my bash script that I use to flash the Espruino but I got the same result.
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:2668
load:0x40078000,len:7304
load:0x40080000,len:5312
entry 0x40080274
E (523) esp_image: Image length 1377632 doesn't fit in partition length 1376256
E (523) boot: Factory app partition is not bootable
E (524) esp_image: image at 0x160000 has invalid magic byte
E (529) boot: OTA app partition slot 0 is not bootable
E (534) boot: No bootable app partitions in the partition table
Fatal exception (0): IllegalInstruction
epc1=0x400802ba, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1768?email_source=notifications&email_token=AAPYNHVQYNQO322SXBSXZMTRGDMKXA5CNFSM4LBFBBMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOBAZZY#issuecomment-595725543>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAPYNHU5O7QFDH7OTOL6VODRGDMKXANCNFSM4LBFBBMA>
.
|
There is a big raise in size of ESP32-apps from esp-idf V3.0 to V3.1
By date this matches to change in binary size of espruino dor ESP32
To put some more water into wine, esp-idf V3.3 is even larger.
And after first steps to get Espruino running with esp-idf V4.0, looks like
size raise more and more.
Generally V4.0 includes lots of changes.
Will we get the job done ? Right now I don't know.
Am Fr., 6. März 2020 um 12:23 Uhr schrieb DVR Ltd <notifications@github.com
…:
@gfwilliams <https://github.com/gfwilliams>
I downloaded
http://www.espruino.com/binaries/travis/master/espruino_2v04.384_esp32.tgz
and flashed my board. The flash succeeded but I get the below error when
the board boots.
After the first failed attempt, I read README_flash.txt which showed me
that I should have included some additional parameters to what I have been
using up until now (baud, flash_mode and flash_freq). I made the changes to
my bash script that I use to flash the Espruino but I got the same result.
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:2668
load:0x40078000,len:7304
load:0x40080000,len:5312
entry 0x40080274
E (523) esp_image: Image length 1377632 doesn't fit in partition length 1376256
E (523) boot: Factory app partition is not bootable
E (524) esp_image: image at 0x160000 has invalid magic byte
E (529) boot: OTA app partition slot 0 is not bootable
E (534) boot: No bootable app partitions in the partition table
Fatal exception (0): IllegalInstruction
epc1=0x400802ba, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1768?email_source=notifications&email_token=AAPYNHVQYNQO322SXBSXZMTRGDMKXA5CNFSM4LBFBBMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOBAZZY#issuecomment-595725543>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAPYNHU5O7QFDH7OTOL6VODRGDMKXANCNFSM4LBFBBMA>
.
|
Pretty sure the build is working again now - and up to date builds have a lot of changes to cope with fragmentation so I think this is fixed |
Hi,
I'm experiencing a problem with E.openFile() returning undefined instead of the expected File object.
I am using Espruino v2.04 on an ESP-WROOM-32.
The problem is more common when I am expecting Espruino to do more. For example, when in addition to my application I invoke a file transfer module for getting files onto the ESP32s file system via Serial3, the likelihood of
E.openFile()
returningundefined
significantly increases. The module does not do anything unless data is sent to the ESP32. Merely having the self contained module loaded affects the problem.Calling
process.memory()
reduces the number of failures but the problem is not related to heap memory usage. Data to back up this statement available.The code below will replicate the problem. There is usually a run of success before failures so it may take a minute.
Although having a large number of timeout loops is quite different to my application, it reliably replicates the problem I am experiencing without attaching hardware to serial ports. My application serves a web interface (the files are being opened to respond to HTTP requests) and communicates with a device on Serial2. It has a main loop that must be continually run without blocking the main thread. This is achieved using
setTimeout(main, 1);
at every exit point ofmain()
.Any ideas how to locate the cause of the problem appreciated.
Regards,
Gary
The text was updated successfully, but these errors were encountered: