-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cpu/esp8266: complete reimplementation based on ESP8266 RTOS SDK #11108
cpu/esp8266: complete reimplementation based on ESP8266 RTOS SDK #11108
Conversation
7d7936a
to
7db70f4
Compare
@smlng @MrKevinWeiss When the current semester is over in a few weeks, I will have time again to continue this work. I think the reimplementation is an important step towards better quality. Especially with "esp_wifi" being used, the stability of the reimplementation with the new RTOS SDK seems to be much better than with the old SDK. Do you think that there will be a chance to have the code reviewed by you? |
I hope I have some time over the next few days to rebase the PR to resolve the conflicts. |
sure, just give us another ping when you made the rebase and you think this is ready to be reviewed and tested. I will find time for that ... |
Great, I will ping again. |
b8a7357
to
1854809
Compare
Ping @smlng 😉 After 2 weeks of hard work I'm really proud to inform that I have finished the rebase/rework of this PR with a lot of improvements and a lot of extensions. In fact, the reimplementation has been finished. It is working very stable and the WiFi interface is even more stable than before. Furthermore, almost all the files that can be merged in the future with the ESP32 code are ready to be merged. You can see this when you search for The only open task that remain might be an implementation of newlibs Anyway, from my point of view, the reimplementation is ready and it is a big step forward. I would be really grateful if you could find some time to review it berfore it becomes toooooo old and has to be rebased with a lot of effort again. |
@smlng Since
Please note that the |
Ping @smlng. I know, there are a lot of things to do for release 2019.10. I just wanted to asked you kindly, whether it will become possible for you to start the review of this PR in next weeks. As I said, I spent 2 weeks to rebase the PR and to resolve the all the conflicts and it is starting to have conflicts again 😟 |
In vendor startup code, initialization function were called as parameters of assert statement. With DEVELHELP, they are not called since the assert macro does nothing.
High priority thread for the WiFi interface are only created at startup when the WiFi interface is used.
The modified version esptool.py from RTOS SDK that is required for flashing an image, is now placed in `dist/tools/esptool.py` and used directly from there. The advantage is that `esptool.py` hasn't to be installed explicitly anymore. Having RIOT is enough. The documentation is adapted accordingly. The oly prerequisite is that python and the pyserial module are installed.
5b002b8
to
555a704
Compare
@MrKevinWeiss Since there was no suggestion on how to deal with these problems 😟 (even though I believe that at least the first two are more general problems and not specific problems of esp8266), I worked around them by
and squashed the PR. With these changes all automatic tests work except the From point of view, the PR is in a state where it could be merged. |
@kb2ma I have it running now for two hours. It seems still to work, independent on whether I'm away from the computer on which the server is running or doing something with it. I have the same configuration as you, my computer is connected via Ethernet while esp8266 is connected using the WiFi in the same network. Even though I can't say whether the packets are correct (have not used COAP til now), I have every about 300 seconds two messages
I have activated |
Those results sound like what is expected. Thanks for the verification. I will experiment with components on my local setup. Certainly I don't see a reason to hold up this PR. |
@kaspar030 BTW, with the new reset tool in commit 555a704 it will be possible to enable |
Ping @MrKevinWeiss Do you think that you could merge the PR with these last changes? |
Yup, let me just rerun murdock then we can merge! |
Very nice @gschorcht! Thanks for all the hard work. |
@MrKevinWeiss Many thanks again for your support and all your work you have spent into reviewing and testing this mega PR. Now, I will start to deduplicate several parts of the ESP8266 and ESP32 code step by step. |
Sounds good! |
The new ESP8266 port in PR RIOT-OS#11108 requires a different tool chain than the previous implementation. The version check must be updated accordingly.
The new ESP8266 port in PR RIOT-OS#11108 requires a different tool chain than the previous implementation. The version check must be updated accordingly.
Contribution description
This PR is a complete reimplementation of the RIOT port for the ESP8266 platform. Advantages of the reimplementation are:
Although it is a development revision, it is already completed, works very stably and is only one step away from merge. It simply requires some cleanups before it can be merged.
The former implementation was realized either as a bare metal implementation without WiFi or using the ESP8266 NONOS SDK to enable WiFi functionality. Unfortunatly, the SDK version had different disadvantages and a lot of problems:
With version 3.0 of the RTOS SDK, Espressif started in last fall to release a SDK based on FreeRTOS in source code which is almost source code compatible with the ESP-IDF for ESP32. As with ESP-IDF, the RTOS SDK can be used to port RIOT to ESP8266, provided there is a small FreeRTOS adaptation layer which maps the FreeRTOS functions used by SDK libraries to according RIOT functions.
The source code compatibility of the ESP8266 RTOS SDK and the ESP-IDF for ESP32 allows to reuse a lot of code for ESP8266 and ESP32. For example, the same code can be used for context handling, interrupt handling, WiFi networking and peripheral interfaces like I2C, SPI and UART interfaces. Most of the files of this reimplementation are already to be merged with ESP32 source code.
As a first evolution step, the reimplementation for ESP8266 resides in parallel to the implementation for ESP32. The code for ESP8266 and ESP32 will be merged later step by step.
Status
Everything that was working with the old implementation is working with the reimplementation and already tested.
ToDos
esp_wifi
esp_gdbstub
adaption for debugging capabilitiesPossible improvements
Issues/PRs references
This PR depends on PRs
#9917,#10883,#10929,#10953,#10981,#10982,#11148,#12505,#12510, RIOT-OS/riotdocker#93