* Proof-of-concept multi-type console support via stdio
* Address crashes on linput's use of printf.
On an empty line input, a C3 with UART console would panic while attempting
to output the new Lua prompt. The backtrace shows a xQueueSemaphoreTake
with uxItemSize==0 as the panic cause, deep inside the uart driver, invoked
via vfs_uart and vfs_console layers, from printf.
Similarly, the printf for outputting a backspace/erase sequence would also
trigger a panic.
This workaround (of not mixing fflush() with printf) is likely merely hiding
a deeper issue, but it appears to be consistent. Plus, printf with no args
and a user-supplied format string is a no-no and should be fixed anyway.
* Work around IDF inconsistency with stdout buffering.
* Increase console task stack size.
Seems on Xtensa it ended up not being enough.
* Switch to single-byte console reads.
* Stop cheating and feed Lua from the right context.
* Work around IDF buffering stdout even when told not to, on ACM consoles.
* Initial build support for esp32c6.
Plus fixup of module selection for a variety of targets.
* Update github actions to node 20 versions.
* Update github build to deal with Lua 5.3 being default.
* Address fatal compiler warning.
Newer IDF toolchain is stricter, and we'd apparently failed to build test
the Lua-5.1 path for some time.
* Initial build support for esp32h2.
* Upgrade IDF to v5.1.3
* Fix left-over incorrect type in uzlib.
* Avoid null pointer crashes when debugging startup.
* Workaround for using wifi module on S2 with USB-CDC console.
---------
Co-authored-by: Jade Mattsson <github@frozenlogic.org>
Plenty of dependency adjustments, printf format specificier updates,
FreeRTOS type and macro name modernisation, not to mention API changes.
Still plenty of legacy/deprecated drivers in use which will need updating.
The following features have been removed due to no longer being available
from the IDF:
- ADC hall effect sensor reading
- Configuration of SD SPI host via sdmmc module (now must be done first
via the spimaster module)
- FAT partition selection on external SD cards; only the first FAT
partition is supported by the IDF now
On the other hand, the eth module now supports the following new chipsets:
- KSZ8001
- KSZ8021
- KSZ8031
- KSZ8051
- KSZ8061
- KSZ8091
- Possibly additional models in the LAN87xx series (the IDF docs aren't
clear on precisely which models are handled)
Further, the sdmmc module is now available on the ESP32-S3 as well.
Slightly reworked embed_lfs.sh to better cope with attribute size changes
in future compiler versions, without needing to be updated again.
RMT register naming changed once again...
With the IDF asserting full control over the linker scripts and insisting on
the application description being the first entry in the .flash.rodata
section, or previous method of doing link-time arrays stopped working.
Why? Because the build patched in a SHA256 digest straight into our arrays.
With the limited language of the gcc linker scripts I could find no other
way of getting it in cleanly.
The IDF "linker fragments" support can not be made to work for our needs:
- no support for setting alignment before including objects
- no support for declaring symbols
- no support for adding our terminating zeros
- insists on grouping objects by lib rather than by declared grouping,
which means we could at most have a single link-time-array using
the IDF mechanism
- also does not like underscores in section names, but that's just an
annoyance
So, the least bad option that I could come up with was to use a project-wide
makefile snippet to add a target in-between the IDF's generation of the
esp32.project.ld file, and the linking of our NodeMCU.elf. In this target
we read in the esp32.project.ld linker script, check whether we have our
arrays in there, and if not rewrites the linker script.
Oh, and the esp32.project.ld file only came into existence on the IDF 3.3
branch, so I had to change up the IDF to the latest release/3.3 as well.
I would've preferred a stable tag, but the v3.3-beta3 had a really nasty
regression for us (can't add partition entry), so that was a no-go.
- Switched hardcoded interrupts to new IDF interrupt allocation
framework.
- gpio module switched to the IDF's per-pin interrupt callback service.
- Improved NodeMCU linker script since it broke with the IDF upgrade.
- Various compatibility updates.
This fixes the panic-on-restart issue and the crash-on-uart-input-before-flash-mapped issue.
Node module updated to reflect new function names for sleep/restart.
WiFi STA module updated to reflect IDF name changes.
Platform flash and partition api updated to reflect IDF name changes.
Eventually these (and the SPIFFS module) will likely need to be updated
to exclusively work with the esp_partition_xxx() functions in order to
support working with encrypted flash.