- 11 Aug, 2021 1 commit
-
-
Johny Mattsson authored
The uzlib and parts of Lua had to be switched over to use the C standard int types, as their custom typedefs conflicted with RISC-V toolchain provided typedefs. UART console driver updated to do less direct register meddling and use the IDF uart driver interface for setup. Still using our own ISR rather than the default driver ISR. Down the line we might want to investigate whether the IDF ISR would be a better fit. Lua C modules have been split into common and ESP32/ESP32-S specific ones. In the future there might also be ESP32-C3 specific modules, which would go into components/modules-esp32c3 at that point. Our old automatic fixup of flash size has been discarded as it interferes with the checksumming done by the ROM loader and results in unbootable systems. The IDF has already taken on this work via the ESPTOOL_FLASHSIZE_DETECT option, which handles this situation properly.
-
- 19 Jul, 2021 1 commit
-
-
Johny Mattsson authored
Some parts dry-coded in the disabled modules; to be fixed when sorting out the deprecated/removed APIs used in said modules. Still untested beyond compile/linking.
-
- 15 Jul, 2021 1 commit
-
-
Johny Mattsson authored
Yet to come: - part 2: dealing with deprecated and removed APIs - part 3: making it actually work again
-
- 03 Aug, 2020 1 commit
-
-
David Thornley authored
Manifests as multiple definition of esp_event_send during compilation, as bthci triggers inclusion of `event_loop.c`. Also improved lbth_init() to support BTDM or BLE_ONLY controller modes.
-
- 14 Jul, 2019 1 commit
-
-
Johny Mattsson authored
To avoid races between the lwIP callbacks (lwIP RTOS task) and the Lua handlers (LVM RTOS task), the data flow and ownership has been simplified and cleaned up. lwIP callbacks now have no visibility of the userdata struct. They are limited to creating small event objects and task_post()ing them over to the LVM "thread", passing ownership in doing so. The shared identifier then becomes the struct netconn*. On the LVM side, we keep a linked list of active userdata objects. This allows us to retrieve the correct userdata when we get an event with a netconn pointer. Because this list is only ever used within the LVM task, no locking is necessary. The old approach of stashing a userdata pointer into the 'socket' field on the netconn has been removed entirely, as this was both not thread/RTOS-task safe, and also interfered with the IDFs internal use of the socket field (even when using only the netconn layer). As an added benefit, this removed the need for all the SYS_ARCH_PROTECT() locking stuff. The need to track receive events before the corresponding userdata object has been established has been removed by virtue of not reordering the "accept" and the "recv" events any more (previously accepts were posted with medium priority, while the receives where high priority, leading to the observed reordering and associated headaches). The workaround for IDF issue 784 has been removed as it is now not needed and is in fact directly harmful as it results in a double-free. Yay for getting rid of old workarounds! DNS resolution code paths were merged for the two instances of "socket" initiated resolves (connect/dns functions). Also fixed an instance of using a stack variable for receiving the resolved IP address, with said variable going out of scope before the DNS resolution necessarily completed (hello, memory corruption!). Where possible, moved to use the Lua allocator rather than plain malloc. Finally, the NodeMCU task posting mechanism got a polish and an adjustment. Given all the Bad(tm) that tends to happen if something fails task posting, I went through a couple of iterations on how to avoid that. Alas, the preferred solution of blocking non-LVM RTOS tasks until a slot is free turned out to not be viable, as this easily resulted in deadlocks with the lwIP stack. After much deliberation I settled on increasing the number of available queue slots for the task_post() mechanism, but in the interest of user control also now made it user configurable via Kconfig.
-
- 07 Oct, 2018 1 commit
-
-
tomsci authored
* Set stdout to unbuffered This fixes issue #2507 esp32 serial console doesn't show output until enter pressed. * Moved setvbuf call to app_main immediately after console_init
-
- 06 Apr, 2017 1 commit
-
-
devsaurus authored
-
- 27 Nov, 2016 1 commit
-
-
Johny Mattsson authored
-
- 12 Nov, 2016 1 commit
-
-
Johny Mattsson authored
-
- 03 Oct, 2016 1 commit
-
-
Johny Mattsson authored
We're already in the right context, there is no point posting back the Lua start, we can do it right then and there instead.
-
- 29 Sep, 2016 1 commit
-
-
Johny Mattsson authored
-
- 28 Sep, 2016 1 commit
-
-
Johny Mattsson authored
-
- 27 Sep, 2016 1 commit
-
-
Johny Mattsson authored
Modules can now subscribe to ESP system events via the new NODEMCU_ESP_EVENT() macro. See nodemcu_esp_event.h for details.
-
- 23 Sep, 2016 1 commit
-
-
Johny Mattsson authored
No longer limited to the default 2MB.
-
- 22 Sep, 2016 2 commits
-
-
Johny Mattsson authored
Now uses the designated partition (type 0xC2, 0x00) unconditionally.
-
Johny Mattsson authored
It would appear my ESP3212 only has a 2MB flash chip despite the bootloader saying 4MB.
-
- 21 Sep, 2016 1 commit
-
-
Johny Mattsson authored
Also included the recent LVM fix. Platform flash layer not yet functional.
-
- 20 Sep, 2016 1 commit
-
-
Johny Mattsson authored
RTOS driver evicted as it did not play nice with stdio etc. Implemented a minimal driver to fully support Lua console on UART0. Output on UART0 done via stdout (provided by the IDF). Input and setup handled via driver_console/console.c. In addition to the direct input function console_getc(), the driver also registers in the syscall tables to enable regular stdio input functions to work (yay!). The Lua VM is still using the direct interface since it's less overhead, but does also work when going through stdin/fd 0. Auto-bauding on the console is not yet functional; revisit when the UART docs are available. Module registration/linking/enabling moved over to be Kconfig based. See updates to base_nodemcu/include/module.h and base_nodemcu/Kconfig for details. The sdk-overrides directory/approach is no longer used. The IDF is simply too different to the old RTOS SDK - we need to adapt our code directly instead. Everything in app/ is now unused, and will need to be gradually migrated into components/ though it is probably better to migrate straight from the latest dev branch.
-
- 16 Sep, 2016 1 commit
-
-
Johny Mattsson authored
Currently the UART driver break boot (or at least output).
-
- 23 Jun, 2016 1 commit
-
-
Johny Mattsson authored
New driver is a three-way merger between Espressif's esp8266-rtos-sdk example driver, Espressif's esp32-rtos-sdk not-example driver, and the previous NodeMCU driver, plus some general clean-ups. Basic interactivity is now available on the ESP32!
-
- 22 Jun, 2016 1 commit
-
-
Johny Mattsson authored
Running without interrupt vectors not considered all that useful... Disabled flash-size-byte-setting and SPIFFS formatting on ESP32, for now at least, as both of these appeared to corrupt the flash and prevent subsequent boots. Disabled UART init on ESP32 until the driver gets updated. This now gets us to a banner on ESP32, but not yet a prompt.
-
- 09 Jun, 2016 1 commit
-
-
Johny Mattsson authored
A fair bit of reshuffling with include paths and overrides was necessary, as the two RTOS SDKs (ESP8266 and ESP32) don't have the same header structure (or even libraries for that matter). Uses the xtensa-esp108-elf toolchain to build. Completely untested beyond linking, as I still can't flash the ESP32 module I have :( I'd be most surprised if it does anything useful at this point considering I've spent almost no time on the linker script or UART setup. Anything using espconn has been ifdef'd out since espconn is not (and probably will not be) available. Notably this includes the entire net module as well as coap, mqtt and enduser_setup. Many (most?) hardware bus drivers and related modules are also ifdef'd out for now due to hardware differences. Functions surrounding sleep, rtc and RF modes have also been hit by the ifdef hammer. Grep'ing for __ESP8266__ and/or FIXME is a quick way of finding these places. With time I hope all of these will be reinstated.
-
- 02 Jun, 2016 1 commit
-
-
Johny Mattsson authored
-
- 01 Jun, 2016 1 commit
-
-
Johny Mattsson authored
The os_timer callback is executed from task rtT, prio 14, so they preempt the Lua environment whenever they fire. Ideally we should be using the RTOS timers instead, which run at prio 2 and thus would be more suited for our uses.
-
- 31 May, 2016 1 commit
-
-
Johny Mattsson authored
-
- 30 May, 2016 1 commit
-
-
Johny Mattsson authored
Uart driver currently disabled as it's not (yet) compatible with RTOS. Running Lua task with excessive stack to avoid smashing it; need to work out what's using so much stack space. Changed some flash reading functions to not attempt to drop an entire 4k flash page onto the stack. Ensure the task pump doesn't attempt to retrieve from uninitialised queues.
-
- 26 May, 2016 4 commits
-
-
Johny Mattsson authored
c_strtod and c_getenv are kept since strtod doesn't appear in the SDK's libc, and we want our own c_getenv to initialize the Lua main anyway.
-
Johny Mattsson authored
-
Johny Mattsson authored
With a working exception handler all of the RTOS-SDK bits seem to be happy too. So far.
-
Johny Mattsson authored
Incidentally now also a whole lot faster.
-
- 24 May, 2016 1 commit
-
-
Johny Mattsson authored
Not yet hooked up to an RTOS task, however.
-
- 18 May, 2016 1 commit
-
-
Johny Mattsson authored
- Stop fighting against the SDK in terms of owning/writing the init_data block. NodeMCU included a default init_data block because originally the SDK did not, but by now it's not needed. - Expose a way to reconfigure the ADC mode from Lua land. With most people using the cloud builder and not able to change the #define for byte 107 this has been a pain point. - Less confusion about which init_data has been used. Lua code can now simply state what mode it wants the ADC to be in, and not worry about the rest of the init_data complexities such as the init_data changing location due to flashing with wrong flash_size setting, or doing/not doing a chip-erase before loading new NodeMCU firmware.
-
- 23 Mar, 2016 1 commit
-
-
devsaurus authored
-
- 20 Mar, 2016 1 commit
-
-
philip authored
-
- 11 Mar, 2016 1 commit
-
-
TerryE authored
-
- 10 Mar, 2016 1 commit
-
-
Bernd Meyer authored
-
- 17 Feb, 2016 1 commit
-
-
TerryE authored
As with the last commit this rolls up the follwowing, but include the various review comments on the PR. - **Documentation changes**. I've added the taks FAQ as a stub new Extension developer FAQ, and split the old FAQ into a Lua Developer FAQ and a Hardware FAQ. - **Tasking I/F**. New `app/task/Makefile`, `app/task/task.c`, `app/include/task/task.h` and `app/Makefile` as per previous commit. Cascade changes to `app/driver/uart.c`, `app/include/driver/uart.h`, `app/user/user_main.c` and `app/modules/node.c` - **GPIO Rework** to `app/modules/gpio.c` and `pin_map.[hc]`, `platform.[hc]` in `app/platform` - **Other Optimisations** Move the `platform_*_exists()` from `app/platform/common.c` to static inline declarations in `platform.h` as this generates faster, smaller code. Move lgc.a routines out of iram0.
-
- 23 Dec, 2015 1 commit
-
-
Johny Mattsson authored
Removed earlier TCP port randomisation fix - the new SDK has its own fix even though Espressif told me they wouldn't fix it. Yay?
-
- 12 Nov, 2015 1 commit
-
-
Johny Mattsson authored
Make ADC vs readvdd33 option user_config.h configurable for the init data, and made readvdd33 the default.
-
- 05 Nov, 2015 1 commit
-
-
Johny Mattsson authored
This addresses the issue where a server would otherwise reject a valid connection attempt from a rebooted node, due to the server thinking that packet belonged to a recently closed session. By starting off the local TCP port numbers at random* points each boot the risk of port reuse across a reboot is significantly reduced. *) As random as can be had via the lower 12 bits of the ccounter.
-