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

341 Commits

Author SHA1 Message Date
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
Gunar Schorcht
4fa1d6bf2c cpu/esp32: dac_* moved to separate DAC submodule 2019-05-01 09:40:17 +02:00
Gunar Schorcht
5f79744aa4 cpu/esp32: rtcio_* moved to new submodule adc_ctrl 2019-05-01 09:40:17 +02:00
Gunar Schorcht
6a652513c1 cpu/esp32: new module for ADC controller functions
Functions that are used by ADC and DAC peripherals are moved to a new submodule periph_adc_ctrl. This is necessary to compile separate submodules for ADC and DAC.
2019-05-01 09:40:17 +02:00
Gunar Schorcht
09a2a11dd7 cpu/esp: fix computation of coprocessor save area
`top_of_stack` isn't aligned down to the previous 16 byte aligned address. Furthermore, `top_of_stack` as well as `XT_CP_SIZE` are used unaligned in `cpu/esp_common/vendor/xtensa/portasm.S` in the address computation for the coprocessor save area, .

Aligning pointer `p` down to the previous 16 byte aligned address results in a wrong address of the coprocessor save area during the initialization of the thread context. This leads to wrong values and wrong positions of these values in the coprocessor save area in inital thread context.

Since ESP8266 doesn't have a coprocessor, this bug affects only ESP32.
2019-04-27 13:23:04 +02:00
Gunar Schorcht
0911ddfe07
Merge pull request #11412 from yegorich/pr/esp32/documentation-fixes
esp32: documentation fixes
2019-04-25 17:39:07 +02:00
Yegor Yefremov
9fed14879a cpu/esp32: resolve esptool.py warning
During the flash step esptool.py gives the following warning:

WARNING: Flash size arguments in megabits like '16m' are deprecated.
Please use the equivalent size '2MB'.
Megabit arguments may be removed in a future release.
esptool.py v2.7-dev

This patch replaces '16m' with '2MB' to enable future compatibility.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2019-04-18 09:56:29 +02:00
Yegor Yefremov
29a3b25379 cpu/esp32: revise CAN support
CAN interface is now supported in RIOT. Change feature table
accordingly.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
2019-04-17 16:59:39 +02:00
Gunar Schorcht
b17070fbf1 cpu/esp_common: doc fixes 2019-04-15 12:50:44 +02:00
Gunar Schorcht
18ebfdf059 cpu/esp32: move xtensa lib to esp_common 2019-04-15 11:45:59 +02:00
Gunar Schorcht
fe3d325fd9 cpu/esp32: remove temporary code 2019-04-15 11:45:59 +02:00
Gunar Schorcht
28d9599d52 cpu/esp32: fix coprocessor stack alignment 2019-04-15 11:45:59 +02:00
Gunar Schorcht
950dfba7de cpu/esp32: SDK_USED replace by MODULE_ESP_SDK 2019-04-15 11:45:59 +02:00
Gunar Schorcht
ec1980a438 cpu/esp32: RIOT_OS macro replaced by RIOT_VERSION 2019-04-15 11:45:59 +02:00
Gunar Schorcht
7cc1ee3f6d cpu/esp32: SDK_INT_HANDLING definition removed 2019-04-15 11:45:59 +02:00
Gunar Schorcht
dc4565fdfc cpu/esp32: use newlib_syscalls_default by default
Fix of #11354: Function '_write_r' of ESP32's newlibc does not write the output of function 'write(STDIO_FILENO, ...)' to the UART interface. To fix this problem, module 'newlib_syscalls_default' is now used by default. Function '_write_r' of module 'newlib_syscalls_default' uses 'stdio_write' which in turn uses 'uart_write' if module 'stdio_uart' is used which is now the default case for ESP32.
2019-04-11 16:22:47 +02:00
Gunar Schorcht
3bad3e6199 cpu/esp32: use periph.mk in perpih Makefile
Includes now $(RIOTMAKE)/periph.mk instead of $(RIOTBASE)/Makefile.include to control compilation of periph submodules.
2019-04-04 00:48:33 +02:00
Martine Lenders
af65d2da59
Merge pull request #11184 from gschorcht/cpu/esp32/esp_wifi/iol_len
cpu/esp32: esp_wifi doesn't call memcpy if iol_len is 0
2019-04-02 19:08:15 +02:00
Martine Lenders
2d906de873
Merge pull request #11186 from gschorcht/cpu/esp32/esp_eth/iol_len
cpu/esp32: esp_eth doesn't call memcpy if iol_len is 0
2019-04-02 17:51:26 +02:00
Gunar Schorcht
217ccbe1c4 cpu/esp32: add new uart_mode API function
The internal _uart_set_mode function is exposed if module periph_uart_modecfg is enabled.
2019-03-28 16:36:04 +01:00
Gunar Schorcht
ec013f74a7 cpu/esp32: add internal _uart_set_mode function
Configuration of UART mode is realized by an internal function which is also used by UART initialization function.
2019-03-28 16:36:04 +01:00
Gunar Schorcht
b9a8b98a9b cpu/esp32: add config member values for uart_mode
Set default values for additional data members of UART device configuration data structure that are needed by uart_mode API function.
2019-03-28 16:36:04 +01:00
Gunar Schorcht
6132c08a90 cpu/esp32: add config members for uart_mode
Add data members to the UART device configuration data structure that are needed by uart_mode API function.
2019-03-28 16:36:04 +01:00
JulianHolzwarth
e1d4551459 cpu/esp32/freertos/semphr.c::xSemaphoreTakeRecursive() return value fix
xSemaphoreTakeRecursive() returned before the fix: pdFALSE(equal to pdFAIL) when the call was successful in obtaining the semaphore
and pdTRUE(equal to pdPASS) when the call did not successfully obtain the semaphore.
According to freertos documentation:
"pdPASS Returned only if the call to xSemaphoreTakeRecursive() was successful in obtaining the semaphore"
"pdFAIL Returned if the call to xSemaphoreTakeRecursive() did not successfully obtain the semaphore."
Fixed it to return the correct value.
2019-03-27 15:54:30 +01:00
JulianHolzwarth
1b42d3ff86 cpu/esp32/freertos/semphr.c::xSemaphoreTake() return value fix
xSemaphoreTake() returned before the fix: pdFALSE(equal to pdFAIL) when the call was successful in obtaining the semaphore
and pdTRUE(equal to pdPASS) when the call did not successfully obtain the semaphore.
According to freertos documentation:
"pdPASS Returned only if the call to xSemaphoreTake() was successful in obtaining the semaphore"
"pdFAIL Returned if the call to xSemaphoreTake() did not successfully obtain the semaphore."
Fixed it to return the correct value.
2019-03-27 15:54:30 +01:00
Gunar Schorcht
c0f50104b9 cpu/esp32: GPIO init order for UART RX/TX changed
The GPIO for RX has to be initialized as input before the GPIO for TX can be initialized as output. Otherwise it could lead to creash if RX GPIO was used as output before.
2019-03-26 16:16:49 +01:00
Gunar Schorcht
b42106e738 cpu/esp32: required uart_set_baudrate changes
Function uart_set_baudrate which is only used internally was made static and renamed to _uart_set_baudrate to indicate that it is an internal function. Furthermore, an additional waiting for flushed TX FIFO added. The reconfiguration is now handled as critical section.
2019-03-26 09:57:44 +01:00
Gunar Schorcht
f5da4a1c9f cpu/esp32: internal uart int handler made static
The interrupt handler is only used internally and declared to be static.
2019-03-26 09:57:44 +01:00
Gunar Schorcht
9378888be6 cpu/esp32: some uart_* funcs moved inside the file
For consistency reasons, external functions were moved to the section of external functions.
2019-03-26 09:57:44 +01:00
Gunar Schorcht
de64d2e384 cpu/esp32: _uart_config function moved
For consistency reasons, internal function _uart_config was moved to the section of internal functions.
2019-03-26 09:57:44 +01:00
Gunar Schorcht
ec44ee7fb8 cpu/esp32: additional _ removed from __uart_*
An additional _ for static symbols has been added by mistake and should be removed. This will make future merging with the reimplementation of ESP8266 easier.
2019-03-26 08:14:00 +01:00
Gunar Schorcht
01d17793eb boards/cpu/esp32*: doc fix of built-in ROM size 2019-03-25 14:00:59 +01:00
Juan Carrano
6b766c3cd3 sys/posix: make posix module provide only headers.
The build system contains several instances of
 INCLUDES += -I$(RIOTBASE)/sys/posix/include

This is bypassing the module management system, by directly accesing
headers without depending on a module. The module is the posix module.

That line is also added when one of the posix_* modules is requested.

According to the docs, the posix module provides headers only, but in
reality there is also inet.c.

This patch:

- Moves `inet.c` into `posix_inet`, leaving `posix` as a headers-only
  module.
- Rename `posix` as `posix_headers` to make it clear the module only
  includes headers.
- Makes `posix_*` modules depend on `posix_headers`, thus removing the
  explicit `INCLUDES+=...` in `sys/Makefile.include`.
- Ocurrences of `INCLUDES+=...` are replaced by an explicit dependency
  on `posix_headers`.
2019-03-20 12:57:13 +01:00
Gunar Schorcht
06c59784b5 cpu/esp32: esp_eth doesn't call memcpy if iol_len is 0 2019-03-14 16:57:26 +01:00
Gunar Schorcht
ad57337c4e cpu/esp32: esp_wifi doesn't call memcpy if iol_len is 0 2019-03-14 16:11:24 +01:00
Gunar Schorcht
d9706d1cd5 cpu/esp32: GPIO macro cleanup in periph_cpu.h
The default macros GPIO_PIN and GPIO_UNDEF do not have to be overridden. The GPIO_PIN macro definition was even wrong for 40 GPIOs without splitting into ports, even if that did not lead to erroneous behavior.
2019-02-04 14:31:53 +01:00
smlng
6183d5f5c5 netdev: remove layer2 netstats from netdev drivers
Removing usage of netdev->stats in all net drivers, as it is
handled by gnrc_netif.
2019-02-01 11:25:27 +02:00
Gunar Schorcht
5020c30970 cpu/esp32: fix of maximum frame length in esp_wifi
Since complete MAC frames are handled, ETHERNET_MAX_LEN has to be used instead of ETHERNET_DATA_LEN for buffer sizes and length checks.
2019-01-21 15:26:18 +01:00
Gunar Schorcht
676a615996 cpu/esp32: fix of maximum frame length in esp_eth
Since complete MAC frames are handled, ETHERNET_MAX_LEN has to be used instead of ETHERNET_DATA_LEN for buffer sizes and length checks.
2019-01-21 15:25:43 +01:00
Martine Lenders
f91f62155d
Merge pull request #10801 from gschorcht/esp32_fix_memset_opt
cpu/esp32: fixes the memset optimization problem in esp_wifi/wpa_supplicant
2019-01-18 22:31:42 +01:00
Gunar Schorcht
5bb05f0911 cpu/esp32: esp-wifi related doc changes 2019-01-17 17:10:43 +01:00
Gunar Schorcht
6a99e86b2f cpu/esp32: fix stability issues of esp_wifi
ESP-IDF heap handling has to be used for esp_wifi for stability reasons. Otherwise, heap is corrupted sporadically
2019-01-17 17:10:43 +01:00
Gunar Schorcht
f788928b27 cpu/esp32: 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-17 17:10:43 +01:00
Gunar Schorcht
6caead7bbc cpu/esp32: esp-wifi related doc changes 2019-01-17 17:10:43 +01:00
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