-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Upgrade to SDK 3.0 -- update 1 #2689
Comments
One of the challenges of this patch is that it touches so much of the project -- for example we will need to tweak our builds and change documentation as well as the core functional changes. I will raise a PR which focuses on the core components so that other committers and testers can evaluate this. If any of these contributors want to add supplemental commits, then just ask and I will give you push rights to my fork. |
I am ready to offer some of my time to test this long awaited feature as I believe it will be a game changer as far as freeing the RAM needed for some important usecases. In my case, it will be easier when the changes are submitted in dev branch for me to test it. |
Yup but quite a few members do there builds from |
I and maybe others could do a build or two. |
I was trying to test this patch on ESP8285 but I couldn't get it to work. I changed
But the only thing that comes from UART when I reset the board (Wemos D1 mini) is:
I tested various flash modes and I don't think that's the reason for it. I'm quite sure that those parameters are wrong. Because I enabled SSL support firmware is quite big
but should fit on 1MB flash. On other ESP8266 with 4MB of flash everything works. If anyone has 1MB ESP8266 or ESP8285 and tested new SDK on it I would be really glad to see how. |
I'll do the proper PR today or tomorrow. Sorry guys, but I've been a bit poorly, and this has hit my ability to do useful work. The committers know the backstory. 😒 What we are doing is to remove the SPIFFS and LFS defines in |
This 1st cut of the SDK 3.0 release has now been released into |
Thanks @TerryE so much ! Looking forward to play with the latest dev build! So excited to test it out and see how it solves some of my current pain points & usecases. Will report any issues (if any)... |
Remember to use the |
I am unable to build from dev branch. Tried both the docker and the online https://nodemcu-build.com/ methods. Am I doing something wrong ? The docker method resulted in:
The online build method resulted in:
|
@dtran123 quite possibly not. The make works in a linux environment, but adding the PT has changed what is configured through This sort of thing can happen after such a change. That's why we do the push immediately after a dev->master drop so the fall back is to use the |
@dtran123 what was the Travis build number for the failed build (something like #25nnnn) so I can see detailed log and see why it failed? Thanks |
How do I check the Travis build number ? The "failed build" email doesn't share any build number. |
The date timestamp of the email would help. Thanks |
I tried 3 times before abandoning... I guess the nodemcu automated build system should probably add the Travis build number to help future troubleshooting. |
The cloud builder is now handling this correctly. Sorry the changes were merged before the dev-friendly tools were ready for them. |
Thanks. It works now. Will be testing this new build in the next few days... NodeMCU custom build by frightanic.com
Communication with MCU... NodeMCU firmware detected. |
It is even more with LFS including |
I've gone through this with Marcel offline on a 1-1 and we have decided that we should not mandate the use of the partition tool. To this end, I will be raising a follow up PR to add the functions |
I welcome this idea very much. This would reduce the barrier to entry. Also, in my opinion, LFS should be enabled by default with a default size that covers the majority of cases (e.g. 64K or 128K). This way, most people can start right away using it...increasing adoption rate. And if the size changes, maybe a node.lfs_size() something like that could be available to change upon reboot or on the fly. Just a thought. Unless this could be part of node.setpartitiontable(). |
I would also welcome this. After Sorry for asking but I couldn't find it in the code or documentation:Is there a way (already) to configure the PT on build time (in docker) and get it flashed with existing tools (which are not part of the 3.0 approach)? |
The PT only exists on SDK 3.0 builds so no existing tool has full support for PTs. You can use
There is no reason why we couldn't move its use into a
If you look at user_main.c:setup_partition_table(), then you will see that if the partition table is at the build default, then by default a 64Kb LFS partition is allocated immediately following the irom0 segment, and the remainder of the flash is a SPIFFS partition. Hence the chip will boot with some sensible defaults.
Either you will be using a provisioning tool such as The 4Kb page starting at 0x10000 is special in that it is treated almost as a separate partition in its own right. the build and nodemcu partition create the PT at its head but the rest is set to 0xFF, and effectively blank from a flash NAND perspective.
With this second format the node.setpartition() function would not erase the PT page at all but rather simply add a new version of the PT and then mark the old one as deleted before rebooting the ESP. Both of these operation would work with a simple flash write because of the NAND flash rules. OK we would only have room for some 60-100 reconfiguration messages before we have to erase the page for GC, but most live systems will never need this number, so the risk is minimal. |
FYI, testing the dev branch with SDK 3.0: My application running on the new firmware is having difficulties connecting to my WiFi AP. Never happened on previous SDKs. When it manages to connect (restarting my AP helped) then I can see about 10 kB of extra free RAM and that's absolutely awesome because my app tends to crash on current master SDK due to lack of RAM rather frequently. Yet I experience a lot of frequent unexpected restarts even here on SDK 3.0. Not sure what causes them, as there's no message at all before it restarts. |
If I get it right I could modify I rmember having read an idea to use a configuration file to configure the PT at compile time. About the incremental partition table:
|
@joysfera Petr, The SDK 3.0 has moved a lot of previous RAM const data into Flash which is where the extra RAM comes from. I am going to have to hammer this a bit. If you can isolate failures and create any test cases then post them as separate issues. Thanks. |
@HHHartmann Gregor, don't modify You don't need two pages. The NAND logic rules are quite straightforward. Have a look at the user_main.c code. It scans the flash copy and builds one in RAM. It is this RAM version that is registered with the SDK. |
@TerryE, like previous game changers , the SDK 3.0 Upgrade works great out of the box using the Docker build approach. |
Not quite. Current Nodemcu |
Oops, sorry. I better keep my mouth shut then. I really start loosing track of things around here. Sorry again.
Not good. |
We've had 4 years of tweaking runtime performance to minimise the runtime overheads of the exception handler (e.g. Phillip's
Yes and No. Our master However, Githib makes these ZIP files available for any intermediate commit, for example There is nothing to stop us evaluating any given (e.g. the latest) SDK 3.0 commit with minor tweaks to our Makefile. The build would still be well determined, all thanks to GitHub. 😄 |
Thinking about this, perhaps we might include a make switch so that the builder can decide whether to select the Release SDK or the latest (as at the Makefile). That way @joysfera Petr et all can compare and evaluate the performance of both. I also note that Espressif use their All of this work on the non-OS SDK sort of goes against the Espressif statement that 3.0.0 is the last SDK release. Doesn't it? |
I just created #2729 to discuss that aspect separately. |
I'm trying to get a dev build to actually work. I'm using the docker image to build and it spits out a combined image. I'm following the instructions at https://nodemcu.readthedocs.io/en/dev/flash/ to flash the combined image. I get the following:
I've tried erasing the flash but it doesn't help. I've tried adjusting the
but it doesn't seem to have any effect on what the boot prints out. Also, you need to remove the parens around the value as otherwise you get errors in the tools/Makefile -- but that doesn't seem to be relevant. However, when I use the cloud builder, then I get a dev image that boots. Is the cloud builder using the current version of the docker image marcelstoer/nodemcu-build? @marcelstoer Puzzled.... |
All looks normal, yet are are getting the The whole SPIFFS image make needs reworking. |
I figured it out. For some reason I was setting DEBUG=1 in my environment before running the build. I was a bit suspicious when I realized that my build was significantly bigger than the build that the cloud builder produced. Why this is a problem is left as an exercise for another day. |
@TerryE , @marcelstoer , under SDK 3.0, the This bug is detailed in espressif/ESP8266_NONOS_SDK#10. This bug manifests when This was verified by rolling back to the last commit |
I am having fun with this SDK!! I've got a recent test build where the boot sequence (with some diagnostics) goes:
but the Lua RTS is set to output at 115200 not 73880. WTF??? Then I come across an issue on the Arduino forum where the poster claims that the new SDK seems to dropping the clock frequency by ⅔ under some circumstances. So I try setting the miniterm baudrate to 49800 (⅔ × 115200) and reboot. Now the <crap due to a baudrate change> is readable and everything else scrambled from baudrate mismatch:
So somewhere in the SDK PSThat's on a Wemos D1 mini pro where the serial-to-usb chip supports this clock speed. The same code on the Wemos D1 mini drops the USB serial causing |
Uuuaaaarrrh! Found it. Amongst the rewrite of the extern const uint32_t init_data[], init_data_end[];
#define INIT_DATA_SIZE (init_data_end - init_data)
__asm__(
".align 4\n"
"init_data: .incbin \"" ESP_INIT_DATA_DEFAULT "\"\n"
"init_data_end:\n"
); The error is that |
I am really looking for feedback from users such as @NicolSpies @joysfera @HHHartmann @dtran123 etc. and the committers. I mentioned the nodemcu-partition utility above and I find this syntax really easy to use as I just flash the firmware then use the utility to set the LFS and SPIFFS partitions and preload them if needed, for example:
So what I want to do is to allow users the option to list and to update the PT through a couple of node library functions to get/set the partition table. To be honest, I will never use this since I have python on my laptop and it's trivial to run the above script, but it has been suggested that Windows users might want to play around with some partition placing/size through the node API.
My instinct is to keep this API as simple as possible: read or write the LFS or SPIFFS partition size on that's it. My rational is that you need to know what you are doing to do more and it would be really easy to crater your firmware image. Anyone who needs to do more complex stuff should use the python tool. Feedback please. |
Limited partition access through a |
I agree with the limited access using the |
First I thought it would be nice to also size the firmware partition. But then there is no way to write it without pyloader if I am not mistaken. So that makes no sense. |
My feedback: we need to be able to upgrade the NodeMCU firmware from within running Lua application. If it requires access to the full PT (so that one can decide which firmware will boot at the next reboot, or say can resize a partition to upgrade to a larger firmware than originally anticipated) then full PT API would be needed. If, however, there was a complete NodeMCU API support for handling all firmware upgrade needs then a simplified PT API just for FS and LFS might suffice. |
Thanks for the feedback. Specific comments:
|
@TerryE it is a new ball game but still related to PT (or rather PT is related to the firmware upgrade) so that's why I mentioned it. If in the future the new ball comes with its own support for PT related tasks then use the simplest approach for now. |
We should do baby steps and as per @TerryE 's suggestion, read or write the LFS or SPIFFS partition size is good enough for now in my opinion. Arguably that will cover 90% of usecases and lower the barrier of entry for most "casual" users. Anything more involved, the user has other options. For OTA upgrades, as long as the current approach/architecture is inline with future considerations..it should be fine. BTW, I have been testing this new dev branch with SDK3.0...and happy to say that regression testing is going well so far. I have also been testing TLS connection scenarios with certificates ...so far it is working except for the scenarios involving CA certificate verification. (tls.cert.auth(true) works fine but with tls.cert.verify(true) as well, it fails...maybe due to demanding RSA but I am not sure at this point if tls.cert supports elliptic ciphers as the code appears to only support RSA but I will raise this in another thread/PR. My main concern with the new SDK3.0 was the latency causing possible new timeouts on TLS handshakes and cert verification. |
@dtran123, It will be great if you can also confirm the |
I usually use mainly MQTT. For HTTP REST API, I have been using basic TCP connections because so far it has served me well due to the memory hungry HTTP implementation but also the HTTP library doesn't handle large tokens very well (tokens > 1.5K in size). Now with LFS, I might try HTTP library again. |
I have decided to close this since the SDK seems as built seems to be stable and we've got to the point where we can't practically revert to a 2.2.1 version. Any of the commenters here are welcome to open specific issues going forward. |
Hi TerryE, can you please share where you found this. |
@MaBecker, on another thread I posted that this was a phantom saving. The version introduces an extra memory allocation mode (which doesn't work with our type of build) and this mis-reports free heap. The free memory is pretty much the same as 2.2.1. |
Thanks for your quick response! I tried to implement Johny's unaligned exception handler for Espruino, but have not been successful. And if this was part it would have been extremely cool. |
Getting Espruino working on an esp8266 will be a bit of a hard work. Maybe the esp32 would be a better starting point, but that outside the scope of this list, eh? |
Sorry @TerryE, it is running very stable on ESP8266. You should give it a try ;-) |
Key points from of previous discussions
RF_CAL
,PHY_DATA
andSYSTEM_PARAMETER
) into unused flash between the 0x0000 segments and 0x10000 segment)user_pre_init()
entry-point has the ICACHE_FLASH_ATTR qualifier -- that is unlike the SDK 2.0user_trampoline
code, ICACHE has already been enabled.flash_detect_size_byte()
as this can now be easily set during configuration usingesptool.py
or any wrapper.Superseded issues
The text was updated successfully, but these errors were encountered: