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
Jean-Pierre De Jesus DIAZ
466fdf5114
Merge pull request #17415 from gschorcht/cpu/esp/wifi_ap_dynamic_ssid_option
cpu/esp: change dynamic SSID option handling
2021-12-17 18:11:38 +01:00
Gunar Schorcht
8ac808e4fd cpu/esp: cleanup for dynamic SoftAP SSID option
The semantics of defining an SSID prefix that overrides the already defined SSID exactly when and only when it is set, and then enabling dynamic SSID generation with that prefix, made handling the parameter definition unnecessarily difficult and hard to understand.

Defining a boolean option that enables dynamic SSID generation, which then simply reuses the defined SSID as a prefix, makes it much more understandable and easier to handle, especially with respect to Kconfig.
2021-12-16 13:17:17 +01:00
c9207e81a3
cpu/esp8266: include cpu_conf.h in periph_cpu.h 2021-12-15 13:14:19 +01:00
Francisco Molina
4e6151bd7d cpu/esp*: migrate from xtimer to ztimer 2021-12-14 18:14:35 +01:00
Gunar Schorcht
85313ccc02
Merge pull request #17232 from leandrolanzieri/pr/cpu/esp/model_kconfig
cpu/esp{32,8266}: model kconfig
2021-12-11 08:53:31 +01:00
Leandro Lanzieri
721588b03b
cpu/esp8266: remove unneeded Makefile 2021-12-10 18:54:27 +01:00
Leandro Lanzieri
185d1a20df
cpu/esp8266: model Kconfig 2021-12-10 18:54:07 +01:00
Gunar Schorcht
891a0aae17 cpu/esp8266: fix esp_sw_timer compile problem 2021-12-02 06:17:48 +01:00
Erik Ekman
e5d60176e4 cpu/esp: Suppress cppcheck errors
cpu/esp_common/syscalls.c💯 error (memleak): Memory leak: mtx
cpu/esp_common/syscalls.c:131: error (memleak): Memory leak: rmtx
cpu/esp_common/syscalls.c:365: error (comparePointers): Subtracting pointers that point to different objects

cpu/esp_common/thread_arch.c:355: error (comparePointers): Comparing pointers that point to different objects

cpu/esp8266/startup.c:59: error (comparePointers): Subtracting pointers that point to different objects
2021-11-25 13:08:51 +01:00
Gunar Schorcht
06acd8b420 cpu/esp8266: place freertos functions in IRAM
The functions of the `esp*/freetos` libraries must be placed in IRAM because they can be called when the IROM cache is disabled. While the functions implemented in `cpu/esp8266/freetos/*.c` are already placed in IRAM, the functions implemented in `cpu/esp_common/freetos/*.c` are not placed in IRAM. The reason for this is that the object files of these files are created in the `esp_freertos_common` directory, which is not included in the `esp.riot-os.ld` file because the library is named `esp_freertos_common`.
2021-10-29 11:17:24 +02:00
iosabi
7b1f083cd8 esp8266: Download Espressif RTOS SDK as a new RIOT PKG
RIOT-OS uses part of Espressif ESP8266 RTOS SDK to build support for
this CPU. The SDK includes some vendor-provided closed source
pre-compiled libraries that we need to modify to adapt to RIOT-OS
usage. This library modifications was done once and uploaded to a fork
of the vendor repository and was provided as an environment variable.

This patch changes two things:

1. It installs the SDK as a RIOT PKG from the new pkg/esp8266_sdk
directory instead of requiring the user to download it separately.

2. It performs the library modifications (symbol renames) on the pkg
Makefile removing the need to use a fork with the modifications applied
and simplifying the SDK update and future modifications.

This change sets the SDK package version (git SHA) to the same one that
our fork was using as a parent in the vendor repository, meaning that
the output libraries are exactly the same as before.

Tested with
```
ESP8266_RTOS_SDK_DIR=/dev/null USEMODULE=esp_log_startup make -C tests/shell BOARD=esp8266-esp-12x flash
```

and verified that the program works. The boot message now includes:
```
ESP8266-RTOS-SDK Version v3.1-51-g913a06a9
```
confirming the SDK version used.

`/dev/null` in the test is just to make sure that no evaluation of
`ESP8266_RTOS_SDK_DIR` in make is affected by the environment variable
value which would be set to the SDK for people who followed the set up
instructions before this change.

Tested the checkout size:
```bash
$ du -hs build/pkg/esp8266_sdk/
124M	build/pkg/esp8266_sdk/
```
2021-10-23 11:13:38 +00:00
Gunar Schorcht
a3ca9776c2 cpu/esp8266: fix documentation format
Fix various issues with incompatibilities of markdown supported by doxygen.
2021-10-15 02:50:21 +02:00
Jean-Pierre De Jesus DIAZ
35d1a2fc02 cpu/esp*: fix doxygen grouping warnings
Signed-off-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2021-09-11 12:45:15 +02:00
Jan Romann
4384795cb9
treewide: Remove excessive newlines 2021-08-13 19:50:38 +02:00
iosabi
52107b2416 esp8266: Support UART1 and other UART0 pins.
The esp8266 CPU has actually two hardware UART peripherals. UART0 is
used by the boot ROM for flashing and serial output during boot,
typically at a baudrate of 74880 bps until the bootloader or application
sets the more standard 115200 baudrate. This UART0 device has two
possible pins for TXD, GPIO1 and GPIO2, which are both set to TXD by the
boot ROM. esp8266 modules will typically have GPIO1 labeled as the TX
pin, but it is possible to use GPIO2 for that purpose even while
flashing the device with esptool.py.

The second device, UART1, also has two options for TXD, GPIO2 and GPIO7,
and only one option for RXD, GPIO8. However, GPIO7 and GPIO8 are used
by the flash internally so those options are not very useful unless
maybe while running from IRAM with the flash disabled, for example for
a debugger over UART1.

This patch allows boards to override UART{0,1}_{R,T}XD in their
periph_conf.h to configure the uart selection. Defining UART1_TX will
make the UART_DEV(1) device available.

Tested with:

```CFLAGS='-DUART1_TXD=GPIO2' make -C tests/periph_uart BOARD=esp8266-esp-12x flash term```

* Connected one USB-UART to the standard GPIO1 and GPIO3 for flashing
  and console. After flashing we see the manual test output at 115200
  bps

* Connected a second USB-UART with RX to GPIO2 running at 74880.

Then run on the first console:
```
> init 1 74880
> send 1 hello
```

The word "hello" appears on the second UART connection.

Note that GPIO2 is used during boot for UART0's TX until the application
or bootloader set it to a regular GPIO, so some boot ROM messages at
74880 bps are visible. After running `init 1 74880` it is set to UART1's
TX.
2021-05-02 12:27:27 +00:00
benpicco
c1c374db02
Merge pull request #16420 from benpicco/periph/rtt_overflow
cpu: add periph_rtt_overflow feature
2021-04-30 14:37:09 +02:00
benpicco
76cd388dd0
Merge pull request #16304 from iosabi/esp_gdbstub
cpu/esp8266: Fix typo in esp_gdbstub config.
2021-04-30 14:36:50 +02:00
Benjamin Valentin
d47a880915 cpu: add periph_rtt_overflow feature
The RTT overflow callback is not available on all RTT implementations.
This means it is either a no-op or `rtt_set_overflow_cb()` is a no-op
or it will overwrite the alarm set with `rtt_set_alarm()`.

This adds a feature to indicate that proper overflow reporting is available.
2021-04-30 11:58:00 +02:00
Francisco Molina
5ae5c40f26
cpu/esp*: add CLOCK_CORECLOCK 2021-04-21 08:54:43 +02:00
iosabi
0c40158eac cpu/esp8266: Fix typo in esp_gdbstub config.
The extra `)` was a typo from the commit that changes the makefile
inline "if" to a multi-line "if" block.

Tested with `USEMODULE="esp_gdbstub" make BOARD=esp8266-esp-12x -C tests/lwip`
2021-04-10 22:49:23 +02:00
Marian Buschsieweke
ab89234040
drivers/periph/rtt: add periph_rtt_set_counter feature
Some periph_rtt implementations do not provide `rtt_set_counter()`. This
adds `periph_rtt_set_counter` as feature to allow testing for its
availability. The feature is provided at CPU level if periph_rtt is
provided by the board for all CPUs implementing `rtt_set_counter()`.
2021-03-08 14:16:46 +01:00
Marian Buschsieweke
b9cb75fedf
drivers/periph/rtt: add periph_rtt_set_counter feature
Some periph_rtt implementations do not provide `rtt_set_counter()`. This
adds `periph_rtt_set_counter` as feature to allow testing for its
availability. The feature is provided at CPU level if periph_rtt is
provided by the board for all CPUs implementing `rtt_set_counter()`.
2021-03-04 18:05:06 +01:00
858b5ca6ed xfa: remove obsolete empty xfa.ld 2021-02-18 10:46:08 +01:00
06ec602782 cpu/esp8266: add XFA support 2021-02-18 10:46:08 +01:00
91b987acd6 cpu/esp8266: add ld/ to linker search path, use it 2021-02-18 10:46:08 +01:00
Francisco Molina
63a2a6ce1b
treewide: model newlib as a FEATURE 2021-01-27 09:24:25 +01:00
Marian Buschsieweke
921bc7f6e0
cpu/esp*: Fix cast alignment issues
- Add `WORD_ALIGNED` attribute to potentially unaligned allocations
- Use intermediate cast to `uintptr_t` to silence false positives of
  `-Wcast-align`
2020-11-18 10:19:23 +01:00
Bas Stottelaar
94171b7389 cpu/*: replace #if ENABLE_DEBUG with IS_ACTIVE 2020-11-02 21:34:12 +01:00
Marian Buschsieweke
125c892c03
drivers/periph/timer: Use uint32_t for frequency
For all currently supported platforms `unsigned long` is 32 bit in width. But
better use `uint32_t` to be safe.
2020-10-30 22:02:12 +01:00
benpicco
b14e7544aa
Merge pull request #14117 from btcven/2020_05_22-esp_wifi_ap
cpu/esp: implement ESP WiFi SoftAP mode
2020-10-26 00:08:22 +01:00
Bas Stottelaar
22243aec7a cpu/*: realign ENABLE_DEBUG 2020-10-23 00:46:26 +02:00
Bas Stottelaar
bd34cf8fc0 cpu/*: reorder ENABLE_DEBUG after last include 2020-10-23 00:45:55 +02:00
Bas Stottelaar
ab6188cea3 cpu/*: add missing include of assert.h 2020-10-22 11:13:08 +02:00
Leandro Lanzieri
eb2655b622
cpu/esp8266/ld: use folder name instead of archive for module objects 2020-10-09 13:29:55 +02:00
Jean Pierre Dudey
295a3665d2 cpu/esp: implement ESP SoftAP mode
This is an implementation of the ESP32 SoftAP mode using the
`esp_wifi_ap` pseudomodule.

Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2020-09-27 18:29:24 -05:00
Cenk Gündoğan
0d0bc91553
Merge pull request #14754 from leandrolanzieri/pr/no_archives
build system: link object files
2020-09-10 09:36:29 +02:00
Marian Buschsieweke
7c1949341e
build system: Overwrite TARGET_ARCH per arch
Add `TARGET_ARCH_<ARCH>` for each architecture (e.g. `TARGET_ARCH_CORTEX` for
Cortex M) to allow users to overwrite the target triple for a specific arch
from ~/.profile or ~/.bashrc (or the like) without overwriting it for all others
as well.
2020-09-08 22:28:41 +02:00
Leandro Lanzieri
81cb769cad
makefiles: avoid building archives when compiling 2020-09-04 15:01:10 +02:00
Marian Buschsieweke
35d46e6dc3
cpu/esp: Use API to access sched internals
Replace access to `sched_active_task` and `sched_active_pid` with calls to
`thread_getpid()` and `thread_get_active()`.
2020-08-17 14:05:05 +02:00
Leandro Lanzieri
7a2e4c819d
cpu/esp8266: Add Kconfig symbols 2020-07-07 16:27:43 +02:00
Francisco Molina
e98341da93
Makefile: use normal conditionals 2020-06-29 22:40:29 +02:00
Marian Buschsieweke
fc28ba5c08
cpu/esp8266: Allow compilation with external boards
Replace `$(RIOTBOARD)/$(BOARD)` with `$(BOARDDIR)`, which also works for
external boards.
2020-05-14 13:35:51 +02:00
Gunar Schorcht
6cd9896ac0 cpu/esp: move BACKUP* attributes to esp_common 2020-04-03 18:07:12 +02:00
Gunar Schorcht
a0b77de3dc cpu/esp8266: move RTC_BSS_ATTR to cpu/esp_common
Since the attribute is required by EPS8266 as well as ESP32, it is moved to cpu/esp_common.
2020-04-03 18:07:12 +02:00
Gunar Schorcht
331313db4f cpu/esp: NETOPT_CHANNEL for esp_wifi and esp_now 2020-03-26 14:46:15 +01:00
Leandro Lanzieri
58320c943e
cpu/esp8266: Move common modules fo Makefile.dep 2020-03-24 09:27:40 +01:00
Leandro Lanzieri
ea12a6b493
cpu/esp8266/Makefile.include: Check modules in conditional expansion 2020-03-24 09:21:18 +01:00
benpicco
921a6a663e
Merge pull request #12024 from gschorcht/cpu/esp32/esp_wifi/wpa2_enterprise
cpu/esp32/esp wifi: add WPA2 enterprise mode with IEEE 802.1x/EAP authentication
2020-03-22 17:10:31 +01:00
Gunar Schorcht
c1e6e70015 cpu/esp32/esp_wifi: doc for WPA2 Enterprise mode 2020-03-22 15:47:06 +01:00
Gunar Schorcht
b7781c77d6 cpu/esp8266: add RTT based RTC
fixup! cpu/esp8266: add RTT based RTC
2020-03-21 08:49:51 +01:00
Gunar Schorcht
464e3a8741 cpu/esp8266: add RTT implementation 2020-03-19 13:59:58 +01:00
Koos
67dfb9d39e cpu/esp8266: Fixed small typo in code example 2020-03-04 09:54:36 +01:00
Gunar Schorcht
ef248b392d cpu/esp_comomon: rename cpu_conf.h to cpu_conf_common.h
To be able to define common configurations for all ESP CPUs, the CPU specific configuration cpu_conf.h has to include a common configuration. For that purpose cpu_conf.h in cpu/esp_common is renamed to cpu_conf_common.h and included in CPU specific configurations.
2020-02-29 12:07:12 +01:00
Gunar Schorcht
32c7bd8867 cpu/esp8266: remove unused function definitions 2020-02-21 09:09:34 +01:00
Gunar Schorcht
98ca108be5 cpu/esp8266: move esp_wifi to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
9723e3e3cf cpu/esp*: move freertos/task to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
61339001e7 cpu/esp*: move common freertos code to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
18659bdf26 cpu/esp*: move FreeRTOS headers to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
05faec7cf8 cpu/esp*: move periph/i2c_sw to esp/common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
0292f8b6a3 cpu/esp*: move periph/hwrng to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
d90164b19a cpu/esp*: move perioph/spi to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
66ee155562 cpu/esp*: move periph/flash to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
b0517c6733 cpu/esp*: move periph/uart to cpu/esp_common
tmp
2020-02-21 09:09:34 +01:00
Gunar Schorcht
39ee806d3c cpu/esp*: move some vendor/esp code to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
75d23e8458 cpu/esp*: common exception handling 2020-02-21 09:09:34 +01:00
Gunar Schorcht
90dc2ce846 cpu/esp*: common parts of syscalls in cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
4c466e54ec cpu/esp*: common irq_arch in cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
43b89a61eb cpu/esp*: move common parts of gpio_arch to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
45c71f1a31 esp/esp*: move common code to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
7d701f6fa8 cpu/esp*: move common headers to cpu/esp_common 2020-02-21 09:09:34 +01:00
Gunar Schorcht
53a3756e0c cpu/esp*: common Makfile* added 2020-02-21 09:09:34 +01:00
Gunar Schorcht
b132698cd5 cpu/esp*: move parition table tool to dist/tools/esptool
The same tool 'gen_esp32part.py' is used for the generation of partition tables on ESP8266 as well as n ESP32. The tool is therefore added to 'dist/tools/esptool'
2020-02-21 09:09:08 +01:00
Gunar Schorcht
e4be9b4b36 cpu/esp8266/esp_wifi: move gnrc specific code to separate file 2020-01-31 09:32:23 +01:00
Gunar Schorcht
058c710cba cpu/esp8266/esp_wifi: remove gnrc specific code 2020-01-31 09:32:23 +01:00
Sören Tempel
5ef5ab7e4b Add CPU feature for stack smash protections 2020-01-22 15:59:02 +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
Marian Buschsieweke
55dc429d11
cpu/esp8266/periph: adc_sample() now returns int32_t 2020-01-10 14:13:14 +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
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
Gunar Schorcht
0194d7f44b cpu/esp8266: fix of esp_wifi_send
In case of succes, the esp_wifi_send function returned a 0 instead of sent bytes.
2019-12-18 21:52:25 +01:00
Gunar Schorcht
8021888c06 pkg/lwip: remove esp8266 from blacklist 2019-12-17 08:28:33 +01:00
Gunar Schorcht
dcb6673024 cpu/esp8266: platform dependent settings for lwIP 2019-12-17 08:28:33 +01:00
Gunar Schorcht
baf4db675d cpu/esp8266: fix bootloader images
Some ESP8266/ESP8285 modules only work with DOUT SPI flash mode and a SPI flash frequency of 26 MHz. Therefore, these parameters have to be used by default. Otherwise some modules will no boot.
2019-12-12 08:16:54 +01:00
Gunar Schorcht
3e3a6f7018 cpu/esp8266: change of log output level in vendor code 2019-12-12 08:16:54 +01:00
Gunar Schorcht
a3de59fec3 cpu/esp8266: log outputs from esp vendor code
Log outputs from the Espressif vendor code are completely controlled by LOG_LEVEL and should not be controlled by ENABLE_DEBUG by file.
2019-12-12 08:16:54 +01:00
Gunar Schorcht
81cde86a73 cpu/esp8266: enable esp_log_startup on LOG_LEVL=4 2019-12-07 15:16:32 +01:00
Gunar Schorcht
b4b3e4f934 cpu/esp8266: 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-12-07 15:16:32 +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
Tim Broenink
e35e9ea59f cpu/common/esp8266: use 'awk/printf' instead of 'echo' 2019-12-01 14:36:42 +01:00
Gunar Schorcht
7325192fcd cpu/esp8266: defines esp_now as default netdev
If the user or the board definition doesn't enable `esp_wifi`, `esp_now` is defined as default netdev.
2019-11-23 14:26:37 +01:00
MrKevinWeiss
d218b77ff7 cpu/esp8266: Suppress cpu specific i2c_speed_t in doxygen 2019-11-18 11:43:45 +01:00
MrKevinWeiss
02bd107722 cpu/esp8266: Suppress cpu specific gpio_flank_t in doxygen
The enumeration takes both the cpu and the driver, it should only show the driver enum
2019-11-18 11:43:12 +01:00
Gunar Schorcht
555a7040db cpu/esp8266: reset tool to allow automatic tests 2019-11-14 13:58:48 +01:00
Gunar Schorcht
309eab9ae0 cpu/esp8266: enable colored output with log_color 2019-11-14 13:58:48 +01:00
Gunar Schorcht
fe028455e5 cpu/esp8266: esptool.py is provided as tool
The modified version esptool.py from RTOS SDK that is required for flashing an image, is now placed in `dist/tools/esptool.py` and used directly from there. The advantage is that `esptool.py` hasn't to be installed explicitly anymore. Having RIOT is enough. The documentation is adapted accordingly. The oly prerequisite is that python and the pyserial module are installed.
2019-11-14 13:58:48 +01:00
Gunar Schorcht
62922769b3 cpu/esp8266: high-priority threads creation
High priority thread for the WiFi interface are only created at startup when the WiFi interface is used.
2019-11-14 13:58:48 +01:00