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

730 Commits

Author SHA1 Message Date
benpicco
ba37e93bd6
Merge pull request #18267 from gschorcht/cpu/esp32/periph_hal_esp32_timer
cpu/esp32: use ESP-IDF timer HAL for system timer and watchdog
2022-07-10 23:08:57 +02:00
Marian Buschsieweke
29d21938aa
Merge pull request #18210 from maribu/cpu/esp32
cpu/esp32: enforce MAXTHREADS is at least 3
2022-07-06 17:57:48 +02:00
Marian Buschsieweke
026854d788
cpu/esp32: make sure MAXTHREADS is at least 3
ESP32 has an esp_timer thread in addition to the main and the idle
thread. So applications that work fine with 2 threads on other
platforms will break on ESP32.
2022-07-06 09:00:13 +02:00
Marian Buschsieweke
d337997e5a
Merge pull request #18277 from gschorcht/cpu/esp/periph_hal_esp32_hwrng
cpu/esp_common: use ESP-IDF random API for ESP32
2022-07-04 19:02:58 +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
ae48cfca33 cpu/esp32: port periph/rtt_hw_sys to ESP-IDF timer HAL 2022-06-29 08:37:43 +02:00
Gunar Schorcht
5261a930bb cpu/esp32: port periph/rtt_hw_rtc to ESP-IDF interrupt HAL 2022-06-29 08:37:43 +02:00
Gunar Schorcht
7e19086a60 cpu/esp32: use ESP-IDF timer HAL for system timer in syscalls 2022-06-29 08:37:43 +02:00
Gunar Schorcht
0482eb1c90 cpu/esp32: use ESP-IDF timer HAL for peripheral timer definition 2022-06-29 08:35:38 +02:00
benpicco
b00810c0e5
Merge pull request #18266 from gschorcht/cpu/esp32/variant_indpependent_syscalls
cpu/esp32:  ESP32x SoC variant independent syscalls
2022-06-29 00:57:23 +02:00
benpicco
3b3c6d34b3
Merge pull request #18273 from gschorcht/cpu/esp32/periph_hal_esp32_cpuid
cpu/esp32: use ESP-IDF function esp_efuse_mac for CPU ID
2022-06-29 00:40:02 +02:00
Gunar Schorcht
c03933d08c cpu/esp32: add ledc to ESP-IDF interface API 2022-06-28 18:28:27 +02:00
Gunar Schorcht
29199b20bd cpu/esp32: add gpio to ESP-IDF interface API 2022-06-28 16:43:22 +02:00
benpicco
1b2360e6da
Merge pull request #18261 from gschorcht/cpu/esp32/use_esp_idf_interrupt_handling
cpu/esp32: use ESP-IDF interrupt handling API
2022-06-28 16:37:11 +02:00
Gunar Schorcht
81caeb1bb1 cpu/esp32: add uart to ESP-IDF interface API 2022-06-28 16:25:10 +02:00
Gunar Schorcht
9065dcff14 cpu/esp32: port periph/cpu_id to ESP-IDF read_mac 2022-06-28 16:09:03 +02:00
Gunar Schorcht
4be0abf41a cpu/esp32: rename CPU_INUM_RTC to CPU_INUM_RTT 2022-06-28 07:30:59 +02:00
Gunar Schorcht
6bd6afbd22 cpu/esp32: use ESP-IDF for interrupt handling 2022-06-28 07:30:59 +02:00
Gunar Schorcht
50e7eaace3 cpu/esp32: ESP32x SoC variant independent syscalls 2022-06-27 09:13:10 +02:00
benpicco
dd574a45f2
Merge pull request #18253 from gschorcht/cpu/esp32/add_esp_idf_api
cpu/esp32: add ESP-IDF API
2022-06-26 15:36:28 +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
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
a1ba7b1207 cpu/esp32: add periph_ctrl to ESP-IDF interface API 2022-06-23 16:12:22 +02:00
Gunar Schorcht
de96a31e1f cpu/esp32: add ESP-IDF interface API
Implements an interface for ESP-IDF types and functions that are required by RIOT-OS but cannot be included directly due to name conflicts.
f
2022-06-23 16:12:13 +02:00
Gunar Schorcht
1f25ac8893 cpu/esp32: ESP32 variant independent makefiles 2022-06-23 13:19:40 +02:00
Gunar Schorcht
09caa52074 cpu/esp32: variant independent bootloader makefile
Bootloader makefile that can be used for different ESP32x variants
2022-06-22 19:18:08 +02:00
benpicco
5350927111
Merge pull request #18239 from gschorcht/cpu/esp32/split_wpa_supplicant
cpu/esp32: split modul esp_wpa supplicant into several modules
2022-06-22 13:54:11 +02:00
benpicco
2895688a3d
Merge pull request #18224 from gschorcht/cpu/esp/freertos_changes_for_esp_idf_hal_ll
cpu/esp_common: FreeRTOS adaptation layer changes/extension required for ESP-IDF HAL/LL
2022-06-22 13:53:54 +02:00
Gunar Schorcht
b5c666f157 cpu/esp32: small doc fixes 2022-06-21 16:43:23 +02:00
Gunar Schorcht
b0bf595494 cpu/esp32: split esp_idf_wpa_supplicant into several modules 2022-06-21 16:28:41 +02:00
Gunar Schorcht
ee9f2e439d cpu/esp32: split esp_idf_wpa_supplicant into several modules 2022-06-21 16:28:28 +02:00
Gunar Schorcht
780fd9a815 cpu/esp_common/freertos: add timeout handling to xQueue 2022-06-20 21:23:47 +02:00
Gunar Schorcht
4dc5e86b2a cpu/esp32: remove libc_gettimeofday dependency 2022-06-18 16:35:11 +02:00
Gunar Schorcht
8796513ac1 cpu/esp32: add missing newlibc function _gettimeofday_r 2022-06-18 16:34:40 +02:00
benpicco
809f9ed174
Merge pull request #18207 from gschorcht/cpu/esp32/fix_shell_reboot
cpu/esp32: fix pm_reboot function
2022-06-16 16:47:31 +02:00
Gunar Schorcht
0622d45949 cpu/esp32: fix pm_reboot function 2022-06-16 13:40:08 +02:00
Gunar Schorcht
041fe58209 cpu/esp32: add malloc_thread_safe if esp_idf_heap not used 2022-06-15 07:31:02 +02:00
Benjamin Valentin
73e1b3df89 pkg/esp32_sdk: Update version to 4.4.1
Use the latest tagged release of the SDK.
2022-06-05 11:53:31 +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
79706604aa cpu/esp32: update of sdkconfig.h as required for ESP-IDF 4.4 2022-06-01 13:31:00 +02:00
Gunar Schorcht
587e007a31 ecp/esp32: changes in periph_can for ESP-IDF v4.4 2022-06-01 13:31:00 +02:00
Gunar Schorcht
24162af90a cpu/esp32: small doc fix 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
e8b4a4feb2 cpu/esp32: changes for ESP-IDF v4.4 2022-06-01 13:28:49 +02:00
Gunar Schorcht
61bf3d2384 cpu/esp*: update/cleanup stack sizes 2022-06-01 13:27:31 +02:00
Gunar Schorcht
d7382ab063 cpu/esp32: fix compilation problems with ESP-IDF v4.4 2022-06-01 13:27:31 +02:00
Gunar Schorcht
2541587eee cpu/esp32: small fix in comment of periph/timer 2022-06-01 13:27:31 +02:00
Gunar Schorcht
48567c8ce0 cpu/esp32: small cleanup in periph/pwm 2022-06-01 13:27:31 +02:00
Gunar Schorcht
ec5993d888 cpu/esp32: changes in irq_arch for ESP-IDF v4.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
Gunar Schorcht
3e4dc10740 esp/esp32: changes in esp_eth for ESP-IDF v4.4 2022-06-01 13:21:29 +02:00
Gunar Schorcht
ab14b68ea0 cpu/esp32: update of linker scripts for ESP-IDF v4.4 2022-06-01 13:21:29 +02:00
Gunar Schorcht
751a958529 cpu/esp32: add modules for compilation of required ESP-IDF code
The code required by the ESP-IDF is compiled directly from source in the `esp32_sdk` package. The compilation is structured by modules for easier use.
2022-06-01 13:21:29 +02:00
Gunar Schorcht
357eaa434a cpu/esp32: update sys/lock.h for retargetable locking
ESP-IDF version 4.4 already provide all locking definitions if retargetable locking is enabled.
2022-05-18 07:27:23 +02:00
Gunar Schorcht
9ae4b1ca7d cpu/esp32: remove vendor code 2022-05-18 07:27:23 +02:00
Benjamin Valentin
b0bedabbed cpu/esp32: use pthread module if module cpp is used (Kconfig)
Same as b424633016 but for Kconfig
2022-05-17 23:38:08 +02:00
Gunar Schorcht
c3c3de2ec2 cpu/esp32: gcc 8.4.0 requires that inline functions are declared static 2022-05-13 18:57:22 +02:00
Gunar Schorcht
b424633016 cpu/esp32: use pthread module if module cpp is used 2022-05-13 18:56:17 +02:00
Francisco Molina
a4bbb74371 cpu/esp32: always include libc_gettimeofday 2022-04-28 09:51:19 +02:00
Benjamin Valentin
0340ac6129 cpu: include IDLE in PM_NUM_MODES 2022-04-06 12:29:25 +02:00
Gunar Schorcht
1c666c5955 kconfig: add ST L3Gxxxx 3-axis gyro family 2022-03-18 06:34:54 +01:00
Gunar Schorcht
421fb6dedd cpu/esp32: update the doc for Espressif's ESP32 vendor toolchain 2022-03-10 05:31:04 +01:00
Gunar Schorcht
92b7b8a3d7 cpu/esp32: disable the use of newlib's pthread headers 2022-03-10 05:31:04 +01:00
Gunar Schorcht
12d0cc9e99 cpu/esp32: enable _NANO_FORMATTED_IO for Espressif's GCC 8.4.0 2022-03-08 09:31:42 +01:00
Gunar Schorcht
395ec06c16 dist/tools/esptool: upgrade to v3.2 for ESP32 2022-03-08 09:31:42 +01:00
Leandro Lanzieri
74c8893a4f
cpu/esp32/esp-eth: move GNRC auto init to init_devs 2022-03-04 09:41:18 +01:00
Benjamin Valentin
3977023700 boards/esp32-*: drop custom board_init() 2022-02-22 18:27:37 +01:00
PeterKietzmann
b348c9ff11 cpu/esp32: enable puf_sram feature 2022-02-17 11:08:11 +01:00
Francisco Molina
c1238ad4e4 cpu/esp: model missing modules 2022-02-09 16:50:04 +01:00
Gunar Schorcht
c0dc6ccc71 cpu/esp32: set SDK configuration dependent on newlib_nano module 2022-01-25 00:37:08 +01:00
Gunar Schorcht
fdabe050ed cpu/esp32: skip inclusion of toolchain pthread types
The toolchain provides POSIX type definitions for pthread which conflicts with that in RIOT. With the CFLAGS/CXXFLAGS skip the inclusion of the types shipped by the toolchain.
2022-01-25 00:36:51 +01:00
Gunar Schorcht
2ccfb145a1 cpu/esp32: add missing POSIX functions 2022-01-25 00:36:51 +01:00
Gunar Schorcht
1d20f88bb0 cpu/esp32: set stdout/stderr to be non-buffering 2022-01-25 00:36:51 +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
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
Gunar Schorcht
183562b947
Merge pull request #16341 from fjmolinas/pr_esp_rename_clock_coreclock
cpu/esp32: use macros/units
2022-01-17 15:22:23 +01:00
Francisco Molina
b9d1461b38 cpu/esp32: use macros/units 2022-01-17 12:28:11 +01:00
Gunar Schorcht
60793f14ae cpu/esp*/vendor: remove -std=c++11 2022-01-13 17:50:59 +01:00
Gunar Schorcht
2e820a09fc cpu/esp32: print SDK version with esp_log_startup 2022-01-04 16:35:47 +01:00
Gunar Schorcht
81727fb1f1 pkg/esp32_sdk_libs: add ESP SDK 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
f9105c3cc1 cpu/esp32: use INCLUDES as defined in pkg/esp32_sdk
The include pathes for the ESP32 SDK are now defined by `pkg/esp32_sdk`. They can be used in Makefiles directly.
2022-01-04 16:34:31 +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
1a3f2d908a
Merge pull request #17424 from gschorcht/cpu/esp/kconfig_cpu_frequency
cpu/esp: integrate CPU clock frequency selection in Kconfig
2022-01-04 12:06:56 +01:00
05da606ea6
Merge pull request #17438 from gschorcht/cpu/esp/feature_cleanup
boards/esp* and cpu/esp: feature definition cleanup
2022-01-04 10:51:33 +01:00
Gunar Schorcht
523bcec8ee cpu/esp*: small documentation fixes
Only formatting issues solved, no content changes.
2021-12-30 14:43:31 +01:00
Gunar Schorcht
27decbc6c1 cpu/esp32: common periph features moved to cpu/esp_common 2021-12-23 10:34:25 +01:00
Gunar Schorcht
f6831f34fb cpu/esp32: add CPU frequency selection to Kconfig
t
2021-12-19 12:20:14 +01:00
Gunar Schorcht
f01e0804ff cpu/esp32: remove the duplicate ESP_HAS_SPI_RAM 2021-12-19 12:19:59 +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
470208e685 cpu/esp32/i2c_hw: assert added for unsupported I2C clock speeds
The former correction factors were determined by measuring the resulting clocks without a device connected to the bus.

However, when testing the changes for low CPU clock frequencies, it was figured out that the clocks not only depend on configured register values

    _i2c_hw[dev].regs->scl_low_period.period
    _i2c_hw[dev].regs->scl_high_period.period

but also on the bus capacity. Obviously, the register values are not absolute times in APB clock cycles, but rather times that start as soon as the corresponding level is reached. In this case, the higher the bus capacity, the longer the period would be.

This means that the clock speed cannot be precisely controlled via the correction factors anyway. For this reason, and because the I2C implementation in ESP-IDF also does not use correction factors, they were removed.
2021-12-17 17:44:27 +01:00
Gunar Schorcht
effc49f864 cpu/esp32: small documentation fix 2021-12-16 13:18:52 +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
2e74e5e3b9
cpu/esp32: include sdk_conf.h in periph_cpu.h
This allows access to CLOCK_CORECLOCK from periph_conf.h which is used by clk.h
2021-12-15 13:14:19 +01:00
Francisco Molina
4e6151bd7d cpu/esp*: migrate from xtimer to ztimer 2021-12-14 18:14:35 +01:00
Gunar Schorcht
85313ccc02
Merge pull request #17232 from leandrolanzieri/pr/cpu/esp/model_kconfig
cpu/esp{32,8266}: model kconfig
2021-12-11 08:53:31 +01:00
benpicco
13f03ad161
Merge pull request #17314 from gschorcht/boards/esp/compile_optional_modules
cpu/esp: compile optional modules in CI
2021-12-10 19:28:24 +01:00
Leandro Lanzieri
a685e037c7
cpu/esp32: check for cpp module instead of used feature 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
281519881e
cpu/esp32: fix esp_jtag dependency
In order to work properly dependencies should be placed on the
Makefile.dep files, not on Makefile.include.
2021-12-10 18:54:27 +01:00
Leandro Lanzieri
53134d0474
cpu/esp32: require esp_spi_ram feature to use the module 2021-12-10 18:54:27 +01:00
Leandro Lanzieri
9f31dfe28a
cpu/esp32: refactor esp_spi_ram feature
This feature is provided by all esp32_wrover% models, so group it in the
common file.
2021-12-10 18:54:27 +01:00
Leandro Lanzieri
bfdfbb1a48
cpu/esp32: model Kconfig 2021-12-10 18:54:07 +01:00
Leandro Lanzieri
59d3f0bcc6
cpu/esp32: remove unneeded crypto dependencies 2021-12-10 17:34:19 +01:00
Leandro Lanzieri
252c3886b0
cpu/esp32: do not expand USEMODULE 2021-12-10 17:34:16 +01:00
Marian Buschsieweke
d59d9c27d7
cpu/esp32/periph_can: use container_of()
This silences false positives of -Wcast-align
2021-12-03 10:12:35 +01:00
Marian Buschsieweke
d31b1f4854
cpu/esp32: disable -Wcast-align for vendor code 2021-12-03 10:12:32 +01:00
Gunar Schorcht
7da115f9e6 cpu/esp32: fix esp_hw_counter compile problem 2021-12-02 06:17:48 +01:00
Gunar Schorcht
6123cde033 cpu/esp32: cleanup of pseudomodule definition 2021-12-02 06:17:48 +01:00
Gunar Schorcht
09c0341442 cpu/esp32: fix esp_wifi_enterprise compilation problem
With the change from using archive files to using object files in PR #14754, the module `esp_wifi_enterprise` was no longer compilable. The reason for this was that the file `bignum.c` was present in two different vendor sub-directories and created two identical object files, which then led to a symbol conflict when linking. This commit removes one of these identical files. The one that is used in all `esp_wifi` variants is kept, the one that is only used in `esp_wifi_enterprise` is dropped.
2021-12-01 11:25:57 +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
Benjamin Valentin
3d8e0d7f43 cpu/esp32: fix cast to periph type 2021-11-18 10:14:51 +01:00
Francisco
691601fbe2
Merge pull request #17087 from gschorcht/cpu/esp32/fix_code_placement
cpu/esp32: place freertos and periph in IRAM
2021-11-18 10:05:25 +01:00
Marian Buschsieweke
b2f9e2c226
cpu/esp32: fix wrong control flow 2021-11-17 13:10:37 +01:00
Marian Buschsieweke
e46c1f732e
cpu/esp32: make CI happy 2021-11-17 13:10:37 +01:00
Gunar Schorcht
aecc516ce9 cpu/esp32: place freertos and periph in IRAM
The IRAM is much faster, while the IROM is much slower and can only be accessed via a cache, which is also sometimes disabled, e.g. by the WiFi module or when writing to the flash. Therefore, time-critical code as well as code that has to work even when the cache is disabled must be placed in the IRAM.
2021-10-30 14:46:57 +02:00
Erik Ekman
cbfe502cc6 cpu/esp32: Reset when starting debugging
To avoid 'Target not examined yet' error
2021-10-18 20:11:32 +02:00
Erik Ekman
1c6d7dcdaf tools/openocd: Make verifying flashed image optional
Checksumming flash is not supported on xtensa platform:

Warn : not implemented yet

make: *** [.../RIOT/examples/saul/../../Makefile.include:796: flash] Error 1
2021-10-15 10:13:25 +02:00
Erik Ekman
2df7d499c8 tools/openocd: Export IMAGE_OFFSET only when flashing 2021-10-15 10:12:40 +02:00
Erik Ekman
d47aa2d550 cpu/esp32: Flash bootloader, partition and app via openocd
https://github.com/espressif/openocd-esp32 is needed.

Example config (when compiled from source):
export OPENOCD="~/esp/openocd-esp32/src/openocd -s ~/esp/openocd-esp32/tcl"
2021-10-15 10:00:57 +02:00
Marian Buschsieweke
94921942d3
cpu/esp32/doc: Restore center alignment of tables 2021-10-13 14:56:00 +02:00
Marian Buschsieweke
8d1d00776c
cpu/esp32: Fix documentation format
Fix various issues with incompatibilities to flavor of markdown
supported by Doxygen and re-format text.
2021-10-10 21:35:30 +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
Jan Romann
4384795cb9
treewide: Remove excessive newlines 2021-08-13 19:50:38 +02:00
Jose Alamos
0e65605c39
esp-eth: 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
Benjamin Valentin
6d42c9fcfe cpu: make newlib_nano a DEFAULT_MODULE
This allows to disable nanospecs with

    DISABLE_MODULE += newlib_nano

if a full-features version of newlib is desired.
2021-05-04 12:12:36 +02:00
Benjamin Valentin
d47a880915 cpu: add periph_rtt_overflow feature
The RTT overflow callback is not available on all RTT implementations.
This means it is either a no-op or `rtt_set_overflow_cb()` is a no-op
or it will overwrite the alarm set with `rtt_set_alarm()`.

This adds a feature to indicate that proper overflow reporting is available.
2021-04-30 11:58:00 +02:00
Francisco Molina
5ae5c40f26
cpu/esp*: add CLOCK_CORECLOCK 2021-04-21 08:54:43 +02:00
Marian Buschsieweke
ab89234040
drivers/periph/rtt: add periph_rtt_set_counter feature
Some periph_rtt implementations do not provide `rtt_set_counter()`. This
adds `periph_rtt_set_counter` as feature to allow testing for its
availability. The feature is provided at CPU level if periph_rtt is
provided by the board for all CPUs implementing `rtt_set_counter()`.
2021-03-08 14:16:46 +01:00
Marian Buschsieweke
b9cb75fedf
drivers/periph/rtt: add periph_rtt_set_counter feature
Some periph_rtt implementations do not provide `rtt_set_counter()`. This
adds `periph_rtt_set_counter` as feature to allow testing for its
availability. The feature is provided at CPU level if periph_rtt is
provided by the board for all CPUs implementing `rtt_set_counter()`.
2021-03-04 18:05:06 +01:00
Erik Ekman
95196fb7e4 esp32/eth: Don't overwrite queued event with RX packet
If there is an event to be handled by _esp_eth_isr(), don't
overwrite it if a new packet has been received.

In my testing, all SYSTEM_EVENT_ETH_CONNECTED events except the first
are immediately followed by at least one SYSTEM_EVENT_ETH_RX_DONE event.
This causes the SYSTEM_EVENT_ETH_CONNECTED to not get handled, and the
IP stack will not be notified of the new link state.

Protect the other events by dropping the packet instead. If an earlier
unhandled SYSTEM_EVENT_ETH_RX_DONE event exists, overwrite it with the
newer packet.

I only saw this happen with lwIP and not with GNRC - I am not sure why.
But it still is a race waiting to happen. The nice long term solution
is probably to have a queue of unhandled events, allowing them all to
be processed once there is time.
2021-02-24 01:20:43 +01:00
430770886b
make/esptool: fix FFLAGS inclusion order for qemu 2021-02-22 10:35:38 +01:00
858b5ca6ed xfa: remove obsolete empty xfa.ld 2021-02-18 10:46:08 +01:00
2474fa7af5 cpu/esp32: add XFA support 2021-02-18 10:46:08 +01:00
Benjamin Valentin
9c1455d55f cpu: make pm_layered a DEFAULT_MODULE
Allow to disable pm_layered in the bootloader to save some ROM.
2021-01-27 13:21:20 +01:00
Francisco Molina
63a2a6ce1b
treewide: model newlib as a FEATURE 2021-01-27 09:24:25 +01:00
Erik Ekman
1d6aa2e865 cpu/esp32: Add newline to emac_main debug prints 2021-01-21 20:55:02 +01:00
189f7d862d
cpu/esp32: fix typo in timer documentation 2021-01-08 12:04:24 +01:00
b4458e73f2
cpu/esp32: fix typo in Doxygen comment
depenend => depend
2021-01-08 10:15:32 +01:00
Erik Ekman
2afa93c9f7 boards/esp32-ethernet-kit: Setup Kconfig to match makefiles 2020-11-28 10:18:54 +01:00
Erik Ekman
064f58e7aa boards/esp32: add ESP32-Ethernet-Kit v1.2 board 2020-11-28 10:18:54 +01:00
Erik Ekman
db91be6ef8 cpu/esp32: add esp_jtag pseudomodule and feature
Available on esp32-wrover-kit and esp32-ethernet-kit boards.
2020-11-28 10:18:54 +01:00
Erik Ekman
e3142c39f0 boards/esp32: add ESP32-Ethernet-Kit board
Mostly copied from esp32-wroom-kit and Ethernet part from
esp32-olimex-evb.

Ethernet and serial port has been tested (on v1.2 board).
2020-11-28 10:18:54 +01:00
Erik Ekman
f28de6a544 cpu/esp32: add support for IP101G Ethernet phy
As used in ESP32-Ethernet-Kit board:
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/hw-reference/esp32/get-started-ethernet-kit.html

Inspired by existing code for lan8720 PHY as well as latest ESP32 code:
https://github.com/espressif/esp-idf/blob/master/components/esp_eth/src/esp_eth_phy_ip101.c

Phy datasheet available: http://www.bdtic.com/ICplus/IP101G.html
2020-11-28 10:15:14 +01:00
Bas Stottelaar
94171b7389 cpu/*: replace #if ENABLE_DEBUG with IS_ACTIVE 2020-11-02 21:34:12 +01:00
Marian Buschsieweke
125c892c03
drivers/periph/timer: Use uint32_t for frequency
For all currently supported platforms `unsigned long` is 32 bit in width. But
better use `uint32_t` to be safe.
2020-10-30 22:02: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
ab6188cea3 cpu/*: add missing include of assert.h 2020-10-22 11:13:08 +02:00
Leandro Lanzieri
837ddf6d8c
cpu/esp32/ld: use folder name instead of archive for module objects 2020-10-09 13:29:51 +02:00
Vincent Dupont
c498bbdc83 esp32/can: include can_esp.h from periph_cpu.h 2020-09-30 12:59:03 +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
Cenk Gündoğan
0d0bc91553
Merge pull request #14754 from leandrolanzieri/pr/no_archives
build system: link object files
2020-09-10 09:36:29 +02:00
Marian Buschsieweke
7c1949341e
build system: Overwrite TARGET_ARCH per arch
Add `TARGET_ARCH_<ARCH>` for each architecture (e.g. `TARGET_ARCH_CORTEX` for
Cortex M) to allow users to overwrite the target triple for a specific arch
from ~/.profile or ~/.bashrc (or the like) without overwriting it for all others
as well.
2020-09-08 22:28:41 +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
benpicco
a455d74621
Merge pull request #14729 from gschorcht/cpu/esp32/vendor_dependeny_boarddir
cpu/esp32: remove the dependency of vendor code on BOARDDIR
2020-08-07 17:03:40 +02:00
Gunar Schorcht
d19a1f5af5 cpu/esp32: remove the dependency of vendor code on BOARDDIR 2020-08-07 16:09:12 +02:00
Gunar Schorcht
2ed4486f21 cpu/esp32: cleanup of C++ hacks
Since former ESP32 toolchain versions used POSIX threads, module `pthread` was required. The built-in `cxa_ctor_guards` had to be replaced since they used the `pthread_once` function for singleton objects initialization where the parameter `once` was of incompatible type with that provided by RIOT's `pthread` module. The current ESP32 toolchain version no longer uses POSIX threads. The dependency on module `pthread` as well as according C++ hacks can be removed.
2020-07-29 10:14:57 +02:00
Gunar Schorcht
fb47f094d3 cpu/esp32: support multiple heaps for newlib
Several unsused DRAM sections are added to the heap.
2020-07-10 08:42:12 +02:00
benpicco
63a0014456
Merge pull request #14467 from benpicco/fix_file_permission
treewide: fix file permissions
2020-07-08 18:30:01 +02:00
Benjamin Valentin
9d836888c2 treewide: fix file permissions
C files should not be executable.
2020-07-08 17:32:36 +02:00
Leandro Lanzieri
0b0a03bef9
cpu/esp32: Add Kconfig symbols 2020-07-07 16:27:35 +02:00
Francisco Molina
e98341da93
Makefile: use normal conditionals 2020-06-29 22:40:29 +02:00
Benjamin Valentin
5da1a9e577 cpu/esp*: use TIMER_CHANNEL_NUMOF 2020-06-24 00:45:35 +02:00
benpicco
3a30db4029
Merge pull request #13895 from gschorcht/cpu/esp32/fix_i2c_gpio_32_33
cpu/esp32: fix GPIO32 and GPIO 33 as I2C pins
2020-05-25 22:37:35 +02:00
3b0510f9bc
Merge pull request #14077 from maribu/esp32-external-board
cpu/esp*: Allow compilation with external boards
2020-05-14 21:16:54 +02:00
Francisco
1f9d299492
Merge pull request #13196 from HendrikVE/shell-readline-refactor
sys/shell: refactor readline function
2020-05-14 15:32:45 +02:00
Marian Buschsieweke
1dbcdd3d4b
cpu/esp32: Allow compilation with external boards
Replace `$(RIOTBOARD)/$(BOARD)` with `$(BOARDDIR)`, which also works for
external boards.
2020-05-14 13:32:19 +02:00
Francisco Molina
bd3eff3537 cpu/esp32: switch from O2 to Os
In #12955 optimization was switched to O2 because with the '-Os'
option, the ESP32 hangs sporadically in 'tests/bench*' if
interrupts where disabled too early by benchmark tests.

Since it hasn't been reproduced since and in #13196 O2 was causing
un-explained hardfaults, since the aforementioned issue could not
be reproduced we switch back to Os by removing O2, as Os will be
used by default.
2020-05-06 18:46:43 +02:00
Martine Lenders
ad89680c40
Merge pull request #14004 from gschorcht/cpu/esp32/fix_newlib_nano_printf_float
cpu/esp32: fix printf for float with newlib-nano
2020-05-02 20:43:00 +02:00
Gunar Schorcht
5fbf74b203 cpu/esp32: fix printf for float with newlib-nano 2020-05-02 16:56:29 +02:00
benpicco
99e8b04921
Merge pull request #13812 from gschorcht/cpu/esp32/fix_newlib_nano
cpu/esp32: use module newlib_nano
2020-05-01 14:40:02 +02:00
Gunar Schorcht
bb51fbb7ec cpu/esp32: fix GPIO32 and GPIO 33 as I2C pins
GPIO32 and GPIO33 are used during boot to start an 32.768 kHz XTAL if it is connected to these GPIOs. If the 32.768 kHz XTAL is not connected, these pins can be used digital IO. However, the 32.678 kHz XTAL has to be disabled explicitly in this case. Furthermore, the handling of GPIOs greater than GPIO31 had to be fixed in I2C software implementation.
2020-04-17 18:46:15 +02:00
Gunar Schorcht
ce431b2343 cpu/esp32: use RTT based RTC implementation 2020-04-07 09:12:44 +02:00
Gunar Schorcht
0e7eb48d6a cpu/esp32: use RTT instead of RTC in pm_layered 2020-04-07 09:12:44 +02:00
Gunar Schorcht
f67cb48f6d cpu/esp32: add RTT counter implementation
fixup! cpu/esp32: add RTT counter implementation
2020-04-07 09:12:44 +02:00
Gunar Schorcht
f2e776bd3f cpu/esp32: use module newlib_nano 2020-04-04 13:37:22 +02:00
Gunar Schorcht
6cd9896ac0 cpu/esp: move BACKUP* attributes to esp_common 2020-04-03 18:07:12 +02:00
Gunar Schorcht
579de1a1e7 cpu/esp: deprecated NETOPT_LINK_CONNECTED renamed 2020-03-31 18:11:47 +02:00
Gunar Schorcht
aa3de05601 cpu/esp: fix netopt_enabled_t handling in esp_wifi/esp_eth 2020-03-31 18:11:36 +02:00
benpicco
7e85081ddc
Merge pull request #13748 from gschorcht/cpu/esp32/fix_wake_up_sources
cpu/esp32: fix wake-up sources for sleep modes
2020-03-29 17:38:54 +02:00
Gunar Schorcht
85b18a1c10 cpu/esp32: fix wake-up sources for sleep modes
When entering a sleep mode, all wake-up sources should first be disabled before the wake-up sources required for the sleep mode are then stepwise enabled again. Otherwise, an wake-up configuration of one sleep mode may affect the wake-up within another sleep mode.
2020-03-29 12:55:50 +02:00
benpicco
ad81a88bf0
Merge pull request #13676 from gschorcht/cpu/esp/netopt_channel
cpu/esp: add NETOPT_CHANNEL for esp_wifi and esp_now
2020-03-27 16:37:41 +01:00
Gunar Schorcht
331313db4f cpu/esp: NETOPT_CHANNEL for esp_wifi and esp_now 2020-03-26 14:46:15 +01:00
Martine Lenders
061eb88c05
Merge pull request #12994 from jia200x/pr/gnrc_netif_desc_alloc
gnrc_netif: implementation of dynamic GNRC_NETIF_NUMOF approach
2020-03-26 14:30:44 +01:00
Jose Alamos
67ed9defbe gnrc_netif_xxx_create: use external netif allocation 2020-03-26 11:12:23 +01:00
Gunar Schorcht
9b342432c4 cpu/esp32: use conditional expansion for INCLUDES and esp_eth 2020-03-26 01:41:36 +01:00
Leandro Lanzieri
881d245932
cpu/esp32: Evaluate esp_[now/wifi] modules with conditional expansion 2020-03-24 09:21:18 +01:00
Leandro Lanzieri
2f158d7d19
cpu/esp32: Evaluate cpp FEATURE with conditional expansion 2020-03-24 09:21:17 +01:00
Leandro Lanzieri
05c37edd42
cpu/esp32: Move default modules to Makefile.dep 2020-03-23 15:49:30 +01:00
Leandro Lanzieri
2b8976d935
cpu/esp32: Use periph_adc_ctrl as feature 2020-03-23 15:47:26 +01:00
Leandro Lanzieri
584d03aae0
cpu/esp32: Remove special module dependency resolution 2020-03-23 15:46:27 +01:00
Leandro Lanzieri
fa419ecf8e
cpu/esp32: Use cpp FEATURE in Makefile.include 2020-03-23 15:46:27 +01:00
benpicco
45b635f4c5
Merge pull request #13416 from gschorcht/cpu/esp32/pm_layered
cpu/esp32: support for light/deep sleep and pm_layered
2020-03-23 14:11:05 +01:00
Gunar Schorcht
4f977316fe cpu/esp_common: stop WiFi interface before sleep/reboot
The WiFi interface should be stopped before reboot or sleep. But stopping the WiFi interface disconnects an existing connection. Usually, esp_wifi_netdev tries to reconnect on an disconnect event. However, trying reconnect with a stopped WiFi interface may lead to a crash. Therefore, the stop event has to be handled.
2020-03-23 12:38:36 +01:00
Gunar Schorcht
09899e4b8d cpu/esp32/periph_gpio: funcs for enter/exit sleep 2020-03-23 12:38:36 +01:00
Gunar Schorcht
f4aa253645 cpu/esp32/periph_rtc: funcs for enter/exit sleep 2020-03-23 12:38:36 +01:00
Gunar Schorcht
dff74a3278 cpu/esp32: add pm_layered support 2020-03-23 12:38:36 +01:00
Gunar Schorcht
5ec4113893 cpu/esp32: several small doc fixes 2020-03-23 12:25:47 +01:00
Gunar Schorcht
a7652df499 cpu/esp32: function to set gpio drive strength 2020-03-23 12:25:47 +01:00
Gunar Schorcht
15ea6feeaf cpu/esp32: use hibernate mode for pm_off
Now, where the vendor files for light/deep sleep mode are added, function `pm_off` does not need to implement this mode by itself. Instead the existing deep sleep with disabled wakeup sources is used for pm_off.
2020-03-23 12:25:47 +01:00
Gunar Schorcht
3faf99a894 cpu/esp32: add vendor files for light/deep sleep 2020-03-23 12:25:47 +01:00
Gunar Schorcht
2cbf90d9fe cpu/esp32: small fix of rtc_init for light sleep
`rtc_init` is used after light sleep to update the system time from RTC timer. The fix corrects a small difference of about 230 ms which would sum up with each wakeup from light sleep.
2020-03-22 23:53:02 +01:00
Gunar Schorcht
825b01e8e1 cpu/esp32: remove gpio_config_sleep_mode func
The function were used to set the GPIO pads in sleep mode. This function isn't required for deep or light sleep.
2020-03-22 23:53:02 +01:00
benpicco
921a6a663e
Merge pull request #12024 from gschorcht/cpu/esp32/esp_wifi/wpa2_enterprise
cpu/esp32/esp wifi: add WPA2 enterprise mode with IEEE 802.1x/EAP authentication
2020-03-22 17:10:31 +01:00
Gunar Schorcht
c1e6e70015 cpu/esp32/esp_wifi: doc for WPA2 Enterprise mode 2020-03-22 15:47:06 +01:00
Benjamin Valentin
b8e18d521f cpu/esp32: define BACKUP_RAM attribute 2020-03-19 13:37:58 +01:00
Gunar Schorcht
ae647ed95f cpu/esp32/esp_wifi: Makefile integration for WPA2 Enterprise mode 2020-03-17 17:51:29 +01:00
c86ccfcf67 cpu: esp32: make THREAD_STACKSIZE_IDLE/DEFAULT configurable 2020-03-12 13:01:13 +01:00
Jose Alamos
3ad574a822 drivers/netdev: use netdev_trigger_event_isr function 2020-03-06 14:03:43 +01:00
benpicco
8e8cfbfe9c
Merge pull request #13516 from gschorcht/cpu/esp/fix_common_cpu_conf
cpu/esp_common: fixes common CPU configurations
2020-03-04 00:26:36 +01:00
Gunar Schorcht
9e372104f0
Merge pull request #13284 from benpicco/rtc_mktime
periph_common/rtc: add rtc_mktime() & rtc_localtime() helper functions for RTC implementations
2020-03-03 14:12:50 +01:00
Benjamin Valentin
1ca26adde8 cpu/esp32: rtc: use rtc_mktime() for Y2038k
By using a custom EPOCH for the RTC implementation, we can extend the
range of the 32 bit counter based RTC by 118 years.

It also reduces the code size compared to the stdlib based POSIX functions.
2020-03-03 11:01:02 +01:00
Gunar Schorcht
8b61c40fc8 cpu/esp32: add .noinit section to linker script 2020-03-01 11:04:18 +01:00
Gunar Schorcht
b89b4e2259 cpu/esp32: place libc functions in IRAM 2020-03-01 10:55:52 +01:00
Gunar Schorcht
085eb3f40c cpu/esp32: place common CPU functions to IRAM 2020-03-01 10:55:52 +01:00
Gunar Schorcht
0d451969c3 cpu/esp32: place newlib syscalls in IRAM 2020-03-01 10:01:34 +01:00
Gunar Schorcht
33fd259115 cpu/esp: platform heap_stats only used with esp_idf_heap 2020-02-29 12:21:09 +01:00
Gunar Schorcht
ef248b392d cpu/esp_comomon: rename cpu_conf.h to cpu_conf_common.h
To be able to define common configurations for all ESP CPUs, the CPU specific configuration cpu_conf.h has to include a common configuration. For that purpose cpu_conf.h in cpu/esp_common is renamed to cpu_conf_common.h and included in CPU specific configurations.
2020-02-29 12:07:12 +01:00
Gunar Schorcht
817446ae54 cpu/esp32/esp_wifi: enable crypto functions for WPA2 Enterprise 2020-02-23 10:09:48 +01:00
Gunar Schorcht
3d1a895c5b cpu/esp32/esp_wifi: wpa_supplicant files for WPA2 Enterprise mode
Add all files of wpa_supplicant from ESP32 SDK that are required for WPA2 Enterprise mode.
2020-02-23 10:09:48 +01:00
Gunar Schorcht
202758f400 cpu/esp32/esp_wifi: changes for wpa_supplicant in WPA2 Enterprise mode
`nvs_flash` functions have to be set to 0 if module `esp_idf_nvs_flash` is not enabled. Otherwise wpa_supplicant will crash in WPA2 Enterprise mode.
2020-02-23 10:09:48 +01:00
Gunar Schorcht
5b4389cf46 cpu/esp32: update of ld script for littlefs*
During the write access to the SPI flash, the IROM cache is not available and only code from the IRAM can be executed. Therefore, the code of file system implementations which access the SPI flash must reside in IRAM.
2020-02-22 01:35:07 +01:00
Gunar Schorcht
3230326652 cpu/esp32: fix esp_spi_ram dependency and flash mode setting 2020-02-21 10:14:03 +01:00
Gunar Schorcht
e869fbd30f cpu/esp32: remove periph_rtc from used modules
`periph_rtc` is no longer used by default.
2020-02-21 09:13:23 +01:00
Gunar Schorcht
350a0bbbb3 cpu/esp32: remove extra isync from periph/timer 2020-02-21 09:09:34 +01:00
Gunar Schorcht
71682bc7de cpu/esp32: remove unused periph_cpu.c 2020-02-21 09:09:34 +01:00
Gunar Schorcht
b6e9ecb9a7 cpu/esp32: remove esp_wifi 2020-02-21 09:09:34 +01:00
Gunar Schorcht
9723e3e3cf cpu/esp*: move freertos/task to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
61339001e7 cpu/esp*: move common freertos code to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
18659bdf26 cpu/esp*: move FreeRTOS headers to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
05faec7cf8 cpu/esp*: move periph/i2c_sw to esp/common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
0292f8b6a3 cpu/esp*: move periph/hwrng to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
d90164b19a cpu/esp*: move perioph/spi to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
66ee155562 cpu/esp*: move periph/flash to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
b0517c6733 cpu/esp*: move periph/uart to cpu/esp_common
tmp
2020-02-21 09:09:34 +01:00
Gunar Schorcht
39ee806d3c cpu/esp*: move some vendor/esp code to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
75d23e8458 cpu/esp*: common exception handling 2020-02-21 09:09:34 +01:00
Gunar Schorcht
90dc2ce846 cpu/esp*: common parts of syscalls in cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
4c466e54ec cpu/esp*: common irq_arch in cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
43b89a61eb cpu/esp*: move common parts of gpio_arch to cpu/esp_common 2020-02-21 09:09:34 +01:00