Commit Graph

650 Commits

Author SHA1 Message Date
Song Ruo Jing
1eb9a24a48 esp_system: Minor update for esp32c6 2022-09-26 20:32:13 +08:00
jingli
60c1811433 esp_hw_support/clk_cali: remove redundant check for cali value 2022-09-21 03:03:25 +00:00
jingli
05a2fbe810 esp_hw_support/clk_cali: fix xtal32k error detect 2022-09-21 03:03:25 +00:00
Darian Leung
0c97fbd5ba riscv: Remove redundant riscv_interrupts.h header
This commit removes the riscv_interrupts.h header is it has become redundant. The previously
exposed API has been handled as follows:

- "riscv_interrupt_enable()" and "riscv_interrupt_disable()" have been removed. These functions
  were declarations only and never had any implementation.
- "riscv_global_interrupts_enable()" and "riscv_global_interrupts_disable()" renamed to
  "rv_utils_intr_global_enable()" and "rv_utils_intr_global_disable()" respectively and now
  placed in rv_utils.h
2022-09-16 16:45:43 +08:00
Omar Chebib
6798bfc4b0 TWDT: the Kconfig option ESP_TASK_WDT_EN is now used to enable Task Watchdog 2022-09-15 14:37:59 +08:00
Omar Chebib
30d12af191 TWDT: refactor the TWDT to be driver agnostic
This refactoring brings a private API for the TWDT implementation, which
can now use a hardware timer (Timer Group) or a software timer (esp_timer)
2022-09-15 14:37:59 +08:00
Omar Chebib
53c7dd4efc WDT: implement interrupt wdt and task wdt for ESP32-C2
ESP32-C2 has a single group timer, thus it will use it for the interrupt watchdog,
which is more critical than the task watchdog. The latter is implement in
software thanks to the `esp_timer`component.
2022-09-15 14:37:59 +08:00
wuzhenghui
ab09c07fdd esp32c6: add esp_system support 2022-09-06 09:13:20 +00:00
wuzhenghui
82ffe7e438 replacing reset by register operations with ROM interfaces to decouple the effects of register name changes 2022-08-31 01:59:36 +00:00
Armando
2d44dc1eed mmu: driver framework, for vaddr maintenance
This commit gives basic mmu driver framework. Now it is able to maintain
mmu virtual address usage on esp32, esp32s2 and esp32s3. Usage to
external virtual address should rely on mmu functions to know which
address range is available, instead of hardcoded.

This commit also improves psram memory that is added to the heap
allocator. Now it's added to the heap, according to the memory
alignment.

Closes https://github.com/espressif/esp-idf/issues/8295
2022-08-26 17:59:06 +08:00
Michael (XIAO Xufeng)
0a2e5a7774 Merge branch 'feat/support_esp32c2_uart' into 'master'
uart: update console docs about frequency for ESP32-C2, move frequency of clock sources out of HAL

Closes IDF-5424 and IDF-4332

See merge request espressif/esp-idf!19274
2022-08-22 14:24:26 +08:00
Darian Leung
fbcde6777f newlib: Add workaround for printf functions using 32-bit time_t on first call
sizeof(time_t) was previously switched from 4 to 8, ROM functions that use
time_t or dependent types (such as "struct stat") are no longer called due as
they still treat sizeof(time_t) as 4 (see commit
24c20d188e).

However, there is a ROM callpath that was left out. If putchar is the first
stdio print related call, the call path will result in cantwrite() ->
__swsetup_r() -> __smakebuf_r() -> __swhatbuf_r() using the ROM "struct stat"
(where sizeof(time_t)==4).

Instead of removing all printf related ROM newlib functions (which will result
in increased binary size), this commit adds a workaround to setup the stdio
files before any print related calls occur.

This results in cantwrite() always returning false, thus the callpath described
above never being reached.

Closes https://github.com/espressif/esp-idf/issues/9269
2022-08-21 15:27:50 +08:00
Jakob Hasse
bcb34ca7ae Merge branch 'feature/critical_section_api' into 'master'
esp_system: critical section api

Closes IDF-4754

See merge request espressif/esp-idf!19019
2022-08-19 15:30:44 +08:00
songruojing
304a8f142d esp32c6: introduce the target
Add esp32c6 target to tools and Kconfig
Create directories and files that are essential for `idf.py --preview set-target esp32c6`
2022-08-19 11:13:02 +08:00
Jakob Hasse
3f95fdcb15 feat (esp_system): simple os abstraction layer for critical sections 2022-08-17 10:04:35 +02:00
Laukik Hase
0071ea498f
esp_app_format: Fixed build errors and resolved dependencies 2022-08-17 10:59:31 +05:30
Michael (XIAO Xufeng)
746f4b814c uart: move frequency of clock sources out of HAL 2022-08-15 18:55:43 +00:00
Darian Leung
a73dd07d12 esp_hw_support: Fix esp_light_sleep_start() deadlock
esp_light_sleep_start() will stall the other CPU via esp_ipc_isr_stall_other_cpu(). After stalling the other CPU,
will call esp_clk_... API which themselves take locks. If the other stalled CPU is holding those locks, this will
result in a deadlock.

This commit adds a workaround calling esp_clk_private_lock() to take the lock before stalling the other CPU.
2022-08-10 18:52:32 +08:00
jingli
ee3423834e kconfig: refactor xtal freq kconfig to common configuration item 2022-08-05 19:12:29 +08:00
Ivan Grokhotkov
401c10ecfb build system: re-add -Wno-format as private flag for some components 2022-08-03 16:42:47 +04:00
Omar Chebib
2f7bae7a6e Task WDT: add a panic test case for to test panic on both CPU cores 2022-08-02 12:41:14 +08:00
Omar Chebib
e25cda2c40 Task WDT: Interuptee task stack is now used for backtracing, regardless of the CPU core
For RISC-V and Xtensa targets, in case a panic needs to happen when
Task WDT is triggered (ESP_TASK_WDT_PANIC), the interruptee's stack
is now used for printing the backtrace.
Abort after Task Watchdog is triggered can happen on APP CPU (second core).
2022-08-02 12:41:14 +08:00
Marius Vikhammer
67d0a10548 Merge branch 'bugfix/rtc_brownout_isr_handler_stall' into 'master'
system: fix brownout ISR triggering assert on single-core configs.

Closes IDFGH-7939

See merge request espressif/esp-idf!19304
2022-08-02 10:38:29 +08:00
Roland Dobai
956f08826f Merge branch 'fix/esp32c2_gcov_example_build' into 'master'
esp32c2: fix gcov example build

See merge request espressif/esp-idf!19201
2022-08-01 20:28:36 +08:00
Marius Vikhammer
0f555b2a1d system: fix brownout ISR triggering assert on single-core configs.
ISR handler was incorrectly calling stall other cpu even on single core systems

Closes https://github.com/espressif/esp-idf/issues/9456
2022-08-01 16:18:30 +08:00
morris
dba813bac4 Merge branch 'bugfix/disable_rom_lgo' into 'master'
system: moved placement of disable rom log efuse in startup flow

Closes IDFGH-7940

See merge request espressif/esp-idf!19305
2022-08-01 16:04:20 +08:00
Ivan Grokhotkov
0d4a533b74 Merge branch 'bugfix/usb_console_reset' into 'master'
esp_system: usb_console: fix restart when Wi-Fi is working

Closes IDFGH-5683

See merge request espressif/esp-idf!19289
2022-08-01 13:36:44 +08:00
Marius Vikhammer
da91fb7a81 system: moved placement of disable rom log efuse in startup flow
Functions used for burning this efuse would log, but at this point
esp_log is not initialized. Moved to a later point in the startup process.

Closes https://github.com/espressif/esp-idf/issues/9457
2022-08-01 11:16:17 +08:00
Darian Leung
e073fc4254 esp_system: Increase IPC stack size for ESP32-S3
ESP32-S3 stacks have currently have less useable space compared to other targets (due to
AI coprocessor context registers). This has caused a stack overflow in the IPC tasks under
some configurations. This commit increases the default IPC stack size for the ESP32-S3.
2022-07-29 15:00:57 +08:00
Ivan Grokhotkov
bf10146a15
esp_system, vfs: fix incomplete blocking reads in vfs_cdcacm
Blocking read from cdcacm VFS could return less bytes than requested.
This didn’t match the behaviour of other VFS drivers, and higher level
code could misbehave.
2022-07-28 17:28:08 +02:00
Ivan Grokhotkov
3254f8deae
esp_system: usb_console: fix restart when Wi-Fi is working
Previously, reset over USB CDC was done by calling esp_restart from
an interrupt handler. This works only until some restart hook function
is registered using esp_register_shutdown_handler, and the hook
function tries to do something that isn’t allowed in an interrupt
handler. One such case is with Wi-Fi. When Wi-Fi driver is installed,
it registers esp_wifi_stop as a shutdown handler function. However
esp_wifi_stop cannot be called from an ISR, and hence we shouldn’t
call esp_restart from an ISR either.

This commit modifies USB CDC driver to call esp_restart by posting it
to esp_timer task.

Closes https://github.com/espressif/esp-idf/issues/7404
2022-07-28 17:15:03 +02:00
Erhan Kurubas
22d771bf51 esp32c2: fix gcov example build 2022-07-28 13:59:29 +02:00
Darian Leung
05ff1039dc esp_hw_support: Fix misuse of spinlocks as critical sections
Spinlocks themselves do not constitute critical sections as after a spinlock is acquired, interrupts
can remain enabled. However, there are some places where spinlocks are used direclty instead of using
the portMUX_TYPE and portENTER_CRITICAL_...() APIs. This commit fixes those calls.
2022-07-28 17:25:00 +08:00
Darian
c8ee369a7c Merge branch 'feature/deprecate-old-cpu-api' into 'master'
HAL: Deprecate old CPU/SoC/Interrupt Controller HAL API

Closes IDF-4919 and IDF-5032

See merge request espressif/esp-idf!18987
2022-07-23 00:37:33 +08:00
Jakob Hasse
bff6826ee1 bugfix (esp_system): made xt_wdt spinlock static 2022-07-22 08:17:59 +00:00
Guillaume Souchere
0bac33ed41 esp_system: Remove deprecate section from esp_cpu.h
- Remove esp_cpu_in_ocd_mode() from esp_cpu.h. Users should call esp_cpu_dbgr_is_attached() instead.
- Remove esp_cpu_get_ccount() from esp_cpu.h. Users should call esp_cpu_get_cycle_count() instead.
- Remove esp_cpu_set_ccount() from esp_cpu.h. Users should call esp_cpu_set_cycle_count() instead.
- Other IDF components updated to call esp_cpu_dbgr_is_attached(), esp_cpu_get_cycle_count() and esp_cpu_set_cycle_count() as well.
2022-07-22 00:06:06 +08:00
Guillaume Souchere
6005cc9163 hal: Deprecate interrupt_controller_hal.h, cpu_hal.h and cpu_ll.h interfaces
This commit marks all functions in interrupt_controller_hal.h, cpu_ll.h and cpu_hal.h as deprecated.
Users should use functions from esp_cpu.h instead.
2022-07-22 00:06:06 +08:00
Marius Vikhammer
ccc184de51 ipc: Increase stacksize when compiling with -O0 2022-07-18 13:55:03 +08:00
Fu Hanxi
c0568611dd docs: changes docs supported targets tables 2022-07-14 08:26:32 +08:00
Fu Hanxi
05d2357062 feat: use standalone project idf-build-apps for find/build apps utils 2022-07-14 08:26:31 +08:00
Ivan Grokhotkov
230e732018 Merge branch 'feature/system_init_priorities' into 'master'
esp_system: introduce priorities for startup functions

Closes IDFGH-5683 and IDF-4954

See merge request espressif/esp-idf!18159
2022-07-14 06:22:25 +08:00
Ivan Grokhotkov
02f28ef32a Merge branch 'bugfix/esp_error_check_func_addr' into 'master'
esp_err: two minor issues

Closes IDFGH-7530

See merge request espressif/esp-idf!18665
2022-07-14 04:14:16 +08:00
Mahavir Jain
20e21fb29d Merge branch 'refactor/remove_rom_deps' into 'master'
RFC: remove dependency to target-specific ROM headers

Closes IDF-1968

See merge request espressif/esp-idf!18206
2022-07-13 16:44:44 +08:00
Jiang Jiang Jian
b610b47a83 Merge branch 'feature/esp32s3_memprot_additional_improvements' into 'master'
[System/Security] Memprot after-merge improvements (v5.0)

Closes IDF-5263 and IDF-5208

See merge request espressif/esp-idf!18893
2022-07-13 15:48:20 +08:00
Jakob Hasse
33a3616635 refactor (bootloader_support, efuse)!: remove target-specific rom includes
The following two functions in bootloader_support are private now:
* esp_secure_boot_verify_sbv2_signature_block()
* esp_secure_boot_verify_rsa_signature_block()
They have been moved into private header files
inside bootloader_private/

* Removed bootloader_reset_reason.h and
  bootloader_common_get_reset_reason() completely.
  Alternative in ROM component is available.

* made esp_efuse.h independent of target-specific rom header
2022-07-13 10:29:02 +08:00
Ivan Grokhotkov
ca7c9947fc
esp_system: fix address printed by ESP_ERROR_CHECK
...to point to the calling function, not to _esp_error_check_failed.
2022-07-12 17:01:47 +02:00
Ivan Grokhotkov
a334cd50ce
app_trace: perform initialization using ESP_SYSTEM_INIT_FN 2022-07-12 16:58:15 +02:00
Ivan Grokhotkov
0e53b32d2e
esp_hw_support: perform sleep initialization using ESP_SYSTEM_INIT_FN 2022-07-12 16:58:15 +02:00
Ivan Grokhotkov
bb771fb7c4
esp_timer: perform initialization using ESP_SYSTEM_INIT_FN
(startup.c still calls esp_timer_early_init directly)
2022-07-12 16:58:15 +02:00
Ivan Grokhotkov
42654927d5
esp_system: add a script to check the startup priorities 2022-07-12 16:58:14 +02:00