1. 23 Aug, 2020 1 commit
  2. 03 Aug, 2020 1 commit
    • David Thornley's avatar
      Fix bthci compilation issue (#3201) · 7774b5fa
      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.
      7774b5fa
  3. 27 Jul, 2020 1 commit
  4. 22 Jul, 2019 1 commit
  5. 19 Jul, 2019 1 commit
  6. 14 Jul, 2019 1 commit
    • Johny Mattsson's avatar
      Fix net module data loss & RTOS task unsafety (#2829) · f44e6e96
      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.
      f44e6e96
  7. 22 Jun, 2019 1 commit
    • Johny Mattsson's avatar
      Reworked linker magic to work with IDF 3.3 (#2805) · 51912d55
      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.
      51912d55
  8. 20 Feb, 2019 1 commit
  9. 29 Jan, 2019 2 commits
  10. 02 Dec, 2018 1 commit
  11. 30 Nov, 2018 1 commit
    • Skirmantas Lauzikas's avatar
      ESP32: add support for RS485 (#2559) · 3257e557
      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()
      3257e557
  12. 07 Oct, 2018 1 commit
    • tomsci's avatar
      Set stdout to unbuffered (#2508) · 35c0f158
      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
      35c0f158
  13. 13 Jun, 2017 1 commit
    • zelll's avatar
      ESP32: uart 1/2 supports (#1982) · 329bd73b
      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
      329bd73b
  14. 18 Apr, 2017 1 commit
  15. 06 Apr, 2017 1 commit
  16. 30 Dec, 2016 1 commit
    • Johny Mattsson's avatar
      Updated to latest IDF. · 7abda5c9
      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.
      7abda5c9
  17. 27 Nov, 2016 1 commit
  18. 16 Nov, 2016 1 commit
  19. 12 Nov, 2016 1 commit
  20. 06 Oct, 2016 1 commit
  21. 04 Oct, 2016 1 commit
  22. 03 Oct, 2016 2 commits
  23. 29 Sep, 2016 1 commit
  24. 28 Sep, 2016 1 commit
  25. 27 Sep, 2016 1 commit
  26. 26 Sep, 2016 1 commit
    • Johny Mattsson's avatar
      Most of the node module from dev. · 6349fc86
      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.
      6349fc86
  27. 23 Sep, 2016 1 commit
  28. 22 Sep, 2016 3 commits
  29. 21 Sep, 2016 1 commit
  30. 20 Sep, 2016 1 commit
    • Johny Mattsson's avatar
      Successfully boot barebones NodeMCU on ESP32 (only). · 9bbf8f43
      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.
      9bbf8f43