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
cb37288ca5 cpu/esp32: redundant README.md removed
To avoid further inconsistencies in documentation, README.md is not provided any longer
2019-01-17 17:10:43 +01:00
Gunar Schorcht
1cf415a8a9 cpu/esp32: doc improvements in esp_wifi 2019-01-17 17:10:43 +01:00
Gunar Schorcht
e83a8679b4 cpu/esp32: cleanup esp_wifi config parameters 2019-01-17 17:10:43 +01:00
Gunar Schorcht
c0d4706bf8 cpu/esp32: fix of event types in esp_wifi 2019-01-17 17:10:43 +01:00
Gunar Schorcht
c9684af5c2 cpu/esp32: automatic reconnect after disconnect
If WiFi is disconnected, e.g., because of timeout for beacon frame, it is tried to reconnect automatically.
2019-01-17 17:10:43 +01:00
Gunar Schorcht
90e9c95c30 cpu/esp32: registration of RX callback in esp_wifi
RX callback function should be register when WiFi has been connected to AP successfully and should be unregistered when WiFi disconnects from AP. Therefore, esp_wifi_internal_reg_rxcb is called now in event handler on event SYSTEM_EVENT_STA_CONNECTED. It is reset now on event SYSTEM_EVENT_STA_DISCONNECTED.
2019-01-17 17:10:43 +01:00
Gunar Schorcht
f4cacc1e24 cpu/esp32: improved debug message in esp_wifi 2019-01-17 17:10:43 +01:00
Gunar Schorcht
2c3ac91cf3 cpu/esp32: move wifi_connect to event handler
Before function wifi_connect is executed, starting the WiFi driver should have been finished. This is indicated by the WiFi driver by sending event SYSTEM_EVENT_STA_START. Function wifi_connect is moved therefore to the event handler for SYSTEM_EVENT_STA_START.
2019-01-17 17:10:43 +01:00
Gunar Schorcht
8a1da21b1a cpu/esp32: fixes serious memory leak in esp_wifi
The buffer given by the WiFi driver as parameter eb has to be freed explicitly. Otherwise the esp_wifi_netdev stops working after some seconds.
2019-01-17 17:10:43 +01:00
Gunar Schorcht
3ef35e1b78 cpu/esp32: use static WiFi config in esp_wifi
The WiFi configuration has to be static to avoid memory access problems when WiFi AP is reconnected.
2019-01-17 17:10:43 +01:00
Gunar Schorcht
d24d73dadf cpu/esp32: fixes NETOPT_LINK_CONNECTED in esp_wifi
esp_wifi was simply returning the connection state instead of filling the referenced value.
2019-01-17 17:10:43 +01:00
Gunar Schorcht
2c97377585 cpu/esp32: fixes NETOPT_IS_WIRED in esp_wifi
esp_wifi returns false now.
2019-01-17 17:10:43 +01:00
Gunar Schorcht
078c47d79c cpu/esp32: fixes frame size handling in esp_wifi
The size of received and transmitted frames was stored in an uint8_t, which did not allow to process frames larger than 255 octets. However, WiFi has an MTU of 1500 octets.
2019-01-17 17:10:43 +01:00
Gunar Schorcht
6c61b69164 cpu/esp32: os_memset redefinition
os_memset uses system_secure_memset.
2019-01-17 13:52:22 +01:00
Gunar Schorcht
2215f29883 cpu/esp32: add memset that cannot be optimized out
Adds a memset function `system_secure_memset` which cannot be optimized out by the compiler. It uses the libsodium approach of weak symbols. Function system_secure_memset calls the standard memset. Calling an empty function declared with weak attribute after the memset call, prevents the compiler to optimize it out. The overhead is only one function call.
2019-01-17 13:50:56 +01:00
Gunar Schorcht
d34616756e cpu/esp32: add compile configuration group 2019-01-14 12:19:19 +01:00
Gunar Schorcht
12be613e63 cpu/esp32: add NETOPT_LINK_CONNECTED in esp_eth
Support for NETOPT_LINK_CONNECTED added to esp_eth_netdev::_get
2019-01-13 13:41:09 +01:00
Gunar Schorcht
6b045f14b7 cpu/esp32: cleanup of SPI interfaces in doc
Although ESP32 has four SPI controllers, only two of them can be effectively used (HSP and VSPI). The third one (FSPI) is used for external memory such as flash and PSRAM and can not be used for peripherals. FSPI is therefore removed from the API. In addition, the SPI0_DEV and SPI1_DEV configuration parameters are renamed SPI0_CTRL and SPI1_CTRL to better describe what they define and to avoid confusion with SPI_DEV (0) and SPI_DEV (1).
2019-01-09 13:03:56 +01:00
Gunar Schorcht
437f8b87b9 cpu/esp32: cleanup of SPI interfaces
Although ESP32 has four SPI controllers, only two of them can be effectively used (HSP and VSPI). The third one (FSPI) is used for external memory such as flash and PSRAM and can not be used for peripherals. FSPI is therefore removed from the API. In addition, the SPI0_DEV and SPI1_DEV configuration parameters are renamed SPI0_CTRL and SPI1_CTRL to better describe what they define and to avoid confusion with SPI_DEV (0) and SPI_DEV (1).
2019-01-09 13:03:22 +01:00
Gunar Schorcht
dc2b1deff5 cpu/esp32: restructures _recv function in esp_eth 2019-01-04 12:12:28 +01:00
Gunar Schorcht
8318779bc2 cpu/esp32: replaces LOG_ERROR by DEBUG in esp_eth 2019-01-04 12:12:28 +01:00
Gunar Schorcht
1e3abebd86 cpu/esp32: fixes esp_net maximum packet size
Fixes the maximum packet size of 255 bytes in the esp_eth netdev driver of ESP32 mcu.

fixup! cpu/esp32: fixes esp_net maximum packet size
2019-01-04 12:12:13 +01:00
Gunar Schorcht
797a894e40 cpu/esp32: esp_now netdev moved to esp_common 2018-12-27 17:31:34 +01:00
Gunar Schorcht
a352500476 cpu/esp_common: added for common files for ESP SoC 2018-12-27 17:28:46 +01:00
Sebastian Meiling
bb20614c7f
Merge pull request #10530 from gschorcht/esp32_adc_res_fix
cpu/esp32: fix of adc_res_t
2018-12-04 09:35:47 +01:00
Gunar Schorcht
b3b9f596a4 cpu/esp32: fix of adc_res_t
cpu/esp32/include/periph_cpu.h overrides the default definition of adc_res_t from periph/adc with a definition which contains only four resolution, two new resolutions and two resolutions defined by the default definition of adc_res_t. This gives compilation errors if an application uses other resolutions. According to the documentation, adc_sample should return -1 if the resolution is not supported. All other CPUs override adc_res_t either to add new resolutions or to mark resolutions as unsupported. But they all allow to use them at the interface. Therefore, esp32 overrides now the definition of adc_res_t with all resolutions that are defined by the default definition of adc_res_t and new platform specific resolutions. It returns -1 if a resolution is used in adc_sample that is not supported.
2018-11-30 18:06:51 +01:00
Martine Lenders
03b91cbcb8 esp_now: use NETDEV_TYPE_ESP_NOW as device type 2018-11-29 13:35:20 +01:00
Gunar Schorcht
0c289a8f31 cpu/esp32: fixes LINKFLAGS in Makefile.include
removes the duplicate entry of -lg in LINKFLAGS
2018-11-28 10:44:54 +01:00
Gunar Schorcht
9bba4b9aa5 cpu/esp32: fixes LINKFLAGS in Makfile.include
This commit adds the ESP32 vendor libraries for WLAN to the BASELIBS variable. This avoids having to define an additional archive group in the LINKGFLAGS variable which contains these vendor libraries and again RIOT module archive files with the symbols that are refered by these vendor libraries.
2018-11-23 18:04:19 +01:00
Gunar Schorcht
2a7c33bdf6 cpu/esp32: fixes compile problems 2018-11-20 00:49:33 +01:00
Schorcht
16f0bf4fdc cpu/esp32: fixes compile problems 2018-11-10 14:14:49 +01:00
Gunar Schorcht
100a4c666e cpu/esp32: doxygen fix
Removes architecture specific includes from documentation of module  Peripheral Driver Interface / GPIO.
2018-11-05 11:27:00 +01:00
Jens Alfke
ce1fe776cf cpu/esp32: allow explicit ESP32 crystal freq configuration
Some ESP32 boards (like my SparkFun ESP32 Thing) have a main clock
crystal that runs at 26MHz, not 40MHz. RIOT appears to assume 40MHz.
The mismatch causes the UART to not sync properly, resulting in
garbage written to the terminal instead of log output.

I’ve added:

* A new board configuration constant ESP32_XTAL_FREQ that defaults
  to 40, but can be overridden by a board def or at build time to
  force a specific value (i.e. 26).
* Some code spliced into system_clk_init() to check this constant and
  call rtc_clk_init() to set the correct frequency.
* A copy of the rtf_clk_init() function from the ESP-IDF sources.

Fixes #10272
2018-10-30 16:42:07 -07:00
Gunar Schorcht
5ef7adfbcb cpu/esp32: fix problem with tests/thread_race
The problem seemed to be a pipelining problem of write and read instructions when swapping the context. An isync instruction when returning from a context switch solves the potential pipelining problem.
2018-10-14 15:08:31 +02:00
Gunar Schorcht
df1b6521f4 cpu/esp32: fixes the problem with tests/pthread_*
Reason for the problem was that tast_exit function in thread_arch.c tried to release the thread a second time although it was already released in sched_task_exit. A simple check whether the thread is already released (sched_active_thread == NULL) solved the problem.
2018-10-14 13:55:43 +02:00
Gunar Schorcht
fddfe86a4b cpu/esp32: fixes dependency problem for timer
Xtensa newlib version requires pthread_setcancelstate as symbol. Therefore, the module pthread was always used, which in turn requires the module xtimer. The xtimer module, however, uses TIMER_DEV(0). Therefore, tests/timers failed for TIMER_DEV(0).
2018-10-14 13:50:38 +02:00
Schorcht
4c516aa1ad cpu/esp32: scope for GPIO_IRQ submodule added 2018-10-09 11:41:59 +02:00
Schorcht
73d0670b80 cpu/esp32: pwm initialization fixed 2018-10-09 11:27:54 +02:00
Schorcht
3a63945621 cpu/esp32: i2c speed values finetuned 2018-10-09 10:59:40 +02:00
Schorcht
841d2790e6 cpu: add esp32 2018-10-08 14:40:43 +02:00
Schorcht
3ac99877ac cpu: add esp32 2018-10-08 12:20:49 +02:00
Schorcht
32e602680b cpu: add esp32 vendor files 2018-10-08 12:20:49 +02:00