Commit Graph

50 Commits

Author SHA1 Message Date
Johny Mattsson f123d46209 Add ESP32C3 support/coexistence.
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.
2021-08-11 17:32:47 +10:00
Johny Mattsson 16ef39e255 idf4: overhaul to new build system, part 1 of 3
Yet to come:
  - part 2: dealing with deprecated and removed APIs
  - part 3: making it actually work again
2021-07-15 16:27:03 +10:00
Javier Peletier 084d6cabc5
Add support for external modules (#3100) 2020-07-27 19:08:19 +02:00
Marcel Stör 6fe68679af Revert "Bump toolchain to 20190731.0"
This reverts commit f93c9efa09.
2020-06-20 22:38:36 +02:00
Marcel Stör f93c9efa09
Bump toolchain to 20190731.0 2020-06-20 22:32:55 +02:00
David Thornley 2a9bf13ab8 Address build error when path contains whitespace
The path environment under Windows Subsystem for Linux typically 
contains paths with spaces.

Error Manifests as: -

Setting IDF_PATH and re-invoking...
/bin/sh: 1: Syntax error: "(" unexpected
Makefile:21: recipe for target 'flash' failed

Tested on Ubuntu 18.04 both on Linux proper and WSL.
2020-04-29 23:38:29 +10:00
M.K e18bd24f1e Auto-detect CPU architecture for make (#2999)
The repo we download from only has x86_64 anyway currently, but a
download error will be much more informative than bogus errors from
an incompatible compiler.
2020-01-06 13:43:52 +01:00
M.K aef9ea16a3 Auto-install SDK if user forgot to. (#2994) (#2998) 2020-01-05 08:26:18 +01:00
Marcel Stör 7ad6bc1be7
Upgrade toolchains (#2869) 2019-08-01 21:29:16 +02:00
Arnim Läuger 13735b7228
ESP32 precompiled toolchain (#2730)
* remove toolchains submodule

* remove toolchains dir

* download precompiled toolchain from https://github.com/jmattsson/esp-toolchains/releases

* remove toolchain target
delete toolchain with clean target

* avoid bash syntax
2019-04-22 14:45:27 +02:00
Johny Mattsson e160eaf938 Automatically pick up esp32 toolchain on reinvoke.
The NodeMCU toolchain is appended, so overriding toolchain in path is still
easy to do.
2016-11-12 11:37:48 +11:00
Johny Mattsson 6349fc8622 Most of the node module from dev.
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.
2016-09-26 18:04:24 +10:00
Johny Mattsson 51fabc7439 Fixed NodeMCU boot banner.
Build for ESP32 on Travis.
2016-09-20 14:19:50 +10:00
Johny Mattsson 9bbf8f43fb Successfully boot barebones NodeMCU on ESP32 (only).
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.
2016-09-20 13:35:56 +10:00
Johny Mattsson a463d764eb WIP ESP32 IDF port.
Currently the UART driver break boot (or at least output).
2016-09-16 18:11:42 +10:00
Johny Mattsson b4f0681913 Updated toolchain for ESP32. 2016-09-15 13:50:00 +10:00
Johny Mattsson afbbeb4566 Replaced UART driver.
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!
2016-06-23 18:23:04 +10:00
Johny Mattsson fd9fa71541 Ensure ESP32 bins are created fresh.
Just appending to previously built bins was not a successful approach...
2016-06-21 19:16:35 +10:00
Johny Mattsson d33945b68b Moved sdk submodules for easier branch switching. 2016-06-21 18:06:04 +10:00
Johny Mattsson 224788b642 Make NodeMCU compile and link for ESP32.
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.
2016-06-09 18:40:56 +10:00
Johny Mattsson 0df2eda6c0 Take two of Makefile cleanup.
There is no reason to even be rebuilding SDK lwIP - that was just a legacy
of the initial transition to the RTOS SDK.
2016-06-03 12:59:19 +10:00
Johny Mattsson e82e6e85b8 Cleaned up top-level Makefile.
Now doesn't recurse into the rtos-sdk for every subdir, does clean lwip, etc.
2016-06-03 12:43:14 +10:00
Johny Mattsson e49f2bb13f Remove conflicting libc, rename c_xx and os_xx to xx.
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.
2016-05-26 18:50:20 +10:00
Johny Mattsson f3e2a3afd9 Initial pass at switching to RTOS SDK.
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
2016-05-24 16:05:02 +10:00
Philip Gladstone b32a161bc1 Reverted accidental change (#1222) 2016-04-09 13:53:31 +02:00
Johny Mattsson 731264776d Fix to make GNU make 4.1 accept the Makefile after cert changes. 2016-03-10 14:33:19 +11:00
philip 501bd1fb9a Adds support for verifying the certificate offered by an SSL server.
Squashed commit of the following:

commit 4439b8c45192f6dee1222df78bbb59f74509e0ee
Author: philip <philip@gladstonefamily.net>
Date:   Sun Mar 6 20:23:21 2016 -0500

    Fix the ignore

commit a07ee5acdf91286607c3e2dce128c9b8bfd7bd80
Author: philip <philip@gladstonefamily.net>
Date:   Sun Mar 6 20:20:41 2016 -0500

    Remove uneeded stuff

commit b3604ace92fc13b30161d385c354b0f1c5fe4046
Author: philip <philip@gladstonefamily.net>
Date:   Sun Mar 6 20:15:26 2016 -0500

    Remove client cert auth

commit 6e48c633569630736a986cd07a59a12de954391e
Author: philip <philip@gladstonefamily.net>
Date:   Sun Mar 6 20:11:42 2016 -0500

    More cleanup

commit d40eade405ef071d0d1b60d038566b5b8f2cafa3
Author: philip <philip@gladstonefamily.net>
Date:   Sat Mar 5 10:56:56 2016 -0500

    Move to almost working version

commit 1860a2d90afa94461c53bd41251d4870d6527f9d
Author: philip <philip@gladstonefamily.net>
Date:   Fri Mar 4 08:04:09 2016 -0500

    Changed the naem to server-ca.crt

commit e7a315660843273fe62943b7fe8ee6c0541dada2
Author: philip <philip@gladstonefamily.net>
Date:   Thu Mar 3 21:16:26 2016 -0500

    Update gitignores

commit 2b037d185c396209b64381399c40821c15e1840e
Author: philip <philip@gladstonefamily.net>
Date:   Thu Mar 3 08:56:17 2016 -0500

    Getting better

commit 763255cffba8e279158cd7f43391a3573efdeca8
Author: philip <philip@gladstonefamily.net>
Date:   Wed Mar 2 22:28:21 2016 -0500

    Works a bit better

commit a38325d1a47dbad255cb3e681da8415e8cf699ea
Author: philip <philip@gladstonefamily.net>
Date:   Wed Mar 2 09:11:04 2016 -0500

    First building version

commit 4aef13da33470ed954f2eaf5f7ac0ac3dcdf3774
Merge: 180e147 ebb0c33
Author: philip <philip@gladstonefamily.net>
Date:   Tue Mar 1 22:03:06 2016 -0500

    Merge remote-tracking branch 'upstream/dev' into ssl-client

commit 180e147c1abdcf4046ad9be9b3c1a48f4a875312
Author: philip <philip@gladstonefamily.net>
Date:   Sun Feb 28 21:34:21 2016 -0500

    Missing files from espressif

Try to imporve layout

Align the file names with the contents

Missing file

Review comments

More review coments
2016-03-09 21:51:23 -05:00
philip 669543bbf2 Hardware timer support and convert the PWM module to use it 2016-02-17 21:07:33 -05:00
Johny Mattsson 0cd287e67b Added -Wimplicit to modules build.
Plus associated fixes.
2016-01-22 10:55:57 +11:00
philip b2850c3f64 Use sha1 of file instead of size 2016-01-13 09:54:49 -05:00
philip dd5dafa99e Merge remote-tracking branch 'jmattsson/tmr-libmain-binpatch150' into sdk1.5.1
Conflicts:
	Makefile
2016-01-13 07:54:27 -05:00
Philip Gladstome 1d9336fb99 Upgrade to SDK version 1.5.1 from Espressif 2016-01-12 21:05:47 -05:00
Johny Mattsson 5af57d58ee Guard against short downloads.
Also bail out if trying to use the replacement libmain.a with a
non-1.5.0 SDK.
2016-01-11 22:49:09 +11:00
Johny Mattsson cf2aa574b8 Bin-patching of SDK 1.5.0 with fix for timer interval. 2016-01-10 17:57:24 +11:00
Johny Mattsson a6c0873a28 Upgrade to SDK 1.5.0 + Espressif's Open LWIP 1.5.0.
Removed earlier TCP port randomisation fix - the new SDK has its own fix
even though Espressif told me they wouldn't fix it. Yay?
2015-12-23 11:17:05 +11:00
Johny Mattsson 30380f6cff Further cleanup of ld directory.
Renamed the main linker script to make it clear it is customised for NodeMCU
and not to be confused with the standard linker SDK linker scripts.

Changed to using the eagle.rom.addr.v6.ld file from the SDK.
2015-10-12 13:26:04 +11:00
Johny Mattsson 8f6420227d Mark top level makefile as not parallel capable. 2015-10-12 13:26:04 +11:00
Johny Mattsson c1cd58e096 Build using 1.4.0 SDK + remove old SDK includes/libs.
Leaving the linker scripts intact for now, as they're quite customised.
2015-10-12 13:00:38 +11:00
cal 6f31a20240 Makefile fix: "-Os" was overridden by "-O2" 2015-05-01 17:39:47 +02:00
devsaurus 5a67fec4f3 Merge remote-tracking branch 'upstream/dev' into dev 2015-02-08 13:14:09 +01:00
Lukas Schauer 6d3d95a271 Only set ESPTOOL if not set before
This allows setting the path to esptool.py as an option on make, allowing the use of alternative tools, or modified esptool.py versions.
2015-02-06 04:41:17 +01:00
devsaurus 18a44e7c60 reduce executable size (-fdata-sections and -Wl,--gc-sections) 2015-02-02 22:48:15 +01:00
Tuan PM 42eebf8e2d can set makefile COMPORT name via argument make COMPORT='COM1' flash 2015-01-26 13:25:58 +07:00
Peter Magnusson cf4a4f2a9d Windows doesn't like forward slash as input to esptool.py 2015-01-11 12:52:24 +01:00
Peter Magnusson ae6ff1a0f4 fixes from comments on esptool usage 2015-01-10 22:37:12 +01:00
Peter Magnusson 32ea83c224 adjustments for esptool.py.
Can now do make && make flash directly from root.
2015-01-10 21:53:29 +01:00
funshine 2709258c44 using esptool.py in all platform, fix makefile on windows 2015-01-11 04:11:40 +08:00
Simon John a1e9e58a1e Vastly simplified generating and flashing firmware.
Uses the new elf2image features of esptool.py to do away with the
myriad of shell scripts and binaries.

Fixed permissions on esptool.py
2015-01-10 12:30:52 +00:00
HuangRui cb4a49e0db Changed Makefile to support Windows xcc. 2015-01-05 13:15:59 +08:00
funshine cdd13b1af3 source file first commit, folder structure refact 2014-12-22 19:35:05 +08:00