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

435 Commits

Author SHA1 Message Date
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
Gunar Schorcht
aa3f1329bf pkg/lwip: remove TCPIP_THREAD_PRIO for ESP32
This definition is platform dependent and should be therefore done with CFLAGS in ESP332's Makefile.
2019-12-15 23:50:45 +01:00
Gunar Schorcht
f92c083528 cpu/esp32: fix compile error 2019-12-15 11:17:23 +01:00
Gunar Schorcht
2e4e3507bd cpu/esp32: change netopt in esp_eth for lwIP 2019-12-14 16:59:21 +01:00
Gunar Schorcht
be688f51c6 cpu/esp32: expose esp_eth_setup for lwIP 2019-12-14 16:59:21 +01:00
Gunar Schorcht
3235f18b22 cpu/esp32: expose eps_eth netdev for lwIP 2019-12-14 16:59:21 +01:00
Gunar Schorcht
e6db92567e cpu/esp32: esp_wifi send buffer should not be on stack
The buffer[EHTHERNET_MAX_LEN] used in _esp_wifi_send to convert the iolist of the given packet to a plain buffer for the WiFi interface should not be on the stack to prevent the sending thread's stack from overflowing.
2019-12-14 10:21:05 +01:00
855e249d8c
Merge pull request #12890 from gschorcht/cpu/esp/fix_tests_spiffs
cpu/esp*: fixes for tests/pkg_spiffs and tests/pkg_littlefs
2019-12-06 12:42:14 +01:00
Gunar Schorcht
35357b86a8 cpu/esp*: reduce test timeouts for spiffs/littlefs
To avoid that murdock times out before tests/pkg_spiffs and tests/pkg_littlefs time out, the configured test timeouts for these tests is reduced to 200 seconds which should be enough. An ESP32 needs an average of 60 seconds for these tests, while an ESP8266 needs in average 100 seconds.
2019-12-06 11:44:15 +01:00
Gunar Schorcht
95c6d1859c cpu/esp32: fix for crashes of tests/pkg_spiffs
ESP32 nodes can crash during SPI Flash write operations if required parts of the code are not in the IRAM but in the cached SPI Flash memory, which is disabled during the SPI Flash write operations. Therefore, the code of the SPIFFS package and the VFS module are now stored in the IRAM.
2019-12-06 11:44:15 +01:00
Gunar Schorcht
eb73358284 cpu/esp32: enable esp_log_startup on LOG_LEVL=4 2019-11-28 18:59:09 +01:00
Gunar Schorcht
91496b3cba cpu/esp32: add bootloaders without startup info
To reduce the information that are printed at the console during the startup, special bootloaders are required that suppress the outputs which are only informational. The according bootloader has to be selected during the make process.
2019-11-28 18:59:09 +01:00
Gunar Schorcht
8d25e6909e cpu/esp32: module to print startup info
Startup information, including board configuration, is only printed when module esp_log_startup is used. This reduces the amount of information that is printed by default to the console during the startup. The user can enable module esp_log_startup to get the additional startup information.
2019-11-28 18:59:09 +01:00
Gunar Schorcht
e3bb708e4d cpu/esp32/periph: flush UART TX FIFO before a baudrate change 2019-11-28 08:57:26 +01:00
Gunar Schorcht
83892aa184 cpu/esp32/periph: workaround for UART clock problems
The UART peripheral clock seems to be sporadically set to wrong value when the CPU clock is changed. In this case, the UART clock is not set to 115.200 kbps but to 96 kbps, so that the output in the console seems like garbage. This can also cause automatic tests to fail. Therefore, the CPU clock is only changed if CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ defines a different default CPU clock than the one already used at boot time.
2019-11-28 08:22:30 +01:00
benpicco
63e4d8ffa5
Merge pull request #12803 from gschorcht/cpu/esp32/fix_little_fs
cpu/esp32: fix to be able to use SPI flash drive with pkg_littlefs
2019-11-25 15:49:13 +01:00
Gunar Schorcht
4fe35efe2b cpu/esp32: mtd has to be in IRAM to work correctly 2019-11-25 07:24:17 +01:00
Gunar Schorcht
5f9e3b1a4b cpu/esp32: change order for spi_flash_drive_init
To see debug or error messages during SPI flash drive initialization, spi_flash_drive_init has to be called after stdio_init.
2019-11-25 07:23:47 +01:00
a8c3c6ab68 cpu/esp32: fix typos 2019-11-23 22:39:36 +01:00
Francois Berder
4a31f94cfc many typo fixes
Signed-off-by: Francois Berder <18538310+francois-berder@users.noreply.github.com>
2019-11-23 22:39:07 +01:00
Gunar Schorcht
71d6a71364 cpu/esp32: defines esp_now as default netdev
If the user or the board definition doesn't enable `esp_wifi` or `esp_eth`, `esp_now` is defined as default netdev.
fixup! cpu/esp32: defines esp_now as default netdev
2019-11-23 14:26:07 +01:00
Gunar Schorcht
72967f8fc3 cpu/esp32: GNRC_NETIF_NUMOF is handled in CPU makefile
Since Makefile.dep files are included as last files multiple times to resolve all module dependencies, GNRC_NETIF_NUMOF is handled here.
2019-11-22 17:38:35 +01:00
Gunar Schorcht
afff683696 cpu/esp32: number of thread priorities for esp_eth
The number of thread priority levels has to be 32 if esp_eth is used.
2019-11-22 17:32:37 +01:00
f04df728cb
Merge pull request #12044 from gschorcht/cpu/esp32/log_module_fix
cpu/esp32: improvements and cleanup of log_module
2019-11-22 14:33:33 +01:00
Gunar Schorcht
43d989b4d5 cpu/esp32: break on core_panic
To be able to catch a core panic in debugger and to get the last output from asynchronous UART , e.g., if the stack is smashed, the system is not rebooted immediately anymore but breaks, which stops the execution in debugger or reboots the system after WDT timeout.
2019-11-22 13:56:41 +01:00
faac10f593
Merge pull request #11994 from gschorcht/cpu/esp32/esp_wifi/crypto-fix
cpu/esp32: esp_wifi and crypto module fix
2019-11-22 11:16:33 +01:00
Gunar Schorcht
6fb7c50d48 cpu/esp32: colored output modifications
For compatibility with module log_color and the esp8266 esp_log_colored implementation.
2019-11-22 11:11:19 +01:00
Gunar Schorcht
4af78c31ef cpu/esp32: enable colored output with log_color 2019-11-22 11:11:19 +01:00
Gunar Schorcht
f500dcbf02 cpu/esp32: colored and tagged log output docu 2019-11-22 11:11:19 +01:00
Schorcht
4503f45abb cpu/esp32: esp_log_color renamed to esp_log_colored 2019-11-22 11:11:19 +01:00
Gunar Schorcht
5d51c03af9 cpu/esp32: replace ets_printf by printf
Wherever possible, ets_printf is replaced by newlib printf.
2019-11-22 11:11:19 +01:00
Gunar Schorcht
1f940b0728 cpu/esp32: map log outputs from SDK libraries
Log outputs generated by binary ESP32 SDK libraries are mapped to the ESP32's log module which supports colored and tagged log outpus. Tagged log outputs from SDK libraries are handled accordingly.
2019-11-22 11:11:19 +01:00
Gunar Schorcht
9a4cdc7e93 cpu/esp32: log_module implementation
The implementation of `log_module` for ESP32 was changed from functions to a macro-based implementation to be able to use the bunch of macros for colored and tagget log output generation.
2019-11-22 11:11:19 +01:00
Gunar Schorcht
d55225eb29 cpu/esp32: remove SDK crypto dependency from doc 2019-11-21 18:34:08 +01:00
Gunar Schorcht
5f01d0a88f cpu/esp32: remove SDK crypto function dependency
Modules `crypto` and `hashes` have not be disabled any longer when module `esp_wifi` is used.
2019-11-21 18:34:08 +01:00
Gunar Schorcht
1a12f56fbd cpu/esp32: use renamed SDK crypto functions 2019-11-21 18:32:28 +01:00
Gunar Schorcht
d8f0399eaa cpu/esp32: rename SDK crypto function
Renames crypto functions of ESP32 SDK in vendor code to resolve the conflicts between `wpa-supplicant` crypto functions and RIOT's `crypto` and `hashes` modules.
2019-11-21 18:32:28 +01:00
Gunar Schorcht
f8c740c190 cpu/esp32: use SDK crypto headers from vendor code
Changes the include path for ESP32 SDK crypto function headers to find their modified version in vendor codefirst.
2019-11-21 18:32:28 +01:00
Gunar Schorcht
ee349edf3b cpu/esp32: add SDK crypto headers and rename
To resolve the conflicts between `wpa-supplicant` crypto functions (part of the ESP32 SDK) and RIOT's `crypto` and `hashes` modules, the crypto function headers from ESP32 SDK are added to vendor code and the crypto functions are renamed using the prefix `wpa_`.
2019-11-21 18:32:28 +01:00
c7825aa92e
Merge pull request #12508 from gschorcht/cpu/esp32/doc_adc2_and_wifi
cpu/esp32: note on using ADC2 and WiFi in documentation
2019-11-21 18:27:06 +01:00
178d0aace2
Merge pull request #12758 from gschorcht/cpu/esp32/fix_fs_tests
cpu/esp32: increase timeout for spiffs and littlefs tests
2019-11-21 17:10:16 +01:00
fe255a26d5
Merge pull request #12750 from gschorcht/cpu/esp32/esptools
cpu/esp32: use esptool.py from riot tools
2019-11-21 17:09:54 +01:00
Gunar Schorcht
fe165738e7 cpu/esp32: doc changes for esptool.py 2019-11-21 10:18:56 +01:00
Gunar Schorcht
9080893f06 cpu/esp32: use esptool.py from riot tools
Use esptool.py from riot tools instead from ESP-IDF SDK to avoid that the SDK has to be installed to flash an image.
2019-11-21 10:18:56 +01:00
Gunar Schorcht
47a4ff05c0 cpu/esp32: increase timeout for spiffs and littlefs tests
The time it takes to erase the entire flash memory of an esp32 card requires increasing the timeout for tests/pkg_spiffs and tests/pkg_littlefs.
2019-11-21 10:15:38 +01:00
6cdf656d62
Merge pull request #12753 from gschorcht/cpu/esp32/fix_sched_prio
cpu/esp32: fix of thread priorities levels
2019-11-21 09:28:58 +01:00
bef34d400e
Merge pull request #12757 from gschorcht/cpu/esp32/fix_xtimer_deps
cpu/esp32: fix xtimer dependency
2019-11-21 09:23:19 +01:00
Gunar Schorcht
7b1ef78054 cpu/esp32: fix of thread priorities levels
A number of tests insist that the number of thread priority levels is 16. However, when using the WiFi interface, a number of high priority threads are required to handle the WiFi hardware. In this case, the number of thread priority levels must be 32. Solves the problem of tests `tests/shell`.
2019-11-21 06:55:41 +01:00
Gunar Schorcht
9a1742074a cpu/esp32: fix xtimer dependency
Removes the dependency of the module riot_freertos from module xtimer. This avoids that xtimer is used even if it is not really needed which in turn occupies the first timer device and tests/periph_timer fails.
2019-11-21 06:38:58 +01:00
Gunar Schorcht
3ab5e3ad66 cpu/esp32: fix heap command output
The heap command output has to have an output format that is compatible with the test.
2019-11-20 08:44:45 +01:00
Gunar Schorcht
327b9fd32e cpu/esp32: introduce module esp_log_tagged
ESP32 log output was always tagged with additional information by default. The tag consists the type of the log message, the system time in ms, and the module or function in which the log message is generated. By introducing module `esp_log_tagged`, these additional information are disabled by default and can be enabled by using module `esp_log_tagged`.
2019-11-20 08:42:27 +01:00
Gunar Schorcht
a3058291b7 cpu/esp32: colored log output
Log module of ESP32 supports colored log outputs when module `esp_log_color` is enabled. The generation of colored log outputs is realized by a extending the bunch of macros with an additional letter indicating the type of log message,
2019-11-20 08:42:22 +01:00
Gunar Schorcht
f2f07252fe cpu/esp32: bootloader versions with and w/o colors
For the implementation of the colored log output, two versions of the bootloader are introduced, one version with colored log output and one version without colors.
2019-11-20 08:42:14 +01:00
Kevin "Tristate Tom" Weiss
be39169bd4
Merge pull request #11108 from gschorcht/cpu/esp8266/esp-idf/pr
cpu/esp8266: complete reimplementation based on ESP8266 RTOS SDK
2019-11-18 09:34:49 +01:00
Yegor Yefremov
df7e760588 doxygen/I2C: don't include overridden typedefs
Add missing #ifndefs to overridden I2C typedefs.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2019-11-15 10:35:33 +01:00
Yegor Yefremov
cf65070b06 doxygen/GPIO: don't include overridden typedefs
Add missing #ifndefs to overridden GPIO typedefs.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2019-11-15 10:35:33 +01:00
Yegor Yefremov
5b0252b150 doxygen/ADC: don't include overridden typedefs
Add missing #ifndefs to overridden ADC resolution typedefs.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2019-11-15 10:35:32 +01:00
Gunar Schorcht
4f4d882f68 cpu/esp32: changes for RTOS SDK 2019-11-14 13:58:25 +01:00
Gunar Schorcht
e38d3e24ec
Merge pull request #12548 from maribu/c11_atomcis_cpp_compat
sys: Basic C++ compatibility with C11 atomcis
2019-10-25 11:48:58 +02:00
Marian Buschsieweke
314184adb5
cpu: Platform specific C11 atomics compat headers
Added headers to define platform specific sizes and types for the C11 atomics
compatibility module for C++.
2019-10-24 23:08:36 +02:00
Francisco Molina
1ae0873769 boards: change PORT used for flash/debug/reset to PROG_DEV 2019-10-24 12:58:12 +02:00
Gunar Schorcht
db945bdd86 cpu/esp32: fix CS handling in spi_transfer_bytes
If `SPI_CS_UNDEF` is given as the `cs` parameter, CS pin must not be handled by the driver. Furthermore, if `cont` parameter is true, CS pin must not be disabled at the end of one transfer.
2019-10-22 08:14:49 +02:00
Gunar Schorcht
1cf163833b cpu/esp32: note on using ADC2 and WiFi in doc
The ADC2 controller of the ESP32 is used by the WiFi module. The GPIOs connected to the ADC2 controller cannot be used as ADC channels if the WiFi module is enabled. This is clarified by a note in the documentation.
2019-10-19 16:31:04 +02:00
ebf43616b7 cpu: add arch_* features 2019-10-13 21:03:41 +02:00
Kevin "Tristate Tom" Weiss
4b7c5915ec
Merge pull request #10953 from gschorcht/sys/shell/heap_cmd/pr
sys/shell: add heap command
2019-10-04 13:49:57 +02:00
Gunar Schorcht
5521a6c39d cpu/esp: fix conflicts after rebase 2019-10-02 14:21:35 +02:00
Gunar Schorcht
3c47cc571f cpu/esp32: fix conflicts after rebase 2019-10-02 14:21:35 +02:00
Gunar Schorcht
02d81b717e
Merge pull request #12063 from maribu/i2c_release
drivers/periph/i2c: Updated i2c_release() to return void
2019-10-01 19:50:38 +02:00
Gunar Schorcht
5009959610
Merge pull request #12346 from benpicco/esp32-thin_archives
cpu/esp32: unconditionally disable thin archives
2019-10-01 10:34:04 +02:00
benpicco
52bf448a3b
Merge pull request #12035 from gschorcht/cpu/esp32/fix_periph_flash
cpu/esp32: fix and improve periph/flash
2019-10-01 10:22:06 +02:00
Benjamin Valentin
0ca2ce0214 cpu/esp32: unconditionally disable thin archives
Thin archives also cause a boot loop when using the flash module.
To prevent further surprises, disable thin archives unconditionally
until the cause for this behaviour is known.
2019-10-01 09:28:33 +02:00
Benjamin Valentin
111fe80eb9 cpu/esp: disable thin archives if esp_wifi is used
For a yet unknown reason, both esp8266 and esp32 get stuck in a
reboot loop when thin archives are used.

As a workaround, disable thin archives for now if esp_wifi is used.

fixes #12258
2019-09-25 07:48:07 +02:00
Martine Lenders
1598c8c6f8
Merge pull request #11950 from gschorcht/cpu/esp32/periph-gpio_read-fix
cpu/esp32: fix of gpio_read for output ports
2019-09-24 20:20:40 +02:00
Francisco
5ab2db71a4
Merge pull request #12282 from LordTy/esp32_build_fix
cpu/esp32: Use awk/printf instead of echo -n when flashing esp32
2019-09-24 18:38:35 +02:00
benpicco
3833e42426
Merge pull request #12092 from cladmi/pr/cpu_model/minor_changes_included
boards with side-effect: move CPU/CPU_MODEL definition to Makefile.features
2019-09-24 18:36:58 +02:00
Gaëtan Harter
8cebed6792
boards/common/esp: harmonize CPU/CPU_MODEL to other boards
* CPU files should already have 'CPU' defined by the board.
* Do not conditionally define CPU as it is not needed.

This is part of cleanup prior to moving the CPU/CPU_MODEL to
Makefile.features.
2019-09-24 17:29:37 +02:00
Tim Broenink
35aa642e8a cpu/common/esp32: use 'awk/printf' instead of 'echo'
- replaces 'echo -n' and 'awk' with 'printf' and 'awk'
  - replaces rest of 'echo' statements with printf
2019-09-24 15:34:54 +02:00
Gunar Schorcht
d5bf41dba1 cpu/esp32: doc update for periph_can 2019-09-20 19:39:23 +02:00
Gunar Schorcht
fc5692d67c cpu/esp32: driver for ESP32 CAN as periph_can 2019-09-20 19:39:23 +02:00
Gunar Schorcht
c498ebd388 cpu/esp32: default device config for periph_can 2019-09-20 19:35:02 +02:00
Gunar Schorcht
49ecce9b81 cpu/esp32: periph_can device/conf type definitions 2019-09-20 19:35:02 +02:00
Gunar Schorcht
e0f1ab0a16 cpu/esp32: module esp_can removed
CAN controller driver for ESP32 is no longer realized as separate module.
2019-09-20 19:35:02 +02:00
Marian Buschsieweke
2750dc2000
cpu/esp32: Moved stdio_init() before periph_init()
- This guarantees that DEBUG() is available early in boot process
- Forgotten in https://github.com/RIOT-OS/RIOT/pull/11367, fixes broken stdio
2019-09-14 11:12:32 +02:00
Gunar Schorcht
4469dadb7f cpu/esp32: _esp_wifi_dev exposed for lwIP
To be able to access the single esp_wifi network device from lwIP adaptation layer, static keyword was removed from esp_wifi_dev variable.
2019-09-12 18:39:46 +02:00
benpicco
e589cfbf6c
Merge pull request #10760 from gschorcht/esp32_esp_eth_link_opt
cpu/esp32: support of NETOPT_LINK_CONNECTED in esp_eth_netdev
2019-09-12 18:14:44 +02:00
Juan I Carrano
c50d8fada1
Merge pull request #11646 from cladmi/pr/esp/programmer_update
esp*: updates to the programmer configuration
2019-09-10 17:58:20 +02:00
benpicco
3aa8bc0d70
Merge pull request #12150 from jcarrano/compress-debuginfo
toolchain/cflags: enable dwarf compression (save 50% HDD)
2019-09-10 10:31:45 +02:00
benpicco
999fffdc59
Merge pull request #11997 from gschorcht/cpu/esp32/esp_wifi/cleanups
cpu/esp32: esp_wifi improvements and cleanups
2019-09-05 13:51:10 +02:00
Gunar Schorcht
b3737715e5
Merge pull request #12170 from benpicco/esp32-fix_doc
cpu/esp32: fix documentation about toolchain installation
2019-09-05 12:58:32 +02:00
Gunar Schorcht
6d77529c83 cpu/esp32: cleaning up left overs in esp_wifi 2019-09-05 12:49:43 +02:00
Gunar Schorcht
3d5ef14650 cpu/esp32: local buffer in send of esp_wifi
Instead of having a send buffer as member `esp_wifi` netdev, a local variable is used now as send buffer. This avoids the need for a locking mechanism and reduces the risk of deadlocks.
2019-09-05 12:49:43 +02:00
Gunar Schorcht
74cbc410b7 cpu/esp32: ringbuffer introduced in esp_wifi
Receive call back function `_esp_wifi_rx_cb` is called from WiFi hardware driver with a pointer to a frame buffer that is allocated in the WiFi hardware driver. This frame buffer was freed immediately after copying its content to a single local receive buffer of the `esp_wifi` netdev. The local receive buffer remained occupied until the protocol stack had processed it. Further incoming packets were dropped.  However, very often a number of subsequent WiFi frames are received at the same time before the first one is processed completely. Having the single local receive buffer to hold only one received frame, led to a number of lost packets, even at low network load. Therefore, a ringbuffer of rx_buf elements was introduced which doesn't store the frames directly but only references to the frame buffers allocated in WiFi hardware driver. Since there is enough memory to hold several frames, the frames buffers allocated in WiFi hardware driver aren't freed immediatly any longer but are kept until the frame is processed by the protocol stack. This results in a much less loss rate of packets.
2019-09-05 12:49:02 +02:00
Gunar Schorcht
0e4ab63735 cpu/esp32: uniform debug output in esp_wifi 2019-09-05 12:49:02 +02:00
Gunar Schorcht
1ed09492a4 cpu/esp32: param checks replaced by asserts in esp_wifi 2019-09-05 12:49:02 +02:00
Gunar Schorcht
28ce17e64c cpu/esp32: event handling changed in esp_wifi
Events of different type can be pending at the same time. Therefore it is not possible to use ascending identifiers for the presence of a pending event. Rather, each event type has to be represented by one bit. Thes bits ORed identify all types of pending events. In the esp_wifi_isr function all pending events are then handled in one call. Otherwise, some events might be lost.
2019-09-05 12:49:02 +02:00
Gunar Schorcht
5cc990fb7c cpu/esp32: cleanup of includes in esp_wifi 2019-09-05 12:49:02 +02:00
benpicco
dbd97b7588
Merge pull request #11947 from gschorcht/cpu/esp32/freertos-critcial-sections
cpu/esp32: critcial section handling changed in FreeRTOS adaptation layer
2019-09-05 12:40:45 +02:00
Sebastian Meiling
c4dbdb7626
Merge pull request #12134 from gschorcht/cpu/esp/fix_i2c_ack_err_errno
cpu/esp*: fix of the error code for I2C address ACK errors
2019-09-05 12:23:24 +03:00
Gunar Schorcht
cb8b1b12c1 cpu/esp32: fix errno for I2C addr ack error
fixup! cpu/esp32: fix errno for I2C addr ack error
2019-09-05 10:35:02 +02:00
Gunar Schorcht
e9e6b7f31a cpu/esp32: changes for common heap command 2019-09-05 09:20:55 +02:00
Benjamin Valentin
7fc7272394 cpu/esp32: fix documentation about toolchain installation
Checking out the submodules first and then the commit makes a mess.
Doing it the other way round results in a working toolchain.
2019-09-05 01:01:09 +02:00
Juan Carrano
63c475cd4d toolchain/cflags: enable dwarf compression.
Use the -gz option to compress ELF sections containing DWARF information.
This saves around 50% of disk space, without any side effects.

See https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Debugging-Options.html#Debugging-Options
for more infomation on this option.

Some platforms have an outdated toolchain that does not support -gz so
the flag is blacklisted there. Even then, the results are quite impressive.

I used @cladmi's `buildtest` branch (https://github.com/cladmi/RIOT/tree/wip/du/buildtest)
with this change and compiled the `examples/default` application:

```
$ BUILD_IN_DOCKER=1 DOCKER="sudo docker" make -C examples/default buildtest-indocker
```

The size was obtained with:

```
$ find output -name "*.bin.bindirsize" -type f -exec tail  -n1 '{}' \; | cut -f 1 | awk '{s+=$1} END {printf "%.0f", s}'
```

Results:

- Vanilla: 10328112 KB (~10GB).
- with -gz: 4982788 KB (~5GB).

This was inspired by #8496.
2019-09-02 14:43:26 +02:00
Gaëtan Harter
e4331e8391
cpu/arch: blacklist incompatible CFLAGS
Blacklist incompatible CFLAGS that are currently "optionally" included
in 'cflags.inc.mk'.

This prepares for the migration to 'OPTIONAL_CFLAGS'.
2019-08-29 17:43:54 +02:00
Juan I Carrano
5ece3dc323
Merge pull request #12050 from gschorcht/cpu/esp32/fix_ctor_initialization
cpu/esp32: fix of global ctor initialization
2019-08-27 11:38:00 +02:00
Gunar Schorcht
7b160a7dd3 cpu/esp32: workaround for static object init 2019-08-27 09:41:41 +02:00
Marian Buschsieweke
a4810f3276
cpu/esp32: Updated i2c_release() 2019-08-22 12:03:08 +02:00
Gunar Schorcht
328813ce12 cpu/esp32: fix of ctor and newlib initialization
Module `newlib` is now used by default. Therefore, the separation of initialization of ctors and the newlibc is not needed any longer. Instead of calling `do_global_ctors` and `_init` separately, `__libc_init_array` is called. Explicit function `do_global_ctors` is removed.
2019-08-21 16:31:06 +02:00
Gunar Schorcht
5fc015e31b cpu/esp32: fix periph_flash param checks for mtd 2019-08-21 01:16:47 +02:00
Gunar Schorcht
c6d33cf5de cpu/esp32: erase improvement for periph_flash
Performance of erasing the whole flash is drastically improved by erasing blocks of 64 kbyte, if possible, instead of erasing sectors of 4 kByte.
2019-08-20 01:56:38 +02:00
Gunar Schorcht
1c60e175ca cpu/esp32: fix periph_flash timing problems
While deleting multiple sectors in flash, interrupts were disabled over the whole time. Thus, deleting the entire flash led to the triggering of the watchdog timer and thus to a restart. Therefore, the interrupts and the cache are disabled only for the time of deleting a single sector. The same problem occurred for read and write large data sets.
2019-08-20 01:51:05 +02:00
Gunar Schorcht
bf331bd54b cpu/esp32: use printf/puts from newlib
Initializing the stdio file descriptors in global reent structure with newlib fake stdio file descriptors led to the problem that newlib stdio functions printf and puts were not working since they can't operate on these fake stdio file descriptors. Therefore, this initialization was removed. Now, the real stdio file descriptors as created automatically by newlib are used. Specific functions `printf`, `puts`, `getchar`and `putchar` are not required any longer and are removed now.
2019-08-19 15:14:32 +02:00
Gunar Schorcht
87cd181f56 cpu/esp32: use always newlib_syscalls_default
Modules newlib and newlib_syscalls_default are now used by default. Conditional compilations for MODULE_NEWLIB_SYSCALLS_DEFAULT as well as alternative code are removed completely.
2019-08-19 15:13:53 +02:00
Gunar Schorcht
6a378f71a0 cpu/esp32: fixes printf and puts
printf and puts used ets_printf before. Unfortunately, ets_printf adds an additional \r for each \n which is not consistent with other RIOT platforms. As a result some automatic tests failed. Therefore, both functions write now character-wise directly to the UART interface.
2019-08-17 11:34:20 +02:00
Gunar Schorcht
8c5de9b714 cpu/esp32: module riot_freertos is always required 2019-08-12 16:51:50 +02:00
Gunar Schorcht
d2de4858e2 cpu/esp32: compile riot_freertos only if required 2019-08-12 16:51:50 +02:00
Gunar Schorcht
1b041083ab cpu/esp32: change of critical section handling in freertos
Using a mutex for critical section handling with portENTER_CRITICAL and portEXIT_CRITICAL does not work for RIOT, as this function can also be called in the interrupt context. Therefore, the given mutex is not used. Instead, the basic default FreeRTOS mechanism for critical sections is used by simply disabling interrupts. Since context switches for the ESP32 are also based on interrupts, there is no possibility that another thread will enter the critical section once the interrupts are disabled.
2019-08-12 16:51:50 +02:00
Gunar Schorcht
26b71a3f14 cpu/esp32: removes additional spaces in freertos 2019-08-12 16:51:50 +02:00
Martine Lenders
1dc6bded04
Merge pull request #11946 from gschorcht/cpu/esp32/lwip_netdev
cpu/esp32: lwIP netdev
2019-08-07 08:10:03 +02:00
Benjamin Valentin
b8c4ab5b69 cpu: make use of ARRAY_SIZE macro 2019-08-06 19:43:54 +02:00
Gunar Schorcht
73552b2c11 cpu/esp32: _esp_wifi_dev exposed for lwIP
To be able to access the single esp_wifi network device from lwIP adaptation layer, static keyword was removed from esp_wifi_dev variable.
2019-08-06 19:12:29 +02:00
Gunar Schorcht
33a6f42fa5 cpu/esp32: lwIP Ethernet address option length
The option value length of Ethernet addresses can be more than 6 byte in lwIP. Therefore, the max_len parameter is check to be greater than or equal to ETHERNET_ADDR_LEN.
2019-08-06 19:12:29 +02:00
Gunar Schorcht
b2b17c5912 cpu/esp32: fix conditional linker options for esp_idf_heap
Module esp_idf_heap is enabled in cpu/esp32/Makefile.dep depending on other modules. Since cpu/esp32/Makefile.dep is read after cpu/esp32/Makefile.include, the conditional  definition of the linker options for the wrapper functions had to be moved from cpu/esp32/Makefile.include to cpu/esp32/Makefile.dep.
2019-08-06 18:17:59 +02:00
Gunar Schorcht
e4198542d1 cpu/esp32: fix multiple definitions with esp_idf_heap
If module esp_idf_heap is used, the memory management functions _malloc_r, _realloc_r, _calloc_r and _free_r have to be overridden by wrapper functions to use the heap_* functions of module _esp_idf_heap. However, this can lead to multiple symbol errors for these functions for some applications. To solve this symbol conflict, _malloc_r, _realloc_r, _calloc_r and _free_r functions are renamed to __wrap_* and the linker options are extended by -Wl,-wrap option when module esp_idf_heap is used.
2019-08-06 14:21:17 +02:00
Gunar Schorcht
7f30bf2aef cpu/esp32: optimizing compilation of subdirs
A number of subdirectories in cpu/esp32/vendor/esp-idf have to be compiled ony, when according modules are required by the application.
2019-08-06 08:05:28 +02:00
Gunar Schorcht
9e47872a59 cpu/esp32: fix multiple definition of putchar
When standard C libraries are added to BASELIBS to group them together with all other modules, there are multiple definitions for the putchar function. The one that is defined writing to the UART as standard output and the one that is provided by the standard C libraries. To solve this symbol conflict, putchar and getchar functions that use the UART as standard output/input are renamed to __wrap_putchar and __wrap_getchar and the linker options are extended by -Wl,-wrap option.
2019-08-06 08:05:22 +02:00
Gunar Schorcht
4972d5bd67 cpu/esp32: fix pthread_setcancelstate symbol problem
When linking an application, symbol pthread_setcancelstate is not known in standard C libraries, even if the pthread module is linked. This is because the pthread module is grouped with all other modules, but not with the default C libraries when they are added to LINK_FLAGS. Therefore, standard C libraries have to be added also to BASELIBS to group them with all other modules.
2019-08-06 08:05:18 +02:00
Gunar Schorcht
e9ecca2c62 cpu/esp32: fix unknown symbols for unused functions
Fixes the problem that the compilation of an applications can throw unknown symbol errors for functions that aren't use at all. Thus, it is possible to remove the warning for unknown symbols and the compilation can abort if there are real unknown symbols.
2019-08-06 08:04:57 +02:00
Gunar Schorcht
b571757bcd cpu/esp32: fix of the return code in esp_wifi_send 2019-08-05 17:38:03 +02:00
Gunar Schorcht
9772562359 cpu/esp32: fix of gpio_read for output ports
Although it isn't explicitly specified in API, gpio_read should return the last written output value for output ports. Since the handling of inputs and outputs is strictly separated by several registers in ESP32, gpio_read returned always the initial value of the input register. Therefore, a case distinction had to make. While for input ports the real value has to be read from the input register, the last written value for the output port has to be read from the output register.
2019-08-01 15:22:02 +02:00
Gunar Schorcht
97bb33788b cpu/esp*: changes to use esp_wifi and esp_now 2019-07-31 13:53:48 +02:00
Gunar Schorcht
96a9949bf9 cpu/esp32: set WiFi config storage type 2019-07-31 13:53:48 +02:00
Gunar Schorcht
9981d2b05c cpu/esp32: cleanup comments/messages in esp_wifi 2019-07-31 13:53:48 +02:00
Gunar Schorcht
f34a1a3eef cpu/esp*: shorter netdev task names 2019-07-31 13:53:48 +02:00
Gunar Schorcht
1492f00690 cpu/esp32: esp_wifi compile configuration tuned
Downsized numbers of dynamic send and receive buffers.
2019-07-31 13:53:48 +02:00
Gunar Schorcht
dd6a5cde5c
Merge pull request #11239 from JulianHolzwarth/esp32/freertos/fix/semaphoreTake
cpu/esp32/freertos: fix semaphore take
2019-07-31 11:01:41 +02:00
Gunar Schorcht
7962a0c179 cpu/esp32: activate cpp feature
Adds module pthread and the libstdc++ to linked libraries to solve the problem with unresolved symbols when feature cpp is required.
2019-07-29 16:06:04 +02:00
3da6593a54 esp32: define PERIPH_TIMER_PROVIDES_SET 2019-07-19 22:28:27 +02:00
Gaëtan Harter
90a9adbbda
cpu/esp*: append to FLASHDEPS
Append to FLASHDEPS instead of overwriting/lazy setting it.
2019-06-14 15:58:36 +02:00
Gunar Schorcht
98d64dafef
cpu/esp32: use FLASHFILE variable
Use ELFFILE as FLASHFILE as all files are created from this
one using esptool.
2019-06-06 14:59:24 +02:00
smlng
2de4b3011b periph_common: add as dependency to periph drivers
Rational: the periph_common module is required by (most) other periph drivers
and also during startup of the CPU/MCU to run periph_init. The latter is only
required if other periph drivers are used, hence periph_common should be a
depency of periph_* modules and *not* of the CPU/MCU. This PR fixes that
by making periph_common a depency of periph_* and removing the explicit
include in the CPU/MCU implementation.
2019-06-03 13:44:10 +02:00
Gaëtan Harter
79280eb12e
boards/tools: remove exporting PREFLASH/FLASHDEPS
PREFLASHER/PREFFLAGS/FLASHDEPS are evaluated by the main Makefile.include.
Their value does not need to be exported.

Testing
-------

`git diff --word-diff` only reports `export` being removed.

`git show --stat` reports `16 insertions(+), 16 deletions(-)`
Which is the same amount as lines that where matching
`export[[:blank::]]\+VARIABLE` plus the newline that is said to have
changed.
2019-05-28 09:58:40 +02:00
Gaëtan Harter
ac113ca2f8
boards/tools: remove exporting FLASHER/FFLAGS
FLASHER and FFLAGS are evaluated by the main Makefile.include or by file
included by it. Their value does not need to be exported.

This will also prevent evaluating 'PORT' for FFLAGS when not needed.

Testing
-------

`git diff --word-diff` only reports `export` being removed.

`git show --stat` reports `84 insertions(+), 84 deletions(-)`
Which is the same amount as lines that where matching
`export[[:blank::]]\+VARIABLE`.
2019-05-28 09:56:00 +02:00
Kevin "Bear Puncher" Weiss
e40f483acf
Merge pull request #11261 from gschorcht/cpu/esp32/doc_fix/rom
boards/cpu/esp32: doc fix of built-in ROM size
2019-05-14 13:07:50 +02:00
Leandro Lanzieri
44d981947d
Merge pull request #11293 from gschorcht/cpu/esp32/periph/conf/spi
boards/esp32: changes the approach for configurations of SPI interfaces in board definitions
2019-05-14 12:07:19 +02:00
Leandro Lanzieri
ab6d0fe08c
Merge pull request #11292 from gschorcht/cpu/esp32/periph/conf/pwm
boards/esp32: changes the approach for configurations of PWM channels in board definitions
2019-05-13 16:11:05 +02:00
Kevin "Bear Puncher" Weiss
6afb0603aa
Merge pull request #11291 from gschorcht/cpu/esp32/periph/conf/i2c
boards/esp32: changes the approach for configurations of I2C in board definitions
2019-05-09 08:26:01 -07:00
Kevin "Bear Puncher" Weiss
795ad18f2e
Merge pull request #11294 from gschorcht/cpu/esp32/periph/conf/uart
boards/esp32: changes the approach for configurations of UART interfaces in board definitions
2019-05-09 08:25:40 -07:00
Gunar Schorcht
3cb08e9e99 cpu/esp32: fixup after rebase 2019-05-06 13:34:59 +02:00
Gunar Schorcht
3e79787bcc cpu/esp32: UART configuration approach changed
UART devices are now configured using static array in header files instead of static variables in implementation to be able to define UART_NUMOF using the size of the array instead of a variable.
2019-05-06 13:34:59 +02:00
Gunar Schorcht
26613ee9e7 cpu/esp32: SPI configuration approach changed
SPI devices are now configured using static array in header files instead of static variables in implementation to be able to define SPI_NUMOF using the size of the array instead of a variable.
2019-05-06 13:33:48 +02:00
Gunar Schorcht
e8828aded8 cpu/esp32: PWM configuration approach changed
PWM channels are now configured using static array in header files instead of static variables in implementation.
2019-05-06 13:32:52 +02:00
Gunar Schorcht
748164ad6a cpu/esp32: I2C configuration approach changed
I2C devices are now configured using static array in header files instead of static variables in implementation to be able to define I2C_NUMOF using the size of the array instead of a variable.
2019-05-06 13:32:06 +02:00
Gunar Schorcht
0510f0c049 cpu/esp32: DAC config approach changed
DAC pins are now configured using static arrays in header files instead of static variables in implementation to be able to define DAC_NUMOF using the size of these arrays instead of a variable.
2019-05-06 13:29:38 +02:00
Gunar Schorcht
32d6c046ac cpu/esp32: ADC config approach changed
ADC pins are now configured using static arrays in header files instead of static variables in implementation to be able to define ADC_NUMOF using the size of these arrays instead of a variable.
2019-05-02 16:38:52 +02:00
Gunar Schorcht
e2abe00fad cpu/esp32: GPIO defs required for periph conf
The GPIO definitions defined here are required in this file to be able to use them in peripheral configurations.
2019-05-02 16:38:24 +02:00
Leandro Lanzieri
7c14ff4153
Merge pull request #11337 from gschorcht/cpu/esp32/periph/submodules
cpu/esp32: fix of periph_* submodule compilation
2019-05-01 23:51:03 +02:00
Gunar Schorcht
94a1af3001 cpu/esp32: additional module dependencies 2019-05-01 09:40:17 +02:00
Gunar Schorcht
6b76e64759 cpu/esp32: periph submodules enabled by default 2019-05-01 09:40:17 +02:00