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

279 Commits

Author SHA1 Message Date
Gunar Schorcht
75c0d06913 cpu/esp8266: changes for ESP32 compatibility 2019-04-15 11:45:59 +02:00
Gunar Schorcht
dc7f979201 cpu/esp8266: SDK interrupt handling removed 2019-04-15 11:45:59 +02:00
Sebastian Meiling
e9072b1e28
Merge pull request #10981 from gschorcht/cpu/esp8266/rodata_IROM/pr
cpu/esp8266: most .rodata sections are moved from DRAM to IROM (flash)
2019-03-29 20:18:06 +01:00
Gunar Schorcht
00ac8ea69a cpu/esp8266: add init function in dummy lwIP
Calling the initialization function ensures that the dummy lwIP library is used instead of the real lwIP, even if the esp_wifi module for esp8266 is not used.
2019-03-05 16:43:45 +01:00
Gunar Schorcht
226e854a28 cpu/esp8266: doc fixes
The documentation had to be changed due to the relation of module `esp_now` to `esp_wifi` module. In addition, a number of corrections have been made. In the case of documentation, it is impossible to do this in various commits.
2019-03-05 16:43:45 +01:00
Gunar Schorcht
3d2df7114f cpu/esp8266: doc restructured for esp_now_netdev 2019-03-05 16:43:45 +01:00
Gunar Schorcht
cd1bd3811c cpu/esp8266: makefile support for esp_now_netdev 2019-03-05 16:43:45 +01:00
Gunar Schorcht
b6d15565be cpu/esp8266: macros required by esp_now_netdev 2019-03-05 16:43:45 +01:00
Gunar Schorcht
8e03e692ed cpu/esp8266: modified ld file for non-SDK version
Introduction of LoadStoreError handler requires new .UserExceptionTrampoline.tex section in ld script.
2019-02-10 13:55:42 +01:00
Gunar Schorcht
cda45fad8f cpu/esp8266: move most rodata sections to IROM
Usually, all .rodata sections are placed in RAM by the Espressif SDK since IROM (flash) access requires 32-bit word aligned reads. thanks to the LoadStoreError exception handler from esp-open-rtos which is used now in RIOT-OS, it is also possible to place .rodata sections in IROM (flash) to save RAM resources.
2019-02-09 20:04:15 +01:00
Gunar Schorcht
5201cd2c71 cpu/esp8266: add LoadStoreError exception handler
Usually, the access to the IROM (flash) memory requires 32-bit word aligned reads. Attempts to access data in the IROM (flash) memory less than 32 bits in size triggers a LoadStoreError exception. With the exception handler from esp-open-rtos it becomes possible to access data in IROM (flash) with a size of less than 32 bits and thus to place .rodata sections in the IROM (flash).
2019-02-09 17:48:40 +01:00
Gunar Schorcht
f4a9f5a0d6 cpu/esp8266: netstats removed from esp_wifi 2019-02-07 15:44:04 +01:00
Gunar Schorcht
66c4cf8647 cpu/esp8266: avoid WiFi going into sleep mode 2019-01-30 08:27:21 +01:00
Gunar Schorcht
57fdb23464 cpu/esp8266: fix compile problems 2019-01-29 23:25:31 +01:00
Gunar Schorcht
975fba8265 cpu/esp8266: check free heap before pbuf alloc
Checking by the send function that at least two maximum size Ethernet frames fit in the remaining heap before the LwIP packet buffer is allocated seems to increase stability. This can be caused by the fact that WLAN hardware interrupts allocate additional memory when receiving a frame during the send attempt.
2019-01-29 18:16:21 +01:00
Gunar Schorcht
c81138367b cpu/esp8266: dbg msg replaced by an error msg
The situation where the firmware `lwIP` packet buffer is exhausted is an important indication that the traffic sent to and sent from the esp8266 is more than the esp8266 is able to handle. Therefore, it should be an error message.
2019-01-27 12:14:18 +01:00
Gunar Schorcht
fa48e3f51f cpu/esp8266: event handling for link up/down 2019-01-26 17:34:13 +01:00
Gunar Schorcht
4e41afa2fb cpu/esp8266: readable disconn reasons in esp_wifi 2019-01-26 17:33:28 +01:00
Gunar Schorcht
1a8a560bb5 cpu/esp8266: remove timeout handling in send func
It is not necessary to realize timeout handling in send function or to disconnect from AP if lwIP packet buffer is exhausted. Waiting that the frame allocated in lwIP packet buffer is freed by MAC layer led to the complete blockage of send function on heavy network load. Disconnecting from AP is counterproductive since reconnecting usually fails on heavy network load.
2019-01-26 17:32:04 +01:00
Gunar Schorcht
fa5fe7e48f cpu/esp8266: don't disconnect on pbuf full in send
Disconnecting from the AP in the send function if the lwIP packet buffer is exhausted is counterproductive since reconnecting usually fails on heavy network load. A better strategy is to slow down the sending of MAC frames from netif a bit to wait for flushing the buffer in the MAC layer.
2019-01-26 17:23:21 +01:00
Gunar Schorcht
5d0b447209 cpu/esp8266: auto reconnect in esp_wifi
It seems to be more stable and less memory consuming to use auto reconnect policy.
2019-01-25 23:59:42 +01:00
Gunar Schorcht
457ef97d74 cpu/esp8266: lwIP dummy functions added
Defines a number of lwIP functions that are required as symbols by Espressif's SDK libraries. These functions are only dummies without real functionality. Using these functions instead of real lwIP functions provided with the SDK saves arround 4 kBytes of RAM.
2019-01-25 23:59:42 +01:00
Gunar Schorcht
24b71a7fbe cpu/esp8266: call _recv directly in esp_wifi
Since _esp_wifi_recv_cb is not executed in interrupt context but in the context of the `ets` thread, it is not necessary to pass the`NETDEV_EVENT_ISR` event first. Instead, the receive function can be called directly which result in much faster handling, a less frame lost rate and more robustness.
2019-01-25 23:59:42 +01:00
Gunar Schorcht
f12606d7c0 cpu/esp8266: removes the mutex in esp_wifi
Since _esp_wifi_recv_cb is not executed in interrupt context but in the context of the `ets` thread, the receive function can be called directly. There is no need for a mutex anymore to synchronize the access to the receive buffer between _esp_wifi_recv_cb and _recv function.
2019-01-25 23:59:42 +01:00
Gunar Schorcht
49f06efd38 cpu/esp8266: fix pbuf length check in esp_wifi
When the size of a received frame is checked, always the total length should be used instead of the length of the first lwIP pbuf in the pbuf chain. Otherwise, the check that the length does not exceed ETHERNET_MAX_LEN will always be true since the maximum size of one lwIP pbuf in a pbuf chain is 512 bytes.
2019-01-24 09:54:53 +01:00
Gunar Schorcht
88c65aff0b cpu/esp8266: allow _esp_wifi_recv_cb during send
Receiption of a frame in _esp_wifi_recv_cb while sending has no effect and should be possible to increases the performance.
2019-01-24 09:39:45 +01:00
Gunar Schorcht
0920bbb4fb cpu/esp8266: log message on reconnect in esp_wifi 2019-01-24 09:21:17 +01:00
Gunar Schorcht
92f6c1a7c6 cpu/esp8266: WiFi mode changed in esp_wifi
Although only the station interface is needed, the WiFi interface has to be used in SoftAP + Station mode. Otherwise the send function blocks sporadically. Since the SoftAP interface is not used, it is configured with a hidden SSID and a long beacon interval. Connections from other stations are not allowed.
2019-01-24 09:21:17 +01:00
Gunar Schorcht
538aac00ad cpu/esp8266: fix of allocated pbuf in esp_wifi 2019-01-24 09:21:17 +01:00
Gunar Schorcht
e384f1e502 cpu/esp8266: send timeout handling in esp_wifi
A timeout was introduced if sending a frame takes to long time. In that case the WiFi interface disconnects and reconnects automatically to recover.
2019-01-24 09:21:17 +01:00
Gunar Schorcht
04ee2ebe15 cpu/esp8266: automatic reconnect in esp_wifi
A reconnect timer is used to try to reconnect every 20 secons if WiFi interface is in disconnected or connecting state.
2019-01-24 09:21:17 +01:00
Gunar Schorcht
87b87631a6 cpu/esp8266: functions that have to run in IRAM
Due to performance reasons _esp_wifi_recv_cb and _send have to be executed in IRAM.
2019-01-24 09:21:17 +01:00
Gunar Schorcht
96d0910d33 cpu/esp8266: avoid _esp_wifi_recv_cb during send
To avoid conflicts on receiption of a frame while sending, _esp_wifi_recv_cb should not executed while a frame is in transmission
2019-01-24 09:21:17 +01:00
Gunar Schorcht
78e0aa2a77 cpu/esp8266: usage of _esp_wifi_recv_cb
Overriding ethernet_input function _esp_wifi_recv_cb is only used when the WiFi interface is in connected state.
2019-01-24 09:21:17 +01:00
Gunar Schorcht
c5a9058ab9 cpu/esp8266: simplified error handling in esp_wifi
wifi_station_connect and wifi_stattion_disconnect never produce errors. Thus, error handling can be removed.
2019-01-24 09:21:17 +01:00
Gunar Schorcht
3225aaa387 cpu/esp8266: different conn states in esp_wifi
Different connection states defined to be able to realize a better connect/reconnect handling
2019-01-24 09:21:17 +01:00
Gunar Schorcht
88f6beeca2 cpu/esp8266: use SDK mem management for esp_wifi
Some SDK interrupt service routines obviously use malloc/free in the interrupt context. Because the rmutex-based lock/unlock approach of the malloc/free function suite of the newlib does not work in the interrupt context, the SDK memory management functions MUST therefore be used. To use the same memory management functions in RIOT as in the SDK, the malloc/free function suite has to be replaced by wrapper functions.
2019-01-24 09:21:17 +01:00
Gunar Schorcht
5a835e91ba cpu/esp8266: fix some comments in esp_wifi 2019-01-24 09:21:17 +01:00
Gunar Schorcht
107e196b18 cpu/esp8266: fix of maximum frame length in esp_wif
Since complete MAC frames are handled, ETHERNET_MAX_LEN has to be used instead of ETHERNET_DATA_LEN for receive buffer size and length check.
2019-01-24 09:21:17 +01:00
Gunar Schorcht
0e46869e57 cpu/esp8266: react to "out of memory" in esp_wifi 2019-01-24 09:21:17 +01:00
Gunar Schorcht
35a751c245 cpu/esp8266: avoid send interruption in esp_wifi 2019-01-24 09:21:17 +01:00
Gunar Schorcht
f7998c2ad6 cpu/esp8266: automatic reconnect in esp_wifi 2019-01-24 09:21:17 +01:00
Gunar Schorcht
d6664dafad cpu/esp8266: esp_wifi dbg msg changed to err msg 2019-01-24 09:21:17 +01:00
Gunar Schorcht
be3a2a4cb5 cpu/esp8266: fix compilation problem of esp_wif 2019-01-24 09:21:17 +01:00
Gunar Schorcht
698770ddb5 cpu/esp8266: fix esp_wifi stability issues
Fixes sporadic blocking of the wifi thread in esp_wifi_recv_cb function under heavy network load conditions when frames are coming in faster than they can be processed. Since esp_wifi_recv_cb function is not executed in interrupt context, the msg_send function used for ISR event can block when the message queue is full. With this change esp_wifi can be flooded with icmpv6 packets of maximum size without any problems over hours.
2019-01-24 09:21:17 +01:00
Gunar Schorcht
21db1ce224 cpu/esp8266: doc extended for esp_wifi 2019-01-24 09:21:17 +01:00
Gunar Schorcht
664566ce70 cpu/esp8266: makefile support for esp_wifi 2019-01-24 09:21:17 +01:00
Gunar Schorcht
04de1e75aa cpu/esp8266: stack sizes tuned for esp_wifi 2019-01-24 09:21:17 +01:00
Gunar Schorcht
642c48f856 cpu/esp8266: add built-in WiFi netdev driver 2019-01-24 09:21:17 +01:00
Gunar Schorcht
e4b0ace841 cpu/esp8266: inc ets_task stack size for esp_now 2019-01-21 16:30:33 +01:00
Gunar Schorcht
b3906539f1 cpu/esp8266: fix ets_post when flash is written
During flash write access, the IROM cache cannot be used and is disabled therefore. During that time, ets_post crashes if a functions is called which is not in IRAM. Therefore thread_flags_set must not be called if IROM cache is disabled.
2019-01-21 16:30:33 +01:00
Gunar Schorcht
8076f393f3 cpu/esp8266: doc fixes for esp_task thread 2019-01-21 16:30:33 +01:00
Gunar Schorcht
09da830a2a cpu/esp8266: doc update for ets_task thread 2019-01-21 16:30:33 +01:00
Gunar Schorcht
0c12206503 cpu/esp8266: cpu configuration tuned
With the new ETS task handling thread, the stack sizes could be down sized.
2019-01-21 16:30:33 +01:00
Gunar Schorcht
66683050c5 cpu/esp8266: Makefile fixes for ets_task thread
Changes of ETS task handling require the context switch by software interrupt. The context switch based on interrupt is therefore enabled by default. Furthermore, the number of priority levels are increased due to the new additional thread.
2019-01-21 16:30:33 +01:00
Gunar Schorcht
906bdebb9a cpu/esp8266: new ets_task thread
ETS tasks are now handled by a high priority RIOT thread
2019-01-21 16:30:33 +01:00
Gunar Schorcht
2cb7b4c6df cpu/esp8266: add compile-time configurations group 2019-01-14 12:19:04 +01:00
Gunar Schorcht
c9d9d60f10 cpu/esp8266: README.md removed
Documentation is generated by doxygen from doc.txt
2019-01-11 00:50:02 +01:00
Gunar Schorcht
fa0b4b801f cpu/esp8266: doc fixes 2019-01-09 16:55:21 +01:00
Schorcht
0230d077d4 cpu/esp8266: doxygen problem fix 2019-01-09 16:03:00 +01:00
Schorcht
323a3f9db7 cpu/esp8266: doc extended 2019-01-09 16:03:00 +01:00
Gunar Schorcht
a352500476 cpu/esp_common: added for common files for ESP SoC 2018-12-27 17:28:46 +01:00
Gunar Schorcht
1865ee9359 cpu/esp8266: fix of adc_res_t
cpu/esp8266/include/periph_cpu.h overrides the default definition of adc_res_t from periph/adc with a definition which contains only one resolution. This gives compilation errorss 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, esp8266 uses now the default definition of adc_res_t and returns -1 if a solution is used in adc_sample that is not supported.
2018-11-30 17:56:33 +01:00
Leandro Lanzieri
566ef9f117 cpu/esp8266: Fix i2c buses array definition 2018-11-22 08:09:35 +01:00
Gunar Schorcht
ffd69868c6 cpu/esp8266: doxygen fix
Removes architecture specific includes from documentation of module  Peripheral Driver Interface / GPIO.
2018-11-05 11:23:40 +01:00
Kevin "Bear Puncher" Weiss
cb09092c0b
Merge pull request #10125 from gschorcht/esp8266_cpu_freq
cpu/esp8266: cpu frequency settings feature added
2018-10-19 14:53:45 +02:00
Schorcht
0d796d6eec cpu/esp8266: cpu frequency settings 2018-10-19 13:08:32 +02:00
Peter Kietzmann
b2c791c6cb
Merge pull request #10135 from miri64/cpu/enh/periph-gpio-irq-closing-endif
cpu, periph_gpio: mark closing #endif for MODULE_PERIPH_GPIO_IRQ
2018-10-15 13:41:02 +02:00
Kevin "Bear Puncher" Weiss
9a75ee0d47
Merge pull request #10127 from gschorcht/esp8266_i2c_fix
cpu/esp8266: improvements of I2C implementation
2018-10-10 17:13:34 +02:00
Gunar Schorcht
4fcfb7ca06 cpu/esp8266: i2c improvements
The commit
- improves the timing of the SDA and SCL signals that fixes communication problems with some slaves (#10115),
- introduces the internal function _i2c_clear which clears the bus when SDA line is locked at LOW, and
- renames internal _i2c_*_sda and _i2c_*_scl functions to function names that are more clear, e.g., _i2c_clear_sda to _i2c_sda_low.
2018-10-10 12:17:20 +02:00
Martine Lenders
ce12d4cefb esp8266: mark closing #endif for MODULE_PERIPH_GPIO_IRQ 2018-10-09 15:11:00 +02:00
Martine Lenders
328d305215
Merge pull request #10001 from haukepetersen/fix_gpioirq_esp8266
cpu/esp8266/gpio: use gpio_irq feature
2018-10-09 13:40:48 +02:00
Kevin "Bear Puncher" Weiss
e36cd53945
Merge pull request #10061 from cladmi/pr/cpu/esp8266/cleanup
cpu/esp8266: remove duplicate 'CPU' variable
2018-09-28 09:35:42 +02:00
Schorcht
6307ace126 cpu/esp8266: periph/i2c fix 2018-09-27 17:48:20 +02:00
cladmi
8f68e69da3
cpu/esp8266: remove duplicate 'CPU' variable 2018-09-27 17:42:53 +02:00
Hauke Petersen
8ff5c91d9f cpu/esp8266/gpio: use gpio_irq feature 2018-09-21 08:17:52 +02:00
smlng
9468feeaaf cpu/esp8266: add missing PERIPH_TIMER_PROVIDES_SET 2018-09-07 22:14:32 +02:00
Schorcht
e4ca897661 cpu: add esp8266 2018-09-05 02:39:50 +02:00
Schorcht
e528fb8e2d cpu: add esp8266 vendor files 2018-09-05 02:39:50 +02:00