1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

269 Commits

Author SHA1 Message Date
Gunar Schorcht
cdd1ec81a4 cpu/esp_common: ESP32 variant independent makefiles 2022-06-23 13:19:52 +02:00
Gunar Schorcht
b60b47ff51 cpu/esp_common: inverse MCU_* conditionals to deal with ESP32 variants
The MCU_* conditionals are inverted so that they can be tested for ESP8266. In all other cases the MCU is any ESP32x SoC
2022-06-23 12:56:45 +02:00
Gunar Schorcht
c8d8e5d3f5 cpu/esp_common/freertos: add required ringbuffer handling 2022-06-20 21:23:47 +02:00
Gunar Schorcht
780fd9a815 cpu/esp_common/freertos: add timeout handling to xQueue 2022-06-20 21:23:47 +02:00
Gunar Schorcht
99fa182fb4 cpu/esp_common/freertos: add required task functions 2022-06-20 21:23:47 +02:00
Gunar Schorcht
ae01985588 cpu/esp_common/freertos: add xSemaphoreGetMutexHolder
The mutex and semaphor handling had to be extended by the thread pid.
2022-06-20 21:23:47 +02:00
Gunar Schorcht
02e52513d1 cpu/esp_common/freertos: add xQueueReset function 2022-06-20 21:23:47 +02:00
Gunar Schorcht
e4f1a94219 cpu/esp_common/freertos: allow platform independent compilation 2022-06-20 21:23:47 +02:00
Benjamin Valentin
344c065e2f cpu/esp_common: use LittleFS2 as default FS 2022-06-02 23:21:22 +02:00
benpicco
e1e2b7c5b6
Merge pull request #17601 from gschorcht/cpu/esp32/upgrade_esp-idf_v4.4
cpu/esp32: Upgrade to ESP-IDF v4.4
2022-06-02 10:18:07 +02:00
Gunar Schorcht
565c2e17a0 cpu/esp32: update log module for ESP-IDF 4.4 2022-06-01 13:31:00 +02:00
Gunar Schorcht
84893c672b cpu/esp_common: fix lock handling
Assertions for uninitialized locks must not be triggered as long as the scheduler is not running. Furthemore, the handling of the __malloc_static_object lock is only necessary for ESP8266.
2022-06-01 13:31:00 +02:00
Gunar Schorcht
d63c116eba cpu/esp_esp8266: move missing _rename_r function to esp_common 2022-06-01 13:31:00 +02:00
Gunar Schorcht
d2a4d6e3d3 cpu/esp32: compile bootloader from ESP-IDF v4.4 source 2022-06-01 13:31:00 +02:00
Gunar Schorcht
443f3b87df cpu/esp_common: missing heap functions for ESP-IDF v4.4 2022-06-01 13:27:31 +02:00
Gunar Schorcht
d1d252cc58 cpu/esp_common: changes in event handling for ESP-IDF v4.4 2022-06-01 13:27:31 +02:00
Gunar Schorcht
0ecbcf6561 cpu/esp_common: changes in esp_now/esp_wifi for ESP-IDF v4.4 2022-06-01 13:27:31 +02:00
Gunar Schorcht
ee4a032a89 cpu/esp_common: fix compilation problems with ESP-IDF v4.4 2022-06-01 13:27:31 +02:00
Gunar Schorcht
9fd056f8ec cpu/esp_common: add missing functions for ESP-EDF v 4.4 2022-06-01 13:27:31 +02:00
Gunar Schorcht
e5adb7ef34 cpu/esp32: cleanup of periph/gpio for ESP-IDF v4.4 2022-06-01 13:27:31 +02:00
Gunar Schorcht
d4e061f635 cpu/esp_common/freertos: missing functions/definitions for ESP-IDF v4.4 2022-06-01 13:21:29 +02:00
benpicco
eb09fe21fd
Merge pull request #18025 from leandrolanzieri/pr/sys/random/change_kconfig_default_backend
sys/random/kconfig: remove HWRNG default in backend choice
2022-05-24 11:35:21 +02:00
Gunar Schorcht
72abc08d14 cpu/esp_common: small fix of lib_printf 2022-05-18 07:27:23 +02:00
Gunar Schorcht
60bbe0fe49 cpu/esp_common/makefile: move linking of libhal.a to esp8266 makefile 2022-05-18 07:27:23 +02:00
chrysn
b458d52e2b cpu/esp_common: Set write size for flash implementation 2022-05-17 15:48:18 +02:00
Leandro Lanzieri
82726a2b2b
sys/random/kconfig: remove HWRNG default in backend choice
For now we match the Makefile.dep default, ignoring if the platform
presents a Hardware RNG.
2022-04-27 15:41:23 +02:00
Gunar Schorcht
cbbd02d520 dist/tools: rename esptool to esptools to use it for several tools
The directory `dist/tools/esptool` already contains a couple of ESP tools and not only esptool.py. As the location for a couple of ESP related tools, it is more clear to call it `esptools` instead of `esptool`.
2022-03-04 08:34:19 +01:00
Francisco Molina
c1238ad4e4 cpu/esp: model missing modules 2022-02-09 16:50:04 +01:00
Gunar Schorcht
e1c6306bf4 cpu/esp32: replace bzero by memset 2022-01-25 00:36:51 +01:00
Gunar Schorcht
e15e18b195 cpu/esp32: fix compilation errors 2022-01-25 00:36:51 +01:00
Gunar Schorcht
839cf4223d cpu/esp32: changes for retagetable locking 2022-01-25 00:36:51 +01:00
Gunar Schorcht
881a92fe47 cpu/esp32: remove types.h in sys include 2022-01-25 00:36:51 +01:00
benpicco
c18f1c2a9b
Merge pull request #17455 from gschorcht/cpu/esp32/sdk-as-package
cpu/esp32: download Espressif SDK ESP-IDF as package
2022-01-24 16:13:04 +01:00
Gunar Schorcht
6c3e7c5db7 cpu/esp*: nfs_flash/cpp dependency cleanup
Module `esp_idf_nvs_flash` uses C++ code. Since  `esp_idf_nvs_flash` module is always enabled on ESP8266, the permanent dependency on `cpp` is correct. But on ESP32, the `esp_idf_nvs_flash` module is only enabled if `esp_wifi_any` is used. Only in that case the compilation should depend on module `cpp`.
2022-01-21 13:32:56 +01:00
8272e4fbd2
Merge pull request #17359 from benpicco/irq_is_in-bool
core: change return type of irq_is_in(), irq_is_enabled() to bool
2022-01-06 18:13:20 +01:00
Gunar Schorcht
d6c2926933 pkg/esp32_sdk: add ESP32 SDK without libraries as package
The vendor binary libraries of ESP-IDF are provided as a separate GIT repository. These libraries are defined as separate package for two reasons: 1. RIOT packages don't support to clone GIT repositories recursively; 2. ESP-IDF pulls a lot of other GIT repositories that are not needed when it is cloned recursively.
2022-01-04 16:34:31 +01:00
Gunar Schorcht
3492a36cf6 cpu/esp_common: common periph features moved to cpu/esp_common 2021-12-23 10:35:07 +01:00
benpicco
2bb2dc35d2
Merge pull request #17420 from gschorcht/cpu/esp/revert_change_for_esp_wifi_passphrase
cpu/esp: revert the change for default definition of ESP_WIFI_PASS
2021-12-20 17:05:45 +01:00
Gunar Schorcht
87a72e4dfe cpu/esp: revert the change for ESP_WIFI_PASS define
Previously, a default value for ESP_WIFI_PASS was intentionally defined only if DOXYGEN was also defined, to allow ESP_WIFI_PASS to be left undefined for using APs without authentication. With PR #17415 the definition was changed to always define a default value for EPS_WIFI_PASS.  This made it impossible to use APs without authentication. The commit reverts this change.
2021-12-19 07:39:46 +01:00
2c3e077bca
Merge pull request #17413 from gschorcht/cpu/esp32/support_clocks_2_and_40_MHz
cpu/esp32: support CPU clocks 2 MHz and 40 MHz
2021-12-18 21:58:34 +01:00
Jean-Pierre De Jesus DIAZ
466fdf5114
Merge pull request #17415 from gschorcht/cpu/esp/wifi_ap_dynamic_ssid_option
cpu/esp: change dynamic SSID option handling
2021-12-17 18:11:38 +01:00
Gunar Schorcht
5d00acc868 cpu/esp32/spi: support 2 MHz and 40 MHz APB clocks 2021-12-17 17:45:25 +01:00
Gunar Schorcht
8ac808e4fd cpu/esp: cleanup for dynamic SoftAP SSID option
The semantics of defining an SSID prefix that overrides the already defined SSID exactly when and only when it is set, and then enabling dynamic SSID generation with that prefix, made handling the parameter definition unnecessarily difficult and hard to understand.

Defining a boolean option that enables dynamic SSID generation, which then simply reuses the defined SSID as a prefix, makes it much more understandable and easier to handle, especially with respect to Kconfig.
2021-12-16 13:17:17 +01:00
Gunar Schorcht
0b4fb5a9ea cpu/esp32/i2c_sw: add delays for 2 and 40 MHz 2021-12-16 10:44:53 +01:00
Francisco Molina
4e6151bd7d cpu/esp*: migrate from xtimer to ztimer 2021-12-14 18:14:35 +01:00
Leandro Lanzieri
01e01c4597
cpu/esp_common: move LINKFLAGS to Makefile.include 2021-12-10 18:54:28 +01:00
Leandro Lanzieri
81b93c9b95
cpu/esp32/kconfig: move esp_wifi_enterprise feature to esp_common 2021-12-10 18:54:28 +01:00
Leandro Lanzieri
7a8f58ac4c
cpu/esp_common: model Kconfig 2021-12-10 18:54:07 +01:00
Leandro Lanzieri
831101eea5
cpu/esp_common/periph_flash: fix dependency 2021-12-10 18:51:27 +01:00
Benjamin Valentin
41a5b7ef7a core: change return type of irq_is_in(), irq_is_enabled() to bool
This only cleans up the API, no change in behavior or users of the API
is expected.
2021-12-08 15:53:15 +01:00
Gunar Schorcht
a66fef5bf5 cpu/esp_common: add bus clear for I2C on ESP32
On the ESP32 it is often not possible with the I2C software implementation to communicate with an AIP31068 based LCD module.  Therefore, the I2C hardware implementation is enabled when the AIP31068 driver is used, but it is more buggy than stable. The timing of the two implementations seems to be almost identical. The only difference is that the hardware implementation clears the bus before each access by sending 10 clock pulses on the SCL line while SDA is LOW. Using the same mechanism during I2C initialization for the software implementation solves the communication problem with the AIP31068.
The same software implementation works reliably with the AIP31068 on the ESP8266.
2021-12-06 22:02:30 +01:00
Gunar Schorcht
007e29ebb5 cpu/periph/i2c: update implementations to new I2C API
Make all `spi_acquire` implementations return `void` and add assertions to check for valid device identifier where missing.
2021-11-29 06:35:25 +01:00
Erik Ekman
e5d60176e4 cpu/esp: Suppress cppcheck errors
cpu/esp_common/syscalls.c💯 error (memleak): Memory leak: mtx
cpu/esp_common/syscalls.c:131: error (memleak): Memory leak: rmtx
cpu/esp_common/syscalls.c:365: error (comparePointers): Subtracting pointers that point to different objects

cpu/esp_common/thread_arch.c:355: error (comparePointers): Comparing pointers that point to different objects

cpu/esp8266/startup.c:59: error (comparePointers): Subtracting pointers that point to different objects
2021-11-25 13:08:51 +01:00
Marian Buschsieweke
cb6525b033
cpu/esp_common: fix unaligned access in periph_flashpage 2021-11-07 22:06:27 +01:00
Martine Lenders
098eeb1a2c
cpu/esp_common: suppress cppcheck false positives 2021-11-05 09:27:00 +01:00
Martine Lenders
f08989a3c8
core: make SCHED_TEST_STACK boolean and default to 1 with DEVELHELP 2021-11-05 09:27:00 +01:00
Gunar Schorcht
697c44811a
Merge pull request #16911 from yarrick/esp_jtag
cpu/esp32: Add openocd programming support
2021-10-26 01:24:27 +02:00
iosabi
7b1f083cd8 esp8266: Download Espressif RTOS SDK as a new RIOT PKG
RIOT-OS uses part of Espressif ESP8266 RTOS SDK to build support for
this CPU. The SDK includes some vendor-provided closed source
pre-compiled libraries that we need to modify to adapt to RIOT-OS
usage. This library modifications was done once and uploaded to a fork
of the vendor repository and was provided as an environment variable.

This patch changes two things:

1. It installs the SDK as a RIOT PKG from the new pkg/esp8266_sdk
directory instead of requiring the user to download it separately.

2. It performs the library modifications (symbol renames) on the pkg
Makefile removing the need to use a fork with the modifications applied
and simplifying the SDK update and future modifications.

This change sets the SDK package version (git SHA) to the same one that
our fork was using as a parent in the vendor repository, meaning that
the output libraries are exactly the same as before.

Tested with
```
ESP8266_RTOS_SDK_DIR=/dev/null USEMODULE=esp_log_startup make -C tests/shell BOARD=esp8266-esp-12x flash
```

and verified that the program works. The boot message now includes:
```
ESP8266-RTOS-SDK Version v3.1-51-g913a06a9
```
confirming the SDK version used.

`/dev/null` in the test is just to make sure that no evaluation of
`ESP8266_RTOS_SDK_DIR` in make is affected by the environment variable
value which would be set to the SDK for people who followed the set up
instructions before this change.

Tested the checkout size:
```bash
$ du -hs build/pkg/esp8266_sdk/
124M	build/pkg/esp8266_sdk/
```
2021-10-23 11:13:38 +00:00
Erik Ekman
3d7d211157 cpu/esp: Always create app.elf.bin and partitions.bin
Even if programmer is not esptool
2021-10-15 09:59:38 +02:00
Jean-Pierre De Jesus DIAZ
35d1a2fc02 cpu/esp*: fix doxygen grouping warnings
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2021-09-11 12:45:15 +02:00
Francisco
a1cbcc9ede
Merge pull request #15902 from maribu/spi-api-change-1
drivers/periph_spi: let spi_acquire return void
2021-09-02 08:50:56 +02:00
Marian Buschsieweke
f04b522601
cpu/periph_spi: update implementations to new API
Make all spi_acquire() implementations return `void` and add assertions to
check for valid parameters, where missing.
2021-09-01 21:38:40 +02:00
Hauke Petersen
5cdef474c2 cpu/esp_common: implement irq_is_enabled() 2021-08-25 08:01:05 +02:00
Jan Romann
4384795cb9
treewide: Remove excessive newlines 2021-08-13 19:50:38 +02:00
Marian Buschsieweke
6c4f0da7a7
cpu/esp_common: fix bootloop on ESP8266 2021-07-13 20:48:01 +02:00
Jose Alamos
4340047781
esp-wifi: avoid explicit cast to netdev 2021-07-09 10:38:34 +02:00
Jose Alamos
88dc962c3e
esp-now: avoid explicit cast to netdev 2021-07-09 10:38:34 +02:00
Marian Buschsieweke
a9dea12eb8
cpu/esp_common: add overflow detection to calloc
If esp_idf_heap is not used, implement calloc through a custom wrapper
function on top of malloc to add overflow detection, which is not
present in the newlib forks with xtensa support yet.
2021-05-10 15:29:48 +02:00
Marian Buschsieweke
2f08f676dc
cpu/esp_common: fix possible overflow in calloc implementation 2021-05-05 08:58:34 +02:00
benpicco
0c28ec57f2
Merge pull request #16386 from iosabi/esp8266_i2c
cpu/esp_common: Support disabling I2C clock stretching in ESP8266
2021-05-03 11:31:54 +02:00
iosabi
52107b2416 esp8266: Support UART1 and other UART0 pins.
The esp8266 CPU has actually two hardware UART peripherals. UART0 is
used by the boot ROM for flashing and serial output during boot,
typically at a baudrate of 74880 bps until the bootloader or application
sets the more standard 115200 baudrate. This UART0 device has two
possible pins for TXD, GPIO1 and GPIO2, which are both set to TXD by the
boot ROM. esp8266 modules will typically have GPIO1 labeled as the TX
pin, but it is possible to use GPIO2 for that purpose even while
flashing the device with esptool.py.

The second device, UART1, also has two options for TXD, GPIO2 and GPIO7,
and only one option for RXD, GPIO8. However, GPIO7 and GPIO8 are used
by the flash internally so those options are not very useful unless
maybe while running from IRAM with the flash disabled, for example for
a debugger over UART1.

This patch allows boards to override UART{0,1}_{R,T}XD in their
periph_conf.h to configure the uart selection. Defining UART1_TX will
make the UART_DEV(1) device available.

Tested with:

```CFLAGS='-DUART1_TXD=GPIO2' make -C tests/periph_uart BOARD=esp8266-esp-12x flash term```

* Connected one USB-UART to the standard GPIO1 and GPIO3 for flashing
  and console. After flashing we see the manual test output at 115200
  bps

* Connected a second USB-UART with RX to GPIO2 running at 74880.

Then run on the first console:
```
> init 1 74880
> send 1 hello
```

The word "hello" appears on the second UART connection.

Note that GPIO2 is used during boot for UART0's TX until the application
or bootloader set it to a regular GPIO, so some boot ROM messages at
74880 bps are visible. After running `init 1 74880` it is set to UART1's
TX.
2021-05-02 12:27:27 +00:00
iosabi
b1bd7bed67 cpu/esp_common: Support disabling I2C clock stretching in ESP8266
In I2C, clock stretching occurs when the controller stops driving SCL
down but the peripheral continues to drive SCL down until the value of
SDA that is expected to be set by the peripheral is ready. This allows a
peripheral to communicate at a high speed but introduce a delay in the
response (like an ACK or read) in some specific situations. Not all I2C
peripherals require I2C stretching, and in many cases SCL is only an
input to these peripherals.

Clock stretching is the only situation where a peripheral may drive down
SCL, which technically makes SCL an open-drain with a pull-up like SDA.
However, if clock stretching is not needed, SCL can be configured as an
output removing the need for a pull-up and specially, allowing to use
as SCL GPIO pins that otherwise have a pull-down connected. In
particular, GPIO15 in the ESP8266 requires an external pull-down during
boot for the ESP8266 to boot from the flash.

This patch allows a board to define `I2C_CLOCK_STRETCH` to 0 to disable
clock stretching and allowing to use GPIO15 as SCL.
2021-04-26 00:36:12 +02:00
b5794c2a22
cpu/esp: set esptool as supported programmer 2021-02-24 13:29:56 +01:00
Francisco Molina
63a2a6ce1b
treewide: model newlib as a FEATURE 2021-01-27 09:24:25 +01:00
Jens Wetterich
450ede0da0 cpu/esp_common: Add missing includes and ISO-C++ compatibility 2021-01-10 18:02:39 +01:00
Jens Wetterich
e36a0d883a esp_common/esp_now: use netdev_register() 2020-12-23 19:44:57 +01:00
d527ab6994
cpu: boards: esp: use common esptool makefile 2020-12-01 10:36:42 +01:00
Erik Ekman
2afa93c9f7 boards/esp32-ethernet-kit: Setup Kconfig to match makefiles 2020-11-28 10:18:54 +01:00
575189510d
Merge pull request #15465 from maribu/atomic-utils-volatile
sys/atomic_utils: Use volatile qualifier
2020-11-24 22:05:33 +01:00
Marian Buschsieweke
dd48ced151
cpu/*/atomic_utils_arch.h: Add volatile qualifier 2020-11-24 14:00:52 +01:00
ba28bf849c cpu/esp_common: add missing include for limits.h in freertos/task.h 2020-11-23 16:56:34 +01:00
Marian Buschsieweke
921bc7f6e0
cpu/esp*: Fix cast alignment issues
- Add `WORD_ALIGNED` attribute to potentially unaligned allocations
- Use intermediate cast to `uintptr_t` to silence false positives of
  `-Wcast-align`
2020-11-18 10:19:23 +01:00
792e031a95
Merge pull request #14331 from maribu/atomic_utils
sys/atomic_utils: Functions for atomic access
2020-11-12 21:44:53 +01:00
Marian Buschsieweke
ed6b88d5c4
cpu/esp_common: Add atomic_utils_arch.h 2020-11-10 10:55:13 +01:00
Bas Stottelaar
94171b7389 cpu/*: replace #if ENABLE_DEBUG with IS_ACTIVE 2020-11-02 21:34:12 +01:00
benpicco
b14e7544aa
Merge pull request #14117 from btcven/2020_05_22-esp_wifi_ap
cpu/esp: implement ESP WiFi SoftAP mode
2020-10-26 00:08:22 +01:00
Bas Stottelaar
22243aec7a cpu/*: realign ENABLE_DEBUG 2020-10-23 00:46:26 +02:00
Bas Stottelaar
bd34cf8fc0 cpu/*: reorder ENABLE_DEBUG after last include 2020-10-23 00:45:55 +02:00
Bas Stottelaar
fb61443bbd cpu/*: remove unused assert.h include 2020-10-22 11:13:09 +02:00
Bas Stottelaar
ab6188cea3 cpu/*: add missing include of assert.h 2020-10-22 11:13:08 +02:00
Bas Stottelaar
9d06bffbfb cpu/*: add explicit include of timex.h 2020-10-21 21:42:47 +02:00
Martine Lenders
45144fb4a4
treewide: use new gnrc_pkt API functions instead of utlist.h macros 2020-10-13 13:32:53 +02:00
c458bbceca
cpu/esp_common: fix typo 'implementd' -> 'implemented' 2020-10-02 07:57:00 +02:00
Marian Buschsieweke
bf13dc99fb
cpu/esp_common: Add architecture_arch.h 2020-09-29 12:34:00 +02:00
Jean Pierre Dudey
295a3665d2 cpu/esp: implement ESP SoftAP mode
This is an implementation of the ESP32 SoftAP mode using the
`esp_wifi_ap` pseudomodule.

Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2020-09-27 18:29:24 -05:00
Francisco
64f6b7ffa4
Merge pull request #14702 from maribu/sched_active_thread
treewide: Fix direct access to scheduler internals
2020-09-21 09:09:59 +02:00
Marian Buschsieweke
c5c62e93d3
cpu/esp_common: Declare sched_active_{thread,pid}
Declare sched_active_thread and sched_active_pid locally in the ESP code for
now. Once the code is cleaned up to no longer tap into scheduler internals but
use the API instead, those can be dropped again.
2020-09-07 12:59:55 +02:00
Leandro Lanzieri
81cb769cad
makefiles: avoid building archives when compiling 2020-09-04 15:01:10 +02:00
benpicco
b6a542668b
Merge pull request #14845 from fjmolinas/pr_driver_netdev_common
tests/driver_netdev_common: add netdev_default
2020-08-27 17:01:50 +02:00
Francisco Molina
c05dd9e6d3
treewide: change netdev driver dependencies against netdev_default
- gnrc_netdev_default depends on netdev_default, no need for checking
against both modules.
- fix documentation mentions of the double check
2020-08-27 11:46:25 +02:00