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

317 Commits

Author SHA1 Message Date
benpicco
0fff68dc9b
Merge pull request #18504 from gschorcht/cpu/esp32/add_esp32s2_support_in_kconfig
cpu/esp32: add ESP32-S2 support in Kconfig
2022-08-24 20:30:48 +02:00
Gunar Schorcht
0574f463bb cpu/esp_common/freertos: changes required for BLE 2022-08-24 18:02:21 +02:00
Gunar Schorcht
8ee714cc9b cpu/esp*: cleanup of CPU_ARCH* and CPU_CORE* 2022-08-24 17:15:37 +02:00
Gunar Schorcht
35676ca712 cpu/esp_common: fix of blocking mechanism in FreeRTOS queus
When FreeRTOS semaphores, as required by ESP-IDF, are used together with `gnrc_netif`, RIOT may crash if `STATUS_RECEIVE_BLOCKED` is used as a blocking mechanism in the FreeRTOS adaptation layer. The reason for this is that `gnrc_netif` uses thread flags since PR #16748. If the `gnrc_netif` thread is blocked because of a FreeRTOS semaphore, and is thus in `STATUS_RECEIVE_BLOCKED` state, the `_msg_send` function will cause a crash because it then assumes that `target->wait_data` contains a pointer to a message of type `msg_t`, but by using thread flags it contains the flag mask. This situation can happen if the ESP hardware is used while another thread is sending something timer controlled to the `gnrc_netif` thread.

To solve this problem `STATUS_MUTEX_LOCKED` is used instead of `STATUS_RECEIVE_BLOCKED` and `STATUS_SEND_BLOCKED`
2022-08-24 09:05:25 +02:00
Gunar Schorcht
26956a9a2b cpu/esp_common: use BLE as netdev_default if nimble_netif is used
To reduce the required RAM in default configuration, the BLE interface is used as netdev_default instead of ESP-NOW. Further network interfaces can be enabled with the modules `esp_now`, `esp_wifi` or `esp_eth`.
2022-08-24 09:05:25 +02:00
Gunar Schorcht
cdc8a725a4 cpu/esp_common/freertos: changes required for BLE 2022-08-24 09:03:38 +02:00
benpicco
00ede8f7d2
Merge pull request #18421 from gschorcht/cpu/esp32/add_esp32s3_cpu_support
cpu/esp32: add support for ESP32-S3
2022-08-22 17:33:05 +02:00
Marian Buschsieweke
276ad5716a
sys/net/gnrc/netif: allow checking if a netdev is legacy or new API
A if `netdev_driver_t::confirm_send()` is provided, it provides the
new netdev API. However, detecting the API at runtime and handling
both API styles comes at a cost. This can be optimized in case only
new or only old style netdevs are in use.

To do so, this adds the pseudo modules `netdev_legacy_api` and
`netdev_new_api`. As right now no netdev actually implements the new
API, all netdevs pull in `netdev_legacy_api`. If `netdev_legacy_api` is
in used but `netdev_new_api` is not, we can safely assume at compile
time that only legacy netdevs are in use. Similar, if only
`netdev_new_api` is used, only support for the new API is needed. Only
when both are in use, run time checks are needed.

This provides two helper function to check for a netif if the
corresponding netdev implements the old or the new API. (With one
being the inverse of the other.) They are suitable for constant folding
when only new or only legacy devices are in use. Consequently, dead
branches should be eliminated by the optimizer.
2022-08-17 12:56:07 +02:00
Gunar Schorcht
945a960fa7 cpu/esp32: add ESP32-S3 support in peripheral drivers 2022-08-17 02:04:07 +02:00
Gunar Schorcht
d42b20d49f cpu/esp_common: changes for ESP32-S3 2022-08-17 02:04:07 +02:00
Gunar Schorcht
43d71f276d cpu/esp32: add ESP32-C3 support in peripheral drivers 2022-08-05 22:26:22 +02:00
benpicco
cf745e954e
Merge pull request #18387 from gschorcht/cpu/esp32/cleanup_spi_flash_mode
cpu/{esp8266,esp32}: cleanup of SPI Flash configuration
2022-08-05 12:24:45 +02:00
Gunar Schorcht
da83c30021 cpu/esp_common: add netdev_register for NETDEV_ESP_WIFI 2022-08-02 09:34:59 +02:00
Gunar Schorcht
b4fafef6e7 cpu/esp_common: replace FLASH_MODE_* by CONFIG_*FLASHMODE_* defines
The former FLASH_MODE_{DOUT,DIO,QOUT,QIO} defines are replaced by the corresponding CONFIG_FLASHMODE_{DOUT,DIO,QOUT,QIO} and CONFIG_ESPTOOLPY_FLASHMODE_{DOUT,DIO,QOUT,QIO} as used by the ESP-IDF. This is also needed for the migration of defining flash mode in Kconfig.
2022-08-01 15:17:33 +02:00
Gunar Schorcht
cd3c053d32 cpu/esp32: qout mode is no longer required for SPI RAM 2022-08-01 15:11:11 +02:00
benpicco
8d42808f52
Merge pull request #18341 from gschorcht/cpu/esp32/add_esp32c3_makefile_support
cpu/esp32: add ESP32-C3 support in makefiles
2022-07-21 08:04:42 +02:00
benpicco
4ef8b34b8e
Merge pull request #18335 from gschorcht/cpu/esp32/cleanup_esp_log_for_esp32x_socs
cpu/esp32: cleanup of esp_log_write
2022-07-21 05:02:51 +02:00
Gunar Schorcht
0645371400 cpu/esp_common: rename architecture to riscv_esp32 to rv32 2022-07-20 17:18:56 +02:00
Gunar Schorcht
d6ecb74f96 cpu/esp32: cleanup of esp_log_write 2022-07-20 08:54:15 +02:00
Gunar Schorcht
a24ddb8517 cpu/esp*: cleanups mainly to reduce the vera++ warnings 2022-07-20 06:29:43 +02:00
benpicco
ad1d393214
Merge pull request #18319 from gschorcht/cpu/esp_common/module_xtensa_dependency_change
cpu/esp_common: MODULE_XTENSA has to depend on HAS_ARCH_ESP_XTENSA
2022-07-18 23:43:33 +02:00
benpicco
e1bc1767af
Merge pull request #18260 from gschorcht/cpu/esp32/add_riscv_platform_code
cpu/esp32: add platform code for RISC-V based ESP32x SoCs
2022-07-18 17:43:02 +02:00
benpicco
263b918d7c
Merge pull request #18316 from gschorcht/cpu/esp32/use_cpu_fam
cpu/esp32: use CPU_FAM and CPU_ARCH for ESP32x SoC variant dependent compilation
2022-07-18 15:43:59 +02:00
Gunar Schorcht
08cb7adf62 cpu/esp_common: MODULE_XTENSA has to depend on HAS_ARCH_ESP_XTENSA
ESP32x SoC use either Xtensa cores or RISC-V cores. The Xtensa vendor code has to be compiled only for ESP32x SoCs that are Xtensa-based. Therefore, MODULE_XTENSA has to depend on HAS_ARCH_ESP_XTENSA instead of HAS_ARCH_ESP
2022-07-18 14:44:02 +02:00
Gunar Schorcht
778ff10978 cpu/esp_common: add module esp_riscv to Kconfig 2022-07-18 13:52:13 +02:00
Gunar Schorcht
4b86ae3b5e cpu/esp_common: add module esp_riscv to makefiles 2022-07-18 13:51:33 +02:00
Gunar Schorcht
c4132573f4 cpu/esp_common: platform-specific code for RISC-V based ESP32x SoCs 2022-07-18 13:51:33 +02:00
Gunar Schorcht
d0bb51aacc cpu/esp*: move CPU_* definitions to CPU-specific Makefile.features 2022-07-18 13:05:21 +02:00
Gunar Schorcht
fd67f1402f cpu/esp_common: use CPU_ARCH in Makefile for compile options
To support ESP32x families, CPU_ARCH is used instead of CPU in Makefiles to define architecture dependent compile options.
2022-07-18 13:05:21 +02:00
Gunar Schorcht
55b8c15fe0 cpu/esp_common: use CPU_FAM_* instead of MCU_*
To support ESP32x families with the existing implementation, CPU_FAM_* is used instead of MCU_* in source code.
2022-07-18 13:05:21 +02:00
Gunar Schorcht
5f0ad453b2 cpu/esp_common: move ESP specific Kconfigs to ESP submenu 2022-07-18 09:51:45 +02:00
Gunar Schorcht
06aa8f2c42 cpu/esp_common: port periph/i2c_sw with calculated delays
Fixed delay values are replaced by calculated delays measured in CPU cycles in I2C software implementation. The advantage is that for each ESP SoC only a clock calibration offset has to be specified. The delay measured in CPU cycles are then then derived from current CPU frequency for the given bus speed. The disadvantage is that the calculated delays are not as precise as the predefined fixed delays.
2022-07-17 18:48:23 +02:00
benpicco
295f4a5b04
Merge pull request #18281 from gschorcht/cpu/esp32/periph_hal_esp32_spi
cpu/esp32: use ESP-IDF spi HAL for periph/spi
2022-07-15 13:25:50 +02:00
benpicco
1e8f3871fb
Merge pull request #18274 from gschorcht/cpu/esp32/periph_hal_esp32_uart
cpu/esp32: use ESP-IDF interrupt HAL for periph/uart
2022-07-15 10:58:46 +02:00
Gunar Schorcht
8f3df0eee6 cpu/esp_common: move periph/spi to cpu/esp8266
periph/spi implementation can be used for ESP8266 only from now. An implementation using the ESP-IDF spi HAL interface is required for ESP32x SoCs.
2022-07-15 08:57:16 +02:00
Gunar Schorcht
02310b1148 cpu/esp_common: port periph/hwrng to ESP-IDF random API 2022-06-30 11:10:02 +02:00
Gunar Schorcht
4b2b0047cc cpu/esp_common: port periph/uart to ESP-IDF uart API
This commit changes periph/uart to use ESP-IDF API for ESP32x SoCs. Furthermore, 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-28 16:25:24 +02:00
benpicco
cff1e3c2b6
Merge pull request #18259 from gschorcht/cpu/esp32/separate_xtensa_platform_code
cpu/esp32: move platform code for Xtensa-based ESP32x SoCs to module esp_xtensa
2022-06-26 15:13:52 +02:00
Gunar Schorcht
ea5d2b3a2e cpu/esp_common: add module esp_xtensa to Kconfig 2022-06-26 00:09:50 +02:00
Gunar Schorcht
6aafc1e362 cpu/esp_common: add module esp_xtensa to makefiles 2022-06-26 00:09:50 +02:00
Gunar Schorcht
b37c30378b cpu/esp_common: move exception xtensa code to module esp_xtensa
To allow a platform independent implementation of exceptions for different ESP32x SoC variants, the platform specific code for Xtensa based ESP SoCs is moved to a separate platform file `exception_xtensa.c`.
2022-06-25 23:22:59 +02:00
Gunar Schorcht
c6ee0aeccb cpu/esp_common: move irq_arch xtensa code to module esp_xtensa
To allow a platform independent implementation of irq_arch for different ESP32x SoC variants, the platform specific code for Xtensa based ESP SoCs is moved to a separate module `esp_xtensa`.
2022-06-25 23:22:59 +02:00
Gunar Schorcht
bb4a57e125 cpu/esp_common: move thread_arch xtensa code to module esp_xtensa
To allow a platform independent implementation of tread_arch for different ESP32x SoC variants, the platform specific code for Xtensa based ESP SoCs is moved to a separate module `esp_xtensa`.
2022-06-25 23:22:59 +02:00
Gunar Schorcht
8fabfbd6d9 cpu/esp_common: cleanup whitespaces in periph/flash 2022-06-25 08:12:31 +02:00
Gunar Schorcht
08cae6d4a8 cpu/esp_common: DEBUG messages with portable formatting 2022-06-25 08:12:31 +02:00
Gunar Schorcht
fb2f080fa7 cpu/esp_common: use ESP-IDF for ESP32 in periph/flash
Updates `cpu/esp_common/periph/flash` for ESP-IDF 4.4. `spi_flash_*` functions for ESP32 are removed since these functions are now used from ESP-IDF.
2022-06-25 08:12:31 +02:00
Gunar Schorcht
94ceccbe95 cpu/esp_common: inverse MCU_* conditionals in periph/flash
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-25 08:10:05 +02:00
benpicco
1870d38594
Merge pull request #18249 from gschorcht/cpu/esp32/variant_independent_makefiles
cpu/esp32: ESP32x SoC variant independent makefiles
2022-06-24 23:02:10 +02:00
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