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
Marian Buschsieweke
c2c2cc8592
drivers/periph_gpio: let gpio_read() return bool
Since https://github.com/RIOT-OS/RIOT/pull/20935 gpio_write()
uses a `bool` instead of an `int`. This does the same treatment for
`gpio_read()`.

This does indeed add an instruction to `gpio_read()` implementations.
However, users caring about an instruction more are better served with
`gpio_ll_read()` anyway. And `gpio_read() == 1` is often seen in
newcomer's code, which would now work as expected.
2024-10-23 13:24:09 +02:00
Benjamin Valentin
4627f66caa drivers/periph/gpio: make gpio_write() take a bool 2024-10-22 16:39:48 +02:00
krzysztof-cabaj
2f0a78640f cpu/esp8266: fix issue found by static tests 2024-04-11 19:19:58 +02:00
krzysztof-cabaj
569b4b5294 cpu/esp8266: fix doxygen unbalanced grouping 2024-04-11 19:04:06 +02:00
Marian Buschsieweke
04620d471c
Merge pull request #20438 from MrKevinWeiss/pr/kconfig/dep/removal
Remove Kconfig dependency modelling
2024-03-27 16:39:56 +00:00
MrKevinWeiss
e0fdc3c16c
*Kconfig*: Modify Kconfig to remove dep model 2024-03-27 10:28:12 +01:00
Kevin "Tristate Tom" Weiss
6c6d2f9100
Merge pull request #20410 from benpicco/cpu/esp8266-spi_clk
cpu/esp8266: allow arbitrary SPI clocks
2024-03-26 14:15:50 +00:00
MrKevinWeiss
7a68fb0d5e
*Kconfig*: Remove dep-only Kconfig files 2024-03-26 14:54:22 +01:00
MrKevinWeiss
0a9c51fdf9
*.config: Modify all .config kconfig files 2024-03-26 14:53:40 +01:00
MrKevinWeiss
0f2b71c60e
*Makefile.features: Remove TEST_KCONFIG includes 2024-03-26 14:53:39 +01:00
chrysn
c3020ce3b7 cpu/esp: Use CPU_ESP8266 define instead of the removed MCU_ESP8266
Follow-up-for: https://github.com/RIOT-OS/RIOT/pull/20397
Closes: https://github.com/RIOT-OS/RIOT/pull/20409
Closes: https://github.com/RIOT-OS/RIOT/pull/20415
2024-02-22 14:26:43 +01:00
Benjamin Valentin
75bf0e33e0 cpu/esp8266: allow arbitrary SPI clocks 2024-02-21 23:15:21 +01:00
chrysn
756a384442 makefiles, treewide: Remove MCU variable 2024-02-18 20:46:09 +01:00
Benjamin Valentin
8bcfe7b7b6 cpu/esp8266: ESP8266 needs 5 cycles per busy loop 2024-01-10 22:43:31 +01:00
Marian Buschsieweke
edc43201db
tree-wide: fix typos in doc and comments
This should not change any generated binary
2023-10-16 12:17:48 +02:00
Hugues Larrive
2d660faf74 cpu/esp8266: fix region overflow with '*periph' directory in app path 2023-07-02 12:21:16 +02:00
3989cd79ff
treewide: fix path to shell related tests in doc 2023-05-13 18:27:58 +02:00
Benjamin Valentin
50802b841d cpu/esp_common: use generic WIFI_SSID/WIFI_PASS defines 2023-02-17 15:32:03 +01:00
Benjamin Valentin
124b849503 cpu: call early_init() 2023-01-08 22:26:12 +01:00
bors[bot]
f7ef90d213
Merge #19074
19074: cpu/esp8266: build the SDK bootloader from source r=benpicco a=gschorcht

### Contribution description

This PR is a takeover of PR #17043, which is rebased to the current master and includes some corrections that became necessary after rebasing.

**Copied from description of PR #17043:**

We had four versions of pre-built bootloaders for the esp8266 with different settings of logging and color logging. These bootloaders were manually built from the SDK and shipped with RIOT-OS source code. However there are more settings that affect the bootloader build that are relevant to the app or final board that uses this bootloader. In particular, flash size and flash speed is important for the bootloader to be able to load an app from a large partition table at the fastest speed supported by the board layout and flash chip.

Another example is the UART baudrate of the logging output from the bootloader. The boot ROM will normally start at a baud rate of 74880 (depending on the crystal installed), so it might make sense to keep the UART output at the same speed so we can debug boot modes and bootloader with the same terminal.

This patch builds the `bootloader.bin` file from the ESP8266 SDK source code. The code is built as a module (`esp8266_bootloader`) which at the moment doesn't generate any object code for the application and only produces a `bootloader.bin` file set to the `BOOTLOADER_BIN` make variable for the `esptool.inc.mk` to flash.

The code needs to be compiled and linked with custom rules defined in the module's Makefile since the `bootloader.bin` is its own separate application.

The `BOOTLOADER_BIN` variable is changed from a path relative to the `$(RIOTCPU)/$(CPU)/bin/` directory to be full path. This makes it easier for applications or board to provide their own bootloader binary if needed.

As a result of building the bootloader from source we fixed the issue of having a large partition table.

### Testing procedure

Use following command to flash the application with STDIO UART baudrate of 115200 baud.
```
BAUD=74880 USEMODULE=esp_log_startup make -C tests/shell BOARD=esp8266-esp-12x flash
```
Connect with a terminal programm of your choice (unfortunatly `picocom` and `socat` don't support a baudrate close to 74880), for example:
```
python -m serial.tools.miniterm /dev/ttyUSB0 74880
```
On reset, the `esp8266-esp-12x` node shows the ROM bootloader log output
```
 ets Jan  8 2013,rst cause:2, boot mode:(3,7) 

load 0x40100000, len 6152, room 16 
tail 8
chksum 0x6f
load 0x3ffe8008, len 24, room 0 
tail 8
chksum 0x86
load 0x3ffe8020, len 3408, room 0 
tail 0
chksum 0x79
```
as well as the second-stage bootloader built by this PR (`ESP-IDF v3.1-51-g913a06a9ac3`) at 74880 baudrate.
```
I (42) boot: ESP-IDF v3.1-51-g913a06a9ac3 2nd stage bootloader
I (42) boot: compile time 11:25:03
I (42) boot: SPI Speed      : 26.7MHz
...
I (151) boot: Loaded app from partition at offset 0x10000
```
The application output is seen as garbage since the `esp8266-esp-12x` uses 115200 as baurate by default.

To see all output at a baudrate of 74880 baud, you can use the following command:
```
CFLAGS='-DSTDIO_UART_BAUDRATE=74880' BAUD=74880 USEMODULE=esp_log_startup make -C tests/shell BOARD=esp8266-esp-12x flash
```

If the application is built without options, the ROOM bootloader output will be 74880 baud and the second stage bootloader and application output will be 115200 baud.

### Issues/PRs references

Fixes issue #16402

Co-authored-by: iosabi <iosabi@protonmail.com>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-01-03 00:44:24 +00:00
Gunar Schorcht
f23b20f91f cpu/esp: use FLASHFILE_POS for image position in flash
Instead of using a fixed position of the image file in the flash, the variable `FLASHFILE_POS` is used which allows to override the default position of the image in the flash at 0x10000.
2022-12-31 14:10:57 +01:00
iosabi
073b2209da cpu/esp8266: Build the SDK bootloader from source.
We had four versions of pre-built bootloaders for the esp8266 with
different settings of logging and color logging. These bootloaders were
manually built from the SDK and shipped with RIOT-OS source code.
However there are more settings that affect the bootloader build that
are relevant to the app or final board that uses this bootloader. In
particular, flash size and flash speed is important for the bootloader
to be able to load an app from a large partition table at the fastest
speed supported by the board layout and flash chip.

Another example is the UART baudrate of the logging output from the
bootloader. The boot ROM will normally start at a baud rate of 74880
(depending on the crystal installed), so it might make sense to keep
the UART output at the same speed so we can debug boot modes and
bootloader with the same terminal.

This patch builds the bootloader.bin file from the ESP8266 SDK source
code. The code is built as a module (esp8266_bootloader) which at the
moment doesn't generate any object code for the application and only
produces a bootloader.bin file set to the BOOTLOADER_BIN make variable
for the esptool.inc.mk to flash.

The code needs to be compiled and linked with custom rules defined in
the module's Makefile since the bootloader.bin is its own separate
application.

The `BOOTLOADER_BIN` variable is changed from a path relative to the
`$(RIOTCPU)/$(CPU)/bin/` directory to be full path. This makes it easier
for applications or board to provide their own bootloader binary if
needed.

As a result of building the bootloader from source we fixed the issue of
having a large partition table. Fixes #16402.
2022-12-22 12:18:34 +01:00
Marian Buschsieweke
03b7fe8f0c
cpu/esp8266/periph_timer: allow changing callback or freq
Allow multiple calls to timer_init(), as this is the only way to
change the timer frequency or the callback function.
2022-11-24 22:39:49 +01:00
Benjamin Valentin
b30efeeb65 makefiles/gnu.inc.mk: set flags based on compiler version 2022-11-19 23:14:54 +01:00
Benjamin Valentin
5b359108f7 cpu/esp8266: blacklist -fmacro-prefix-map
This requires at least GCC 8
2022-11-15 20:39:49 +01:00
Benjamin Valentin
7abaae7bbd treewide: fix typos 2022-09-15 12:12:23 +02:00
Gunar Schorcht
f1830294c0 cpu/esp8266: adjust THREAD_STACKSIZE_{SMALL/TINY} 2022-09-02 08:57:09 +02:00
Gunar Schorcht
0574f463bb cpu/esp_common/freertos: changes required for BLE 2022-08-24 18:02:21 +02:00
Gunar Schorcht
c8de46ddee cpu/{esp_common,esp8266,esp32}: fix default FLASH_* configuration
This commit includes the following changes:
- the default flash mode in bootloader should be dio and not dout
- the default flash configuration for ESP32 has to be exported to be also visible in cpu/esp32/bootloader/Makefile
- the comments in  cpu/esp8266/Makefile.include have to be removed so that the flash configuration do not contain trailing white spaces
2022-08-02 07:24:30 +02:00
Gunar Schorcht
b4fafef6e7 cpu/esp_common: replace FLASH_MODE_* by CONFIG_*FLASHMODE_* defines
The former FLASH_MODE_{DOUT,DIO,QOUT,QIO} defines are replaced by the corresponding CONFIG_FLASHMODE_{DOUT,DIO,QOUT,QIO} and CONFIG_ESPTOOLPY_FLASHMODE_{DOUT,DIO,QOUT,QIO} as used by the ESP-IDF. This is also needed for the migration of defining flash mode in Kconfig.
2022-08-01 15:17:33 +02:00
Gunar Schorcht
a24ddb8517 cpu/esp*: cleanups mainly to reduce the vera++ warnings 2022-07-20 06:29:43 +02:00
benpicco
263b918d7c
Merge pull request #18316 from gschorcht/cpu/esp32/use_cpu_fam
cpu/esp32: use CPU_FAM and CPU_ARCH for ESP32x SoC variant dependent compilation
2022-07-18 15:43:59 +02:00
Gunar Schorcht
d0bb51aacc cpu/esp*: move CPU_* definitions to CPU-specific Makefile.features 2022-07-18 13:05:21 +02:00
Gunar Schorcht
f066260a9f cpu/esp8266: move ESP8266 specific Kconfigs to ESP8266 submenu 2022-07-18 09:52:11 +02:00
Gunar Schorcht
8f3df0eee6 cpu/esp_common: move periph/spi to cpu/esp8266
periph/spi implementation can be used for ESP8266 only from now. An implementation using the ESP-IDF spi HAL interface is required for ESP32x SoCs.
2022-07-15 08:57:16 +02:00
Gunar Schorcht
02310b1148 cpu/esp_common: port periph/hwrng to ESP-IDF random API 2022-06-30 11:10:02 +02:00
Gunar Schorcht
d63c116eba cpu/esp_esp8266: move missing _rename_r function to esp_common 2022-06-01 13:31:00 +02:00
Gunar Schorcht
61bf3d2384 cpu/esp*: update/cleanup stack sizes 2022-06-01 13:27:31 +02:00
Gunar Schorcht
60bbe0fe49 cpu/esp_common/makefile: move linking of libhal.a to esp8266 makefile 2022-05-18 07:27:23 +02:00
Francisco Molina
c1238ad4e4 cpu/esp: model missing modules 2022-02-09 16:50:04 +01:00
Gunar Schorcht
881a92fe47 cpu/esp32: remove types.h in sys include 2022-01-25 00:36:51 +01:00
Gunar Schorcht
6c3e7c5db7 cpu/esp*: nfs_flash/cpp dependency cleanup
Module `esp_idf_nvs_flash` uses C++ code. Since  `esp_idf_nvs_flash` module is always enabled on ESP8266, the permanent dependency on `cpp` is correct. But on ESP32, the `esp_idf_nvs_flash` module is only enabled if `esp_wifi_any` is used. Only in that case the compilation should depend on module `cpp`.
2022-01-21 13:32:56 +01:00
Gunar Schorcht
60793f14ae cpu/esp*/vendor: remove -std=c++11 2022-01-13 17:50:59 +01:00
1a3f2d908a
Merge pull request #17424 from gschorcht/cpu/esp/kconfig_cpu_frequency
cpu/esp: integrate CPU clock frequency selection in Kconfig
2022-01-04 12:06:56 +01:00
05da606ea6
Merge pull request #17438 from gschorcht/cpu/esp/feature_cleanup
boards/esp* and cpu/esp: feature definition cleanup
2022-01-04 10:51:33 +01:00
Gunar Schorcht
523bcec8ee cpu/esp*: small documentation fixes
Only formatting issues solved, no content changes.
2021-12-30 14:43:31 +01:00
Gunar Schorcht
6f7ba3500d cpu/esp8266: common periph features moved to cpu/esp_common 2021-12-23 10:34:40 +01:00
Gunar Schorcht
48f59a1487 cpu/esp8266: RTT is used by the WiFi Interface
If the WiFi interface is enabled by module `esp_wifi_any`, binary SDK libraries use the RTT. Therefore, `ztimer` must not use `periph_rtt`as backend, if the WiFi interface is enabled by module `esp_wifi_any`.
2021-12-19 15:56:31 +01:00
Gunar Schorcht
ae8713fea8 cpu/esp8266: places ztimer_core function in IRAM
`ztimer_core` functions have to reside in IRAM for timing reasons and to be available also when the IROM cache is disabled. Although the module is called `ztimer`, its object files are generated in directory `ztimer_core`.
2021-12-19 15:41:25 +01:00
Gunar Schorcht
4d19b77fce cpu/esp8266: add CPU frequency selection to Kconfig 2021-12-19 12:20:43 +01:00