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

392 Commits

Author SHA1 Message Date
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
Gunar Schorcht
45c71f1a31 esp/esp*: move common code to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
7d701f6fa8 cpu/esp*: move common headers to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
53a3756e0c cpu/esp*: common Makfile* added 2020-02-21 09:09:34 +01:00
Gunar Schorcht
b132698cd5 cpu/esp*: move parition table tool to dist/tools/esptool
The same tool 'gen_esp32part.py' is used for the generation of partition tables on ESP8266 as well as n ESP32. The tool is therefore added to 'dist/tools/esptool'
2020-02-21 09:09:08 +01:00
benpicco
66c7c63c94
Merge pull request #13061 from gschorcht/cpu/esp32/rtc_xtal_32k
cpu/esp32: allow external 32 kHz crystal for the RTC hardware timer
2020-02-07 10:24:22 +01:00
Gunar Schorcht
4c0cfdcc8e cpu/esp32: allow external 32 kHz crystal for RTC 2020-02-07 00:46:16 +01:00
benpicco
5d1bf26f0c
Merge pull request #13076 from gschorcht/boards/esp32/ttgo_t_beam_gps
boards/esp32: enable GPS module on ESP32 TTGO T-Beam V1.0
2020-02-01 23:25:55 +01:00
Gunar Schorcht
3208207ec5 cpu/esp32: change order of board and periph init
To be able to access periphals to initialize board specific hardware, the board_init function has to be called after periph_init.
2020-02-01 16:12:05 +01:00
benpicco
d48471a120
Merge pull request #12967 from gschorcht/pkg/lwip/fix_esp_wifi
cpu/esp*: remove dependencies on GNRC for ESP network device drivers
2020-01-31 10:38:08 +01:00
Gunar Schorcht
0a5ab84363 cpu/esp32/esp_wifi: move gnrc specific code to separate file 2020-01-31 09:32:23 +01:00
Gunar Schorcht
845411e4d3 cpu/esp32/esp_wifi: remove gnrc specific code 2020-01-31 09:32:23 +01:00
Gunar Schorcht
fc0845b09c cpu/esp32/esp_eth: move gnrc specific code to separate file 2020-01-31 09:32:23 +01:00
Gunar Schorcht
ace3107975 cpu/esp32/esp_eth: remove gnrc specific code 2020-01-31 09:32:23 +01:00
Gunar Schorcht
f14c4c8c2f cpu/esp32: remove static dependency from gnrc 2020-01-31 09:32:23 +01:00
benpicco
57db6b7313
Merge pull request #13059 from gschorcht/cpu/esp32/fix_xtal_freq
cpu/esp32: activate automatic XTAL detection
2020-01-31 08:36:28 +01:00
Sören Tempel
5ef5ab7e4b Add CPU feature for stack smash protections 2020-01-22 15:59:02 +01:00
benpicco
24559ed3ea
Merge pull request #13142 from gschorcht/cpu/esp32/fix_compilation_esp_gdb
cpu/esp32: fix compilation when esp_gdb is enabled
2020-01-17 13:07:48 +01:00
Gunar Schorcht
20835aecd9 cpu/esp32: fix compilation when esp_gdb is enabled 2020-01-16 14:27:18 +01:00
Gunar Schorcht
416e8ce8e6 cpu/esp32: fix C linkage compilatio error
With the new toolchain version required to fix issue #13133, the compilation of `examples/posix_socket` fails due to a C linkage error in `atomic_base.h`. The reason is that including `drivers/include/mtd.h` in `boards/esp32/board_common.h` inside the `extern C` block finally leads to including `atomic_base.h` inside the `extern C` block which in turn to the C linkage error for the template definitions in this file.
2020-01-16 13:03:49 +01:00
benpicco
3672502f6f
Merge pull request #12998 from gschorcht/cpu/esp/common_sdk_log_output
cpu/esp: cleanup of ESP SDK log outputs
2020-01-15 15:08:02 +01:00
Francisco
1977423e9b
Merge pull request #13048 from maribu/adc-int32_t
periph/adc: Change return type of `adc_sample()` to `int32_t`
2020-01-13 12:56:09 +01:00
MichelRottleuthner
53cb3b087c
Merge pull request #9530 from Hyungsin/forupstream_xtimer
sys: xtimer concurrency/robustness improvement
2020-01-13 08:24:15 +01:00
benpicco
ab246a853d
Merge pull request #13004 from gschorcht/cpu/esp/lwip_default_esp_wifi
cpu/esp*: esp_wifi used as default netdev for lwip
2020-01-11 13:16:40 +01:00
Hyungsin
8661205c6d cpu/esp32: reflecting xtimer's member change 2020-01-10 13:21:33 -08:00
Marian Buschsieweke
746e4d2fba
cpu/esp32/periph: adc_sample() now returns int32_t 2020-01-10 14:13:14 +01:00
Gunar Schorcht
528512d9af cpu/esp32: activate automatic XTAL detection
ESP32 can be clocked with either a 40 MHz or 26 MHz crystal. Since most boards use a 40 MHz crystal, the configuration was previously fixed to a 40 MHz crystal. This commit changes the crystal from 40 MHz to automatic detection, allowing boards with a 26 MHz crystal like the Sparkfun ESP32 Thing DEV to be used.
2020-01-09 15:34:18 +01:00
Gunar Schorcht
6e31a0cb92 cpu/esp*: esp_wifi used as default netdev for lwip 2019-12-26 19:02:04 +01:00
Gunar Schorcht
25d04c4742 cpu/esp32: fixes and cleanups of RTC timer
- Unecessary definitions are removed.

- Since the 48-bit RTC hardware timer uses a RC oscillator as clock, it is pretty inaccurate and leads to a RTC time deviation of up to 3 seconds per minute. Therefore, a calibration during the boot time determines a correction factor for the 48-bit RTC hardware timer. Function _rtc_time_to_us uses now this correction factor and converts a raw 48-bit RTC time to a corrected time in microseconds. Thus, the 48-bit RTC timer becomes much more accurate, but it can't still reach the accuracy of the PLL driven 64-bit system timer. The Advantage of using RTC over 64-bit sydtem timer is that it also continues in deep sleep mode and after software reset.

- If the 64-bit system timer is used to emulate the RTC timer, it uses the RTC hardware timer to continue its operation after software .
2019-12-26 18:13:10 +01:00
Gunar Schorcht
21b2c8d334 cpu/esp32: introduce pseudomodule esp_rtc_timer
It is possible to use different timers as RTC timer for the periph_rtc module. Either the 48-bit RTC hardware timer is used directly or the PLL driven 64-bit system timer emulates a RTC timer. The latter one is much more accurate. Pseudomodule esp_rtc_timer controlls which timer is used. Only if esp_rtc_timer is enabled explicitly, the 48-bit RTC hardware timer is used. Otherwise the 64-bit sytstem timer is used to emulate the RTC timer.
2019-12-25 09:47:52 +01:00
Gunar Schorcht
9cf103e055 cpu/esp32: fix rtc_init and displaying system time
The explicit call of rtc_init during the CPU start was removed because rtc_init is called within the function periph_init. The display of the system time at startup had to be placed after the call to periph_init.
2019-12-25 09:47:52 +01:00
Gunar Schorcht
9b3095fd6b cpu/esp32: system_get_time_ms cleanup
There is an existing function that returns the system time in us as a 64 bit value. Converting this 64 value in us to a 32 bit value in ms is more easier and uses the complete 32 bit range. Using only the low part of the 64 bit system time in us and dividing it by 1e3 cuts the 32 bit range.
2019-12-24 14:35:37 +01:00
Gunar Schorcht
53139c067c cpu/esp32: make the level for wifi log outputs settable 2019-12-20 17:58:58 +01:00
Gunar Schorcht
1899c257b7 cpu/esp_common: functions for SDK log outputs
To control the log level and the format of the log output of SDK libraries, a bunch of library-specific printf functions are realized which map the log output from SDK libraries to RIOT's log macros.
2019-12-20 17:58:58 +01:00
Gunar Schorcht
649bce4a46 cpu/esp*: cleanup the log level for init functions
The log level for normal information should be LOG_DEBUG.
2019-12-20 16:25:41 +01:00
Gunar Schorcht
7bf5bba564 cpu/esp_common: LOG_TAG macro for DEBUG_ALL
LOG_TAG macro is required for LOG_VERBOSE level in ESP SDK log output handling.
2019-12-20 16:25:41 +01:00
Gunar Schorcht
40b878ebfa cpu/esp32: unify esp_wifi log output 2019-12-20 16:25:41 +01:00
benpicco
50f5060e90
Merge pull request #12948 from gschorcht/pkg/lwip/lwipopts_fix_cleanup
pkg/lwip: overiddable settings in lwipopts.h
2019-12-16 10:43:34 +01:00
benpicco
8c4498ad8e
Merge pull request #12950 from gschorcht/cpu/esp32/lwip_eth
pkg/lwip: add support for esp32 Ethernet device
2019-12-16 10:33:47 +01:00