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
reading storage is not working for boot from user2 #1507
Comments
Try a reset(1); That should intialise the storage area - the try the list and save |
@wilberforce thanks for this hint. It does not fix it. There is |
@MaBecker
This only happens if the addresses is in the first 1mb - otherwise remember that this works correctly for the user1.bin. There are some storage debug functions you can compile in - I would start turning those one to see what addresses are used for user1.bin and what address is used for user2.bin. |
Yep good point, just start to activate those |
@MaBecker |
Yep but targets/esp8266/jshardware.c has lots of commented os_printf() with bad formats |
This might be wirth a try when booting into user2:
|
Good point, but has no effect. still empty
JSF_START_ADDRESS is used when writing in it is defined in board py file for ESP8266_4MB it is 0x0CB000 So maybe reading back is get translated to a different addr/sector |
|
First of all 0x40200000 is used to map the active sector into memory, so it is sector 1 for user1 and sector two for user2. The location of save area is fixed and in sector 1 starting at 0x0CB000 for a ESP8266_4MB board.
and similar in but still not working when loading user2 @ 101000 |
Like to keep storage JSF_START_ADDRESS same for user1 and user2 to have one storage for both images. Storage.list() and Storage.write() work fine with some litte modifications because they use jshFlashRead() and jshFlashWrite() Storage.read() fails because it is implemented as memory based read which only works for user1. @gfwilliams Is there a smart way to make it use jshFlashRead() ? |
We could arrange that The LINUX code above in https://github.com/espruino/Espruino/blob/master/src/jsflash.c#L492 does do that, but it's pretty rough and could fail for large strings on a uC. I'd just allocate the string, use a small (64 byte?) buffer and read from flash in chunks. Only gotcha there is you could potentially save code to storage that'd work fine from user1, but would fail with out of memory when running from user2. Still, it's better than crashing :) |
Good point. Or user1 uses first segment and user2 uses the second. As I am not sure how many use this wiflash. So let me fixit, document it and close it :) |
Each userbin segment is using it's own storage area in the same segment. |
Nice job |
using wiflash to update user1 or user2 switches between boot images
like
or
a reboot jumps to run user1 @ 1000 or user2 @ 10100
when jump to run user1 @ 1000 ".wificfg" is available
and empty when jump to run user2 @ 101000
A new Wifi.save() does not fix this issue.
The text was updated successfully, but these errors were encountered: