- 27 Jul, 2020 1 commit
-
-
Javier Peletier authored
-
- 22 Jul, 2019 1 commit
-
-
Johny Mattsson authored
* Port LFS from ESP8266 to ESP32
-
- 19 Jul, 2019 1 commit
-
-
Johny Mattsson authored
* Move task_post() into IRAM so it can be used by IRAM'd ISRs. * Don't leave crud on stack on pcall error.
-
- 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.
-
- 22 Jun, 2019 1 commit
-
-
Johny Mattsson authored
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.
-
- 20 Feb, 2019 1 commit
-
-
Javier Peletier authored
* file: remove use of luaM_free * added safe pushlstring function
-
- 29 Jan, 2019 2 commits
-
-
Javier Peletier authored
* mqtt: first pass * mqtt: correct gc during callback bug * mqtt: document and cleanup * mqtt: separate lnodeaux due to copyright * mqtt: rename lnodeaux methods * mqtt: update docs * mqtt: fix copyright in lnodeaux.c * mqtt: refactor and cleanup * mqtt: use ESP logging
-
Javier Peletier authored
-
- 02 Dec, 2018 1 commit
-
-
devsaurus authored
-
- 30 Nov, 2018 1 commit
-
-
Skirmantas Lauzikas authored
* ESP32: add support for RS485 This commit adds support for switching UART mode to RS485/IRDA. Also included are patches for memory leaks then handling UART events other than data. * ESP32: Documentation for uart.setmode()
-
- 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
-
- 13 Jun, 2017 1 commit
-
-
zelll authored
* uart 1/2 * call -> pcall in uart_on_* functions * fix docs * fixed console driver when using custom console uart * fixed line_inverse and error callback * fixed a crash when uart.start() called more than one time
-
- 18 Apr, 2017 1 commit
-
-
devsaurus authored
-
- 06 Apr, 2017 1 commit
-
-
devsaurus authored
-
- 30 Dec, 2016 1 commit
-
-
Johny Mattsson authored
- 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.
-
- 27 Nov, 2016 1 commit
-
-
Johny Mattsson authored
-
- 16 Nov, 2016 1 commit
-
-
Johny Mattsson authored
-
- 12 Nov, 2016 1 commit
-
-
Johny Mattsson authored
-
- 06 Oct, 2016 1 commit
-
-
Johny Mattsson authored
-
- 04 Oct, 2016 1 commit
-
-
Johny Mattsson authored
-
- 03 Oct, 2016 2 commits
-
-
Johny Mattsson authored
Note need to use explicit wifi.start() at this point.
-
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.
-
- 26 Sep, 2016 1 commit
-
-
Johny Mattsson authored
node.dsleep() no longer takes options. node.output() not yet supported (needs syscall registration/chaining support) Dynamic CPU frequency changing not currently supported in the IDF. Various chip IDs not currently available/obtainable. Boot reason completely revamped in ESP32, will need new code.
-
- 23 Sep, 2016 1 commit
-
-
Johny Mattsson authored
No longer limited to the default 2MB.
-
- 22 Sep, 2016 3 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.
-
Johny Mattsson authored
-
- 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.
-