1. 09 Jun, 2016 1 commit
    • Johny Mattsson's avatar
      Make NodeMCU compile and link for ESP32. · 224788b6
      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.
      224788b6
  2. 24 May, 2016 1 commit
    • Johny Mattsson's avatar
      Initial pass at switching to RTOS SDK. · f3e2a3af
      Johny Mattsson authored
      This compiles, links, and starts the RTOS without crashing and burning.
      
      Lua environment does not yet start due to the different task architecture.
      
      Known pain points:
      
        - task implementation needs to be rewritten for RTOS (next up on my TODO)
      
        - secure espconn does not exist, all secure espconn stuff has been #if 0'd
      
        - lwip now built from within the RTOS SDK, but does not appear to include
          MDNS support. Investigation needed.
      
        - there is no access to FRC1 NMI, not sure if we ever actually used that
          however. Also #if 0'd out for now.
      
        - new timing constraints introduced by the RTOS, all use of ets_delay_us()
          and os_delay_us() needs to be reviewed (the tsl2561 driver in particular).
      
        - even more confusion with ets_ vs os_ vs c_ vs non-prefixed versions.
          In the long run everything should be switched to non-prefixed versions.
      
        - system_set_os_print() not available, needs to be reimplemented
      
        - all the RTOS rodata is loaded into RAM, as it apparently uses some
          constants while the flash isn't mapped, so our exception handler can't
          work its magic. This should be narrowed down to the minimum possible
          at some point.
      
        - with each task having its own stack in RTOS, we probably need change
          flash-page buffers from the stack to the heap in a bunch of places.
          A single, shared, page buffer *might* be possible if we limit ourselves
          to running NodeMCU in a single task.
      
        - there's a ton of junk in the sdk-overrides now; over time the core code
          should be updated to not need those shims
      f3e2a3af
  3. 20 Jan, 2016 1 commit
  4. 12 Oct, 2015 1 commit
  5. 10 Jul, 2015 4 commits
    • Johny Mattsson's avatar
      Imported reworked rtctime support. · dd38a0a0
      Johny Mattsson authored
      dd38a0a0
    • Johny Mattsson's avatar
      Imported RTC FIFO component + added Lua interface. · 67e72c45
      Johny Mattsson authored
      The rtcfifo module uses RTC memory to store sensor samples across deep-sleeps,
      making it possible to batch up samples for less frequent uploads. This
      component uses 9 RTC memory slots for control, and a variable number of
      slots for sample storage (see rtcfifo.prepare() on how to control the
      size/location of the latter).
      
      When used together with the rtctime module, it also exposes the convenience
      function rtcfifo.dsleep_until_sample() which can be used to easily take
      readings on a regular basis without having to manually take into account
      time spent awake to get an accurate sleep time.
      
      The format used for storing samples is quite dense, and allows for 16 bits
      of data in a fixed point format (per sample).
      67e72c45
    • Johny Mattsson's avatar
      Imported RTC+sleep timekeeping from an internal DiUS project. · 21874249
      Johny Mattsson authored
      Added Lua module rtctime to interface with it.
      
      This keeps as accurate time as is possible on the ESP8266, including across
      deep sleeps (provided rtctime.dsleep() is used rather than node.dsleep()).
      Intended to be used together with NTP for high accuracy time keeping. The
      API is via rtctime.{get,set}timeofday(), working from Unix epoch.
      
      Note that 160MHz CPU clock is not currently supported by the rtctime code,
      as it is only aware of the 52MHz boot clock and the regular 80Mhz default
      clock.
      
      See rtctime.h for detailed info on how this all works.
      21874249
    • Johny Mattsson's avatar
      Imported RTC access from a DiUS internal project. · 1a613eff
      Johny Mattsson authored
      Added Lua access module named "rtcmem" for read/write of RTC user module.
      1a613eff