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

136 Commits

Author SHA1 Message Date
AnnsAnn
bd48d0bb82 cpu/esp32: improve build error messages 2024-10-16 16:02:32 +02:00
Gunar Schorcht
70053c5284 cpu/esp32: add LCD low-level parallel interface suppport 2023-11-13 13:01:57 +01:00
Gunar Schorcht
9a49dcd479 cpu/esp32: fix RISC-V ISA for ESP32-C3 with GCC 12.2 2023-10-02 01:44:17 +02:00
Gunar Schorcht
87a9d635c8 cpu/esp32: ensure correct RAM_START_ADDR and RAM_LEN 2023-06-25 18:12:57 +02:00
Gunar Schorcht
b707235592 cpu/esp32: define RAM_START_ADDR and RAM_LEN 2023-06-25 17:33:06 +02:00
MrKevinWeiss
92794c0eca
boards/*: Model usb and stdio in Kconfig 2023-05-31 13:04:42 +02:00
Gunar Schorcht
0de2570802 cpu/esp32: fix compilation with gcc 12.2 2023-04-17 07:32:48 +02:00
bors[bot]
7855aad7e4
Merge #19079
19079: cpu/esp32: add periph_flashpage support r=kaspar030 a=gschorcht

### Contribution description

This PR provides the `periph_flashpage` support for ESP32x SoCs.

For byte-aligned read access to constant data in the flash, the MMU of all ESP32x SoCs allows to map a certain number of 64 kByte pages of the flash into the data address space of the CPU. This address space is called DROM. Normally the whole DROM address space is assigned to the section `.rodata`. The default flash layout used by all ESP32x SoCs is:
| Address in Flash | Content |
|:-----------------------|:-----------|
| `0x0000` or `0x1000` | bootloader |
| `0x8000` | parition table |
| `0x9000` | `nvs` parition with WiFi data |
| `0xf000`  | `phy_init` partition with RF data |
| `0x10000` | `factory` partition with the app image |

The factory partition consists of a number of 64 kByte pages for the sections `.text`, `.rodata`, `.bss` and others. The `.text` and `rodata` sections are page-aligned and are simply mapped into the instruction address space (IROM) and the data address space (DROM), respectively. All other sections are loaded into RAM.

If the `periph_flashpage` module is used, the `periph_flashpage` driver
- decreases the size of the `.rodata` section in DROM address space by `CONFIG_ESP_FLASHPAGE_CAPACITY`,
- adds a section `.flashpage.writable` of size `CONFIG_ESP_FLASHPAGE_CAPACITY` at the end of DROM address space that is mapped into data address space of the CPU,
- reserves a region of size `CONFIG_ESP_FLASHPAGE_CAPACITY` starting from `0x10000` in front of the image partition `factory` and
- moves the image partition `factory` by  `CONFIG_ESP_FLASHPAGE_CAPACITY` to address `0x10000 + CONFIG_ESP_FLASHPAGE_CAPACITY`. 

The new flash layout is then:
| Address in Flash | Content |
|:-----------------------|:-----------|
| `0x0000` or `0x1000` | bootloader |
| `0x8000` | parition table |
| `0x9000` | `nvs` parition with WiFi data |
| `0xf000`  | `phy_init` partition with RF data |
| `0x10000` | flashpage region |
| `0x10000 + CONFIG_ESP_FLASHPAGE_CAPACITY` | `factory` partition with the app image |

This guarantees that the flash pages are not overwritten if a new app image with changed size is flashed. `CONFIG_ESP_FLASHPAGE_CAPACITY` has to be a multiple of 64 kBytes.

~The PR includes PR #19077 and PR #19078 for the moment to be compilable.~

### Testing procedure

The following tests should pass.
```
USEMODULE='esp_log_startup ps shell_cmds_default' BOARD=esp32-wroom-32 make -j8 -C tests/periph_flashpage flash term
```
```
USEMODULE='esp_log_startup ps shell_cmds_default' BOARD=esp32-wroom-32 make -j8 -C tests/mtd_flashpage flash term
```

### Issues/PRs references

Depends on PR #19077
Depends on PR #19078 


Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-01-18 17:48:29 +00:00
Benjamin Valentin
55b5c47bc8 cpu/esp32: add stdio_usb_serial_jtag 2023-01-09 00:51:27 +01:00
Gunar Schorcht
32168da8d6 cpu/esp32: add flashpage support
f
2023-01-07 14:49:36 +01:00
Gunar Schorcht
6f9c64c6cb cpu/esp32: add flashpage support to Kconfig 2023-01-07 10:38:52 +01:00
bors[bot]
6b4b7542eb
Merge #19078
19078: cpu/esp32: define FLASHFILE_POS r=benpicco a=gschorcht

### Contribution description

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.

This PR is a prerequisite for the `periph_flashpage` implementation PR #19079.

### Testing procedure

Flashing a ESP32x SoC should work with `FLASHFILE_POS=0x20000`, for example:
```
USEMODULE=esp_log_startup FLASHFILE_POS=0x20000 BOARD=esp32-wroom-32 make -j8 -C tests/shell flash
```
The bootloader output should give `00020000` as offset for the `factory` partition
```
I (75) boot: Partition Table:
I (78) boot: ## Label            Usage          Type ST Offset   Length
I (84) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (91) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (97) boot:  2 factory          factory app      00 00 00020000 000199b0
I (104) boot: End of partition table
```
and
```
I (125) esp_image: segment 0: paddr=00020020 vaddr=3f400020 size=02140h (  8512) map
```
during the load of the image.

### Issues/PRs references

Prerequisite for PR #19079

Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
2023-01-02 18:18:19 +00:00
Gunar Schorcht
8381cd3633 cpu/esp32: using configurable linker scripts in makefiles 2022-12-31 16:03:46 +01:00
Gunar Schorcht
a0715b281b cpu/esp32: export FLASH_SIZE to SDK configuration 2022-12-31 14:10:57 +01: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
Marian Buschsieweke
c1a62f316e
cpu/esp32: move ESP32_SDK_DIR definition here
The definition in `pkg/esp32_sdk/Makefile.include` was evaluated by
`make` after the include paths were already set, resulting in
`ESP32_SDK_DIR` being empty in

    INCLUDES += -I$(ESP32_SDK_DIR)/components
    [...]

This in turn resulted in

    cc1: error: /components: No such file or directory [-Werror=missing-include-dirs]
    [...]
2022-10-10 20:39:47 +02:00
Gunar Schorcht
8e351b3d5b cpu/esp32: add vendor header file for periph_usbdev
This file is an excerpt of STM32 header file `stm32/smsis/f7/include/stm32f767xx.h` since the ESP32x SoCs use the same Synopsys DWC2 IP core as USB peripherals.
2022-09-27 01:00:57 +02:00
Gunar Schorcht
23b5a785b8 cpu/esp32: add ESP-IDF USB code as module esp_idf_usb 2022-09-27 01:00:57 +02:00
benpicco
2917c0f51e
Merge pull request #18506 from gschorcht/cpu/esp32/add_esp32s2_cpu_support
cpu/esp32: add support for ESP32-S2
2022-08-30 21:24:36 +02:00
Gunar Schorcht
b96aac842b cpu/esp32: export FLASH_* settings
To get FLASH_* settings visible in cpu/esp32/bootloader/Makefile, they have to be exported in cpu/esp32/Makefile.include
2022-08-30 15:08:39 +02:00
Gunar Schorcht
5e0b1d665b cpu/esp32: add BLE support for ESP32-S3 2022-08-26 21:16:09 +02:00
Gunar Schorcht
aba5e35ac4 cpu/esp32: add BLE support for ESP32-C3 2022-08-26 17:10:42 +02:00
Gunar Schorcht
56e59eb036 cpu/esp32: add NimBLE support for ESP32 2022-08-24 09:05:25 +02:00
Gunar Schorcht
abccc41db7 cpu/esp32: add BLE support for ESP32 2022-08-24 09:05:25 +02:00
Gunar Schorcht
cd5c350e88 cpu/esp32: add ESP32-S2 support in makefiles 2022-08-23 17:34:25 +02:00
Gunar Schorcht
f0b619bed2 cpu/esp32: add ESP32-S3 support in makefiles 2022-08-09 15:57:18 +02:00
Gunar Schorcht
da39354ae5 cpu/esp32: set CONFIG_ESPTOOL_FLASH_FREQ from FLASH_FREQ
CONFIG_ESPTOOL_FLASH_FREQ_* defines are used in ESP-IDF to select the right SPI clock speed for flash.
2022-08-02 07:24:30 +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
d6aeea7e75 cpu/esp32: rename architecture to riscv_esp32 to rv32 2022-07-20 17:18:56 +02:00
Gunar Schorcht
257d4c3677 cpu/esp32: move linker scripts to a CPU family specific dir 2022-07-18 17:18:59 +02:00
Gunar Schorcht
0bec8a81ac cpu/esp32: use CPU_FAM instead of CPU in Makefiles
To support ESP32x families with the existing Makefiles, CPU_FAM is used instead of CPU in the Makefiles.
2022-07-18 13:05:21 +02:00
Gunar Schorcht
7e19086a60 cpu/esp32: use ESP-IDF timer HAL for system timer in syscalls 2022-06-29 08:37:43 +02:00
Gunar Schorcht
1f25ac8893 cpu/esp32: ESP32 variant independent makefiles 2022-06-23 13:19:40 +02:00
Gunar Schorcht
587e007a31 ecp/esp32: changes in periph_can for ESP-IDF v4.4 2022-06-01 13:31:00 +02:00
Gunar Schorcht
e8b4a4feb2 cpu/esp32: changes for ESP-IDF v4.4 2022-06-01 13:28:49 +02:00
Gunar Schorcht
92b7b8a3d7 cpu/esp32: disable the use of newlib's pthread headers 2022-03-10 05:31:04 +01:00
Gunar Schorcht
395ec06c16 dist/tools/esptool: upgrade to v3.2 for ESP32 2022-03-08 09:31:42 +01:00
Leandro Lanzieri
74c8893a4f
cpu/esp32/esp-eth: move GNRC auto init to init_devs 2022-03-04 09:41:18 +01:00
Gunar Schorcht
fdabe050ed cpu/esp32: skip inclusion of toolchain pthread types
The toolchain provides POSIX type definitions for pthread which conflicts with that in RIOT. With the CFLAGS/CXXFLAGS skip the inclusion of the types shipped by the toolchain.
2022-01-25 00:36:51 +01:00
Gunar Schorcht
e15e18b195 cpu/esp32: fix compilation errors 2022-01-25 00:36:51 +01:00
Gunar Schorcht
f9105c3cc1 cpu/esp32: use INCLUDES as defined in pkg/esp32_sdk
The include pathes for the ESP32 SDK are now defined by `pkg/esp32_sdk`. They can be used in Makefiles directly.
2022-01-04 16:34:31 +01:00
Gunar Schorcht
d6c2926933 pkg/esp32_sdk: add ESP32 SDK without libraries as package
The vendor binary libraries of ESP-IDF are provided as a separate GIT repository. These libraries are defined as separate package for two reasons: 1. RIOT packages don't support to clone GIT repositories recursively; 2. ESP-IDF pulls a lot of other GIT repositories that are not needed when it is cloned recursively.
2022-01-04 16:34:31 +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
a685e037c7
cpu/esp32: check for cpp module instead of used feature 2021-12-10 18:54:28 +01:00
Leandro Lanzieri
281519881e
cpu/esp32: fix esp_jtag dependency
In order to work properly dependencies should be placed on the
Makefile.dep files, not on Makefile.include.
2021-12-10 18:54:27 +01:00
Gunar Schorcht
6123cde033 cpu/esp32: cleanup of pseudomodule definition 2021-12-02 06:17:48 +01:00
Erik Ekman
cbfe502cc6 cpu/esp32: Reset when starting debugging
To avoid 'Target not examined yet' error
2021-10-18 20:11:32 +02:00
Erik Ekman
1c6d7dcdaf tools/openocd: Make verifying flashed image optional
Checksumming flash is not supported on xtensa platform:

Warn : not implemented yet

make: *** [.../RIOT/examples/saul/../../Makefile.include:796: flash] Error 1
2021-10-15 10:13:25 +02:00
Erik Ekman
2df7d499c8 tools/openocd: Export IMAGE_OFFSET only when flashing 2021-10-15 10:12:40 +02:00
Erik Ekman
d47aa2d550 cpu/esp32: Flash bootloader, partition and app via openocd
https://github.com/espressif/openocd-esp32 is needed.

Example config (when compiled from source):
export OPENOCD="~/esp/openocd-esp32/src/openocd -s ~/esp/openocd-esp32/tcl"
2021-10-15 10:00:57 +02:00