Commit Graph

1978 Commits

Author SHA1 Message Date
Angus Gratton
f8b9cb2864 paritition_table: Verify the partition table md5sum when loading the app
Additionally, always enable the partition MD5 check if flash encryption is on in
Release mode. This ensures the partition table ciphertext has not been modified
(CVE-2021-27926).

The exception is pre-V3.1 ESP-IDF bootloaders and partition tables, which
don't have support for the MD5 entry.
2021-06-02 06:35:45 +00:00
Angus Gratton
d52331849e Merge branch 'bugfix/flash_rodata_any_alignement_v4.2' into 'release/v4.2'
build: Fix cache issue and add dedicated section for (Custom) App version info (backport v4.2)

See merge request espressif/esp-idf!13465
2021-05-11 01:03:12 +00:00
Jiang Jiang Jian
d29cce7f0a Merge branch 'bugfix/fix_some_pm_issue_v4.2' into 'release/v4.2'
esp_pm: add an interface to get pm configuration (backport to v4.2)

See merge request espressif/esp-idf!13124
2021-05-10 03:45:55 +00:00
Ivan Grokhotkov
af7b21851e freertos: fix TLS run-time address calculation
Since dd849ffc, _rodata_start label has been moved to a different
linker output section from where the TLS templates (.tdata, .tbss)
are located. Since link-time addresses of thread-local variables are
calculated relative to the section start address, this resulted in
incorrect calculation of THREADPTR/$tp registers.

Fix by introducing new linker label, _flash_rodata_start, which points
to the .flash.rodata output section where TLS variables are located,
and use it when calculating THREADPTR/$tp.

Also remove the hardcoded rodata section alignment for Xtensa targets.
Alignment of rodata can be affected by the user application, which is
the issue dd849ffc was fixing. To accommodate any possible alignment,
save it in a linker label (_flash_rodata_align) and then use when
calculating THREADPTR. Note that this is not required on RISC-V, since
this target doesn't use TPOFF.
2021-05-10 11:18:09 +08:00
Omar Chebib
974b8dd4c4 build: (Custom) App version info is now on a dedicated section, independent of the rodata alignment
It is now possible to have any alignment restriction on rodata in the user
applicaiton. It will not affect the first section which must be aligned
on a 16-byte bound.

Closes https://github.com/espressif/esp-idf/issues/6719
Closes https://github.com/espressif/esp-idf/issues/6976
2021-05-10 11:17:58 +08:00
Angus Gratton
c8d15588e5 Merge branch 'bugfix/rtc_fast_memory_force_on_in_use_for_heap_backport_v4.2' into 'release/v4.2'
Bugfix/rtc fast memory force on in use for heap (backport v4.2)

See merge request espressif/esp-idf!12873
2021-04-23 09:06:40 +00:00
ninh
e378ecd6cf esp_pm: add an interface to get pm configuration (backport to v4.2) 2021-04-13 17:15:35 +08:00
Hou Wen Xiang
c8ef66abad driver(uart): fix uart module reset issue (release V4.2) 2021-03-24 04:10:39 +00:00
Jiang Jiang Jian
c04489cede Merge branch 'bugfix/dport_init_min_stack_size_v4.2' into 'release/v4.2'
freertos: Increase minimum task stack size when stack smashing checker is enabled (v4.2)

See merge request espressif/esp-idf!12799
2021-03-24 04:06:45 +00:00
fuzhibo
9cb875949c fix: RTC_FAST_MEM always power on if used for heap 2021-03-24 11:52:55 +08:00
Marius Vikhammer
fa62dfd5f9 CI: disable performance check for PSRAM config
The cache compensated timer performance check ocasionally
wrong result for psram_2 config. Disabled CI test for now.
2021-03-22 11:39:49 +08:00
Angus Gratton
7fc2f91841 freertos: Increase minimum task stack size when stack smashing checker is enabled
Fixes issue with DPORT init task, this task uses minimum stack size and may not be
enough if stack smashing detection is set to Overall mode.

Also reworks the way we calculate minimum stack to allow for adding multiple
contributing factors.

Closes https://github.com/espressif/esp-idf/issues/6403
2021-03-19 12:19:58 +08:00
xiehang
07ca98b5f0 esp_wifi: ESP32 phy add [sections:phy_iram] 2021-03-19 03:02:26 +00:00
Jiang Jiang Jian
c4c500e241 Merge branch 'bugfix/deep_sleep_stub_heap_rtc_fast_mem_v4.2' into 'release/v4.2'
deep sleep: Calculate RTC CRC without using any stack or other RTC heap memory (v4.2)

See merge request espressif/esp-idf!10883
2021-03-18 04:09:50 +00:00
Angus Gratton
ce2c615bb3 Merge branch 'bugfix/deepsleep_disable_brownout_s2_v4.2' into 'release/v4.2'
deep_sleep: on S2 disable the brown out detector before deep sleeping (v4.2)

See merge request espressif/esp-idf!12500
2021-03-11 10:49:30 +00:00
Marius Vikhammer
cf87e114cb deep_sleep: on S2 disable the brown out detector before deep sleeping
On S2 the brown out detector would occasionally trigger erroneously during deep sleep.

Disable it before sleeping to circumvent this issue.

Closes https://github.com/espressif/esp-idf/issues/6179
2021-02-25 14:58:50 +08:00
Michael (XIAO Xufeng)
15f406ddb7 spi_flash: add config option to override flash size in bootloader header
Sometimes the flash size read from bootloader is not correct. This may
forbid SPI Flash driver from reading the the area larger than the size
in bootloader header.

When the new config option is enabled, the latest configured
ESPTOOLPY_FLAHSIZE in the app header will be used to override the value
read from bootloader header.
2021-02-22 23:18:17 +08:00
Angus Gratton
7c5afa262d deep sleep: Calculate RTC CRC immediately before deep sleep, without using RAM
Fix for issues where RTC FAST memory is updated as part of going into deep
sleep. Very high risk if heaps are in RTC memory - in particular task stacks
may be in RTC memory, but also other variables.

Also fixes potential concurrency problems as RTC FAST memory is not accessible
by CPU during the CRC calculation itself.

Method:
- Disable interrupts (currently for single core only, will need update for S3)
- Load all registers before calculating CRC or going to sleep
2021-02-08 09:59:22 +11:00
Angus Gratton
bf9b9c5a97 esp_system: Add test case for using deep sleep wake stub when stack is in RTC memory
This test currently fails on ESP32 & ESP32-S2, fix will be in next commit.
2021-02-08 09:59:22 +11:00
Krzysztof Budzynski
2ef417df5f Merge branch 'docs/update_rtc_clock_source_description_in_api_references_backport_v4.2' into 'release/v4.2'
docs: update the description for RTC Clock Sources for esp32 and esp32s2 (backport/v4.2)

See merge request espressif/esp-idf!11329
2020-12-08 10:47:42 +08:00
KonstantinKondrashov
3d03264b0a esp32xx: Fix default values for all RTC sources in RTC_CLK_CAL_CYCLES option
Closes: https://github.com/espressif/esp-idf/issues/6037
2020-11-30 23:09:13 +08:00
Wang Fang
e9dae152cd docs: update the description for RTC Clock Sources for esp32 and esp32s2 2020-11-23 11:37:15 +08:00
Armando
4c7dca7105 spi: fix issue with closing DMA before CPU reset 2020-10-16 06:00:18 +00:00
Angus Gratton
16ed6a4574 Merge branch 'feature/switch_from_external_to_interanl_ram_v4.2' into 'release/v4.2'
esp32: Switch SPIRAM stack in esp_restart_noos() to internal stack (v4.2)

See merge request espressif/esp-idf!9966
2020-10-08 11:22:55 +08:00
Jakob Hasse
26481c4a9d toolchain: C++ exception workaround
* disable C++ exception FDE sorting (saves RAM)

Closes IDF-1128
2020-09-18 12:32:34 +07:00
KonstantinKondrashov
94597fc8e3 esp32: Switch SPIRAM stack in esp_restart_noos() to internal stack
If esp_restart_noos() is run and the stack address points to external memory (SPIRAM)
then Cache_Read_Disable() raises up the error "Cache disabled but cached memory region accessed"
to fix this we switch stack to internal RAM before disable cache.

Added unit tests.

Closes: https://github.com/espressif/esp-idf/issues/5107
2020-08-10 09:41:35 +00:00
Jiang Jiang Jian
0db87821f1 Merge branch 'bugfix/customer_baidu_int_wdt_v4.2' into 'release/v4.2'
backport v4.2: add soft solution for esp32 eco3 live lock issue

See merge request espressif/esp-idf!9223
2020-08-07 14:12:00 +08:00
Angus Gratton
9409b2ecb7 Merge branch 'feature/support_for_esp32_pico_v3_02_v4.2' into 'release/v4.2'
psram: support for esp32-pico-v3-02 (backport v4.2)

See merge request espressif/esp-idf!9787
2020-08-04 14:30:14 +08:00
Li Shuai
e911826340 add soft solution for esp32 eco3 live lock issue 2020-08-04 05:50:18 +00:00
Darian Leung
e6db25af9d TWAI: Add ESP32-S2 support
This commit adds TWAI driver support for the
ESP32-S2. The following features were added:

- Expanded BRP support
- Expanded CLKOUT Divider Support
- Updated example READMEs
2020-07-30 22:09:39 +08:00
Angus Gratton
a94685a222 esp32: Use package identifier to look up SPI flash/PSRAM WP Pin, unless overridden
Allows booting in QIO/QOUT mode or with PSRAM on ESP32-PICO-V3 and
ESP32-PICO-V3-O2 without any config changes.

Custom WP pins (needed for fully custom circuit boards) should still be compatible.
2020-07-24 21:45:31 +08:00
chenjianqiang
55a1bd0fb6 feat(esp32): support for esp32-pico-v3-02 2020-07-24 21:20:27 +08:00
chenjianqiang
c945cb59d8 feat(psram): support 16Mbit PSRAM for esp32 2020-07-24 21:19:45 +08:00
chenjianqiang
6a253e8809 bugfix(psram): configure MMU after PSRAM initialization 2020-07-24 21:10:37 +08:00
Michael (XIAO Xufeng)
76c1be0d94 spiram: fix the read id failure
The issue is caused by:
1. The disable_qio_mode inside read_id may have side effects.
2. read_id twice may have side effects.

Fix this issue by moving disable_qio_mode out of read_id and only do it
once before read_id. And retry read_id only when the first one is
failed.

Issue introduced in 3ecbb59c15.
2020-06-30 21:45:31 +08:00
chenjianqiang
a3a4c828e9 psram: fix 16mbit psram id read error 2020-06-30 21:44:39 +08:00
KonstantinKondrashov
a6ac0e8a51 esp32: Reduce using ESP_EARLY_LOGx and move some code after the stdout initialization
After setting _GLOBAL_REENT, ESP_LOGIx can be used instead of ESP_EARLY_LOGx.

Closes: https://github.com/espressif/esp-idf/issues/5343
2020-06-17 13:40:42 +08:00
Angus Gratton
baedfab382 Merge branch 'feature/dis_uart_dl_mode' into 'master'
feature: Disable UART download mode

Closes IDF-1386

See merge request espressif/esp-idf!8590
2020-05-29 14:09:54 +08:00
Angus Gratton
59f29cbca8 Merge branch 'feature/allow_rtc_memory_for_task_stacks' into 'master'
Add RTC Fast Memory to Dynamic Memory Pool

See merge request espressif/esp-idf!8390
2020-05-29 14:07:01 +08:00
Angus Gratton
f64ae4fa99 efuse: Add 'disable Download Mode' & ESP32-S2 'Secure Download Mode' functionality 2020-05-28 17:50:45 +10:00
Angus Gratton
084e170a8f Merge branch 'refactor/esp_ipc' into 'master'
Split esp_ipc to a seaparate component

Closes IDF-1295

See merge request espressif/esp-idf!8520
2020-05-25 15:03:04 +08:00
Darian Leung
11d96b39d0 esp_ipc: Move to new component
This commit moves esp_ipc into a separate component.
2020-05-18 16:51:45 +08:00
Mahavir Jain
1aac284dda heap: add rtc fast memory region to dynamic pool
- for ESP32 only enabled in case of unicore config
- capability wise this region (8K) is same as DRAM, except non-DMA capable
- also fixed small issue in reserved memory region processing when (start == end)
2020-05-14 13:12:26 +00:00
Sachin Parekh
46d914ff45 gdb: Modify PC in case of invalid PC
Signed-off-by: Sachin Parekh <sachin.parekh@espressif.com>
2020-05-08 18:34:52 +05:30
Angus Gratton
d013105256 Merge branch 'feature/twdt_prints_backtrace' into 'master'
Add Task Watchdog backtrace printing

Closes IDF-1072

See merge request espressif/esp-idf!8136
2020-05-04 14:58:53 +08:00
Angus Gratton
fdd6bfe3c4 Merge branch 'bugfix/sleep_comments' into 'master'
doc: Specify that sleep wakeup source restrictions apply to all current ESP32 revisions

See merge request espressif/esp-idf!8351
2020-04-30 13:36:58 +08:00
Darian Leung
b097dd0a79 Add Task Watchdog backtrace printing
This commit makes the Task Watchdog print the backtrace of both
cores when it times out.
2020-04-27 18:11:29 +00:00
Ivan Grokhotkov
275ed32a11 Merge branch 'feature/esp32s2_iram_dram_protection' into 'master'
esp32s2: IRAM/DRAM memory protection

See merge request espressif/esp-idf!8156
2020-04-23 21:52:54 +08:00
Mahavir Jain
44939a6b1e Merge branch 'feature/iram_data_bss' into 'master'
esp32: IRAM_DATA_ATTR and IRAM_BSS_ATTR introduced

See merge request espressif/esp-idf!8377
2020-04-22 21:44:44 +08:00
Martin Vychodil
7491ea677a esp32s2: IRAM/DRAM memory protection
* new mem_prot API
* mem_prot on & locked by default (see Kconfig)
* feature activated in start_cpu0_default()

JIRA IDF-1355
2020-04-21 15:10:58 +02:00