Commit Graph
496 Commits
Author SHA1 Message Date
Alexey Lapshin af5c6372a7 fix(libc): picolibc: disable C11 annex K in compatibility mode 2026-06-17 14:02:02 +08:00
Alexey Lapshin 3e83ddc5b9 fix(libc): nano: add -lnosys to linking to avoid CMake configuration issues 2026-06-08 12:08:40 +07:00
Alexey Gerenkov 715a2de06b Merge branch 'fix/cxx_noreturn_issue_v5.5' into 'release/v5.5'
fix(libc): picolibc: workaround wrong pthread_exit declaration for c++ (v5.5)

See merge request espressif/esp-idf!48089
2026-05-05 18:52:58 +08:00
Alexey Lapshin 709656d8a1 fix(libc): picolibc: workaround wrong pthread_exit declaration for c++ 2026-04-29 18:36:07 +07:00
Alexey Lapshin 1da17b0437 fix(picolibc): add times() stub 2026-04-29 18:33:23 +07:00
wanckl 5d37003c47 ci(p4): p4 eco5 enable parts of special tests 2026-04-24 15:09:56 +08:00
Alexey Lapshin a27f7af6b7 fix(esp_libc): picolibc: add workaround for setvbuf on _IONBF 2026-03-31 12:26:31 +07:00
Alexey Gerenkov 414791d955 Merge branch 'feature/enable_misalign_optimization_for_iperf_v5.5' into 'release/v5.5'
feat(newlib): enable libc misalign optimized functions (v5.5)

See merge request espressif/esp-idf!42676
2026-03-31 00:49:02 +08:00
Alexey Lapshin 9332d2ccd2 fix(newlib): fix CONFIG_LIBC_OPTIMIZED_MISALIGNED_ACCESS for c2/c3/c6/h2/h21
PMP configurations for load and store addresses may
have different permissions (e.g., "R" vs. "RW").

Due to the timing alignment of internal signals, the address
permission check may be incorrectly applied during the second
part of a misaligned access transaction.

As a workaround, insert two instructions (e.g. ADDI/NOP) between
accessing to different memory regions. This spacing avoids the
false permission check caused by signal timing overlap.
2026-03-20 12:59:12 +07:00
Alexey Lapshin 44ef9bec48 fix(esp_libc): remove --gc-sections from picolibc.specs for CMake checks
The --gc-sections flag in picolibc.specs causes CMake compiler detection
to fail by dropping required data. Work around this by creating a modified
specs file without the flag.
2026-03-12 18:56:55 +07:00
Alexey Lapshin 776f9fd09d fix(newlib): fix ci: add .build-test-rules.yml 2026-02-05 13:40:11 +07:00
Alexey Lapshin 18b369cc9d fix(esp_libc): add workaround for pthread_sigmask declaration in picolibc signal.h 2026-02-05 13:40:11 +07:00
Alexey Lapshin 7b1100db2d fix(newlib): adapt changes 2026-02-05 13:40:11 +07:00
Alexey Lapshin 7dd7edabaa fix(esp_tee): build esp_tee only with CONFIG_LIBC_NEWLIB to reduce size 2026-02-02 12:27:27 +07:00
Alexey Lapshin 0b3929d0d9 feat(esp_libc): add full support for picolibc 2026-01-30 23:39:53 +07:00
Alexey Lapshin 1c08b38b27 feat(build): propagate compiler flags from files to toolchain.cmake
This change improves build consistency across external projects integrated
through CMake by ensuring that compiler flags defined in configuration files
are passed correctly to the toolchain. It covers the majority of use cases,
as external projects are typically also CMake-based. For projects that use
a custom build system, users will still need to specify the required flags
manually.
2026-01-30 17:30:49 +07:00
armando 304ba1655b fix check test scripts build issue 2025-11-20 11:33:36 +08:00
armando cdff2570c7 ci(p4): disable p4 rev3 invalid tests temporarily 2025-11-20 11:33:36 +08:00
Alexey Gerenkov c994c2203d Merge branch 'fix/misalign_memory_test_limit_values_v5.5' into 'release/v5.5'
fix(newlib): increase limit for misaligned access testcases (v5.5)

See merge request espressif/esp-idf!41362
2025-09-02 20:42:15 +08:00
Alexey Lapshin b88cc1724f fix(newlib): increase limit for misaligned access testcases 2025-08-18 22:29:58 +07:00
Alexey Lapshin 511e970d07 feat(newlib): add test for newlib_nano with esp32-psram 2025-08-15 12:10:47 +07:00
Alexey Lapshin e1eae237a3 change(newlib): change CONFIG_NEWLIB* prefix to CONFIG_LIBC_NEWLIB* 2025-08-15 12:06:24 +07:00
Marius Vikhammer 18b6997e32 test(newlib): fixed failing C5 ECO2 newlib tests 2025-06-06 09:56:55 +02:00
Sudeep Mohanty 196bd4368a Merge branch 'fix/usleep_returns_early' into 'master'
fix(newlib): Fixed an issue where usleep() could consume more CPU cycles

Closes IDFGH-14342

See merge request espressif/esp-idf!38812
2025-05-09 17:18:25 +08:00
Marius Vikhammer d03c3d3192 feat(core): added support for ROM and newlib on ESP32-H21 2025-05-09 09:51:09 +08:00
Sudeep Mohanty 1e616eeb84 fix(newlib): Fixed an issue where usleep() could consume more CPU cycles
The following changes are made in this commit:

1. This commit updates the implementation of usleep() to now always yield
   CPU time if undergoing a multi-tick sleep. This reduces the accuracy of
   usleep() but in turn allows the scheduler to schedule different tasks.

2. The commit also updates the MCPWM unit test which fails due to the
   change in the behavior of usleep().

Closes: https://github.com/espressif/esp-idf/pull/15132
2025-04-29 08:15:16 +02:00
Sudeep Mohanty ec07f61291 test(newlib): Added unit tests for usleep and sleep_for functions
This commit adds unit tests to verify the basic functionality of
usleep() and this_thread::sleep_for() std functions.
2025-04-23 17:23:36 +02:00
Stephen Noonan d5d7bb61e5 fix(newlib): usleep returning early
This commit updates usleep() to always sleep for the required sleep
period or more. This fixes a bug where the usleep() could sleep for less
than the request sleep period.

Closes https://github.com/espressif/esp-idf/pull/15132
2025-04-23 17:23:36 +02:00
Chen Jichang c34b4eb882 feat(esp32h4): enable ESP32H4 ci build 2025-03-28 14:41:28 +08:00
Alexey Lapshin fa0a2d997b Merge branch 'fix/newlib-include-missed-test' into 'master'
fix(newlib): include missed test for printf

See merge request espressif/esp-idf!38030
2025-03-27 20:04:27 +08:00
Alexey Lapshin 35531c6344 fix(newlib): include missed test for printf 2025-03-26 18:44:12 +07:00
Alexey Lapshin ec68cb3300 feat(newlib): riscv: add CONFIG_LIBC_OPTIMIZED_MISALIGNED_ACCESS config option
This option replaces implementations of functions from ROM:
  - memcpy
  - memcmp
  - memmove
  - str[n]cpy
  - str[n]cmp

The functions used in the firmware will be better optimized for misaligned
memory. Here are some measurements in CPU cycles for 4096-byte buffers:

  memcpy:  28676 -> 4128
  memcmp:  49147 -> 14259
  memmove: 33896 -> 8086
  strcpy:  32771 -> 17313
  strcmp:  32775 -> 13191
2025-03-26 17:27:24 +07:00
Chen Ji Chang 6474fd67ae Merge branch 'feat/h4_introduce_step8' into 'master'
feat(esp32h4): introduce hello world to ESP32H4 (stage8)

Closes IDF-9526 and IDF-12333

See merge request espressif/esp-idf!37545
2025-03-20 16:16:05 +08:00
Chen Jichang 44117b623d refactor(esp_rom): remove specific chip name when including rom header 2025-03-17 18:53:26 +08:00
Marius Vikhammer ff3126fa09 feat(newlib): added option for placing functions in flash if flash-auto-suspend 2025-03-14 10:41:51 +08:00
Marius Vikhammer 70371347dc Merge branch 'feature/newlib_iram_cleanup' into 'master'
feat(newlib): optimize IRAM usage

Closes IDF-7146

See merge request espressif/esp-idf!37647
2025-03-14 10:28:45 +08:00
Marius Vikhammer 46847b7be9 Merge branch 'bugfix/heap_in_flash' into 'master'
fix(heap): fixed CONFIG_HEAP_PLACE_FUNCTION_INTO_FLASH not working together with CONFIG_HEAP_TLSF_USE_ROM_IMPL

See merge request espressif/esp-idf!37692
2025-03-13 10:48:41 +08:00
Marius Vikhammer ab2718dc44 fix(newlib): fixed newlib malloc wrappers IRAM/flash placement
If HEAP_PLACE_FUNCTION_INTO_FLASH = y then we should also place
the newlib wrappers for the heap in to flash.
2025-03-12 11:19:25 +08:00
Marius Vikhammer 20bbd2af42 feat(newlib): add option for placing newlib lock API into flash 2025-03-11 09:33:58 +08:00
Marius Vikhammer 2fc73a05b3 feat(newlib): removed some unecessary IRAM attributes for newlib functions 2025-03-10 15:31:30 +08:00
Marius Vikhammer 12e9d6514a fix(console): fixed secondary console not working on all chips without VFS 2025-03-07 14:41:19 +08:00
igor.udot daf2d31008 test: format all test scripts 2025-03-05 12:08:48 +08:00
gaoxu 5ef4f20778 feat(esp32h21): disable unsupported build test 2025-02-06 15:47:51 +08:00
Alexey Lapshin 793e394f5a fix(newlib): add missing __atomic_test_and_set for RISCV chips wo 'a' extension
Before the change described in
https://gcc.gnu.org/pipermail/gcc-patches/2023-September/631393.html it
appeared that inlining built-in GCC function __atomic_test_and_set() was
incorrect. It resulted in a non-atomic write.
After the change now present in GCC, the IDF should include the function
__atomic_test_and_set() to successfully link the final binary.

Closes https://github.com/espressif/esp-idf/issues/15167
2025-01-15 13:57:58 +07:00
Marius Vikhammer 34c7d62855 refactor(hw_support): combine esp_hw_support rtc header to a single file 2024-12-30 10:09:34 +08:00
Ivan Grokhotkov 684d3e6d01 feat(newlib): add dummy implementations of pathconf, chmod, dirfd
Closes https://github.com/espressif/esp-idf/issues/14174
2024-12-03 15:32:57 +01:00
Alexey Lapshin 888b5f7e8d feat(newlib): add picolibc support 2024-12-02 21:35:56 +07:00
Frantisek Hrbata e16f711a99 change(newlib): use a general console name in the new line conversion options
Currently, the new line ending conversion options for stdin and stdout
are specifically described for UART, which is inaccurate since the
console could be connected to USB serial/CDC or have secondary output.
Use a generic console term instead of UART.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-11-18 15:42:29 +08:00
Frantisek Hrbata 2c3c0653d2 change(newlib): support line endings modification only with VFS
The configuration of newline endings for stdout and stdin is supported
only by the VFS drivers. The write and read syscalls in newlib
automatically convert LF to CRLF for stdout and CR to LF for stdin,
ignoring the configured newline settings. Therefore, make the options
for newline endings visible only when VFS is enabled.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-11-18 15:42:29 +08:00
Frantisek Hrbata 5351a83128 feat(newlib): change line endings on standard input and output
Currently, the newline conversions for the NEWLIB_STDOUT_LINE_ENDING and
NEWLIB_STDIN_LINE_ENDING options are only applied by VFS drivers.
Without VFS, newline conversion does not occur. Introduce the default
conversion of LF to CRLF on stdout and CF to LF on stdin for the default
read and write syscalls in newlib.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-11-18 15:42:29 +08:00