Skip to content

Support for nonos-sdk 3.0.x and legacy OTA #283

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

Closed
wants to merge 4 commits into from

Conversation

freedib
Copy link

@freedib freedib commented Nov 1, 2022

This PR implements support for the latest Espressif nonos-sdk (second commit) and support for legacy OTA usable with nonos-sdk and rtos-sdk (v1.5) (third commit).

I know that Espressif is phasing out nonos-sdk, but I prefer avoid arduino framework and still use these two ones until rtos3-sdk is available.

Support for the Espressif nonos-sdk (3.0.5) requires :

  • a esp_init_data_default_v08.bin file which is different from original esp_init_data_default.bin
  • information about flash size map
    To achieve that, the platform builder :
  • create the correct file list and sets FLASH_EXTRA_IMAGES variable for the linker
  • appends -DSPI_FLASH_SIZE_MAP=n to CCFLAGS for the compiler. main.c should handle this value accordingly to nonos-sdk notes.
    A fork of latest Espressif nonos-sdk with the addition of package.json is available at https://github.com/freedib/framework-esp8266-nonos-sdk.

To support for legacy OTA, the platform must create binaries for user1 and user2 which can be stored on an http server. If direct upload is required, user1 binary must be uploaded.
A new "ota" target is created in main.py. If used, then OTA files be generated. If not, non OTA files will be generated.
A python tool (genbin.py) similar to Espressif's gen_appbin.py allow to extract elf sections and create flash.bin+irom0.text.bin (non OTA) or user1.bin+user2.bin (OTA).
To achieve that, the platform builder :

  • sets BUILDERS/ElfToBin variable to call genbin.py with frequency, flash mode, memory parameters and name of output files.
  • sets FLASH_EXTRA_IMAGES variable with final files list for the uploader
    The same code is used for nonos-sdk and rtos-sdk.
    genbin.py is already packaged for platformio and available at https://github.com/freedib/tool-genbin.

- Set correct include paths for nonos-sdk
- Set correct libraries list
- Suppress literal-suffix warnings from SDK building
- Avoid building SDK drivers on each run for nonos-sdk
- Remove dependency to xtensa 1.40802.0 in platform.py
platform.json
- Update nonos-sdk and rtos-sdk version numbers
esp8266-nonos-sdk.py
- Add SPI_FLASH_SIZE_MAP to compile flags
- Use the new "esp_init_data_default_v08.bin" file for NONOS 3.0.4
Requires package tool-genbin
Implemented as a target in pio: pio -t upload -t ota

main.py
- add ota target
- allow different bootloader
nonos-sdk and rtos-sdk
- use genbin.py to create binaries instead Espressif's gen_appbin.py
- set correct arguments list for flashing
platform.json
- add dependancy to genbin
@freedib
Copy link
Author

freedib commented Nov 8, 2022

I'm finalizing a new version which supports ESP8266-RTOS-SDV v3.4. I will rather make a push request on the new version

@freedib freedib closed this Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant