Commit Graph

479 Commits

Author SHA1 Message Date
Alexey Lapshin
0f2e45c1ad feat(newlib): add dummy implementations for statvfs/fstatvfs 2025-06-25 18:01:50 +07:00
Alexey Lapshin
e82d51a9ee fix(picolibc): fix missed headers in sources 2025-06-25 18:01:50 +07:00
Alexey Lapshin
e28af6a002 fix(newlib): use optimized misalign access functions from libc.a 2025-06-25 18:01:50 +07:00
Frantisek Hrbata
0afcc02c47 Merge branch 'fix/cmake_uninitialized_vars' into 'master'
fix(build): do not rely on uninitialized  variables and variables set in parent scope

See merge request espressif/esp-idf!39615
2025-06-20 08:30:30 +02:00
Marius Vikhammer
27f232a929 test(newlib): fixed failing C5 ECO2 newlib tests 2025-06-06 08:38:24 +02:00
Frantisek Hrbata
b84e9b69ba fix(newlib/cmake): avoid using uninitialized ldfragments variable
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-06-04 19:50:27 +08: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
Konstantin Kondrashov
3318e0accd feat(pthread): Adds set/get sched param funcs
Closes https://github.com/espressif/esp-idf/issues/14821
Closes https://github.com/espressif/esp-idf/issues/8594
2024-11-12 17:23:03 +08:00
Fu Hanxi
92cd70acc9 ci: remove gcc dependency in target test 2024-11-08 11:13:43 +01:00
Ondrej Kosta
d2b1202d5a feat(esp_eth): added HW Time Stamping support for ESP32P4
Added mechanism to L2 TAP to retreive time stamp

Added PTP time synchronization example
2024-11-07 15:01:24 +08:00
Laukik Hase
5328dcd00c change(build): Add a new CMake flag NON_OS_BUILD for non-FreeRTOS builds 2024-10-21 19:03:30 +05:30
Alexey Lapshin
c4acf3faad fix(newlib): sbom: add CVE-2024-30949 to cve-exclude-list 2024-10-02 18:01:14 +07:00
Marius Vikhammer
35a6671072 Merge branch 'feature/c6_misc_core' into 'master'
feat(system): misc core-system C61 bringup changes

Closes IDF-10954, IDF-10986, IDF-10957, IDF-9281, and IDF-9257

See merge request espressif/esp-idf!33297
2024-09-12 09:46:30 +08:00
Marius Vikhammer
40352943e3 ci(system): re-enable system test app for C61 2024-09-11 14:05:11 +08:00
Alexey Lapshin
06fdb02435 fix(newlib): fix GCC 14 analyzer warnings 2024-09-08 13:53:52 +07:00
wanckl
4e095f4b9f ci(esp32c61): enable c61 generic target test 2024-09-02 19:26:12 +08:00
Marius Vikhammer
a04bedc4ce Merge branch 'bugfix/assert_ndebug' into 'master'
feat(newlib): add option to disable eval of expression in assert() when NDEBUG set

Closes IDFGH-479 and IDFGH-8692

See merge request espressif/esp-idf!32887
2024-08-26 15:42:31 +08:00
Marius Vikhammer
ff8265b6b3 feat(newlib): add option to disable eval of expression in assert() when NDEBUG set
According to the standard assert(X) should be replaced by a void expression when
NDEBUG is set. IDF's behavior was to not trigger an assertion, but we would still
evaluate X, e.g. if X was a function it would be ran.

This MR adds a kconfig option CONFIG_COMPILER_ASSERT_NDEBUG_EVALUATE which allows us
revert the behavior to be inline with the standard.

With IDF v6.0 the plan is to make CONFIG_COMPILER_ASSERT_NDEBUG_EVALUATE=n the default
behavior.

Closes https://github.com/espressif/esp-idf/issues/10136
Closes https://github.com/espressif/esp-idf/issues/2758
2024-08-20 09:26:54 +08:00
Marius Vikhammer
596f635b28 fix(newlib): fixed potential overflow in usleep
If trying to usleep for 0xFFFF FFFF us the calculation of delay ticks would overflow
resulting in the system not sleeping at all.

Closes https://github.com/espressif/esp-idf/issues/14390
2024-08-20 09:26:27 +08:00
Marius Vikhammer
69ca6e49a7 test(console): add tests for console with vfs disabled 2024-08-12 10:01:04 +08:00
Alexey Lapshin
24e2426b9e fix(newlib): fix include sys/dirent.h breaking change 2024-07-31 17:12:23 +07:00
Jiang Jiang Jian
e37ff3565b Merge branch 'bugfix/fix_newlib_nano_float_printf_issues' into 'master'
fix(esp_rom): add new rom caps ESP_ROM_HAS_NEWLIB_PRINTF_BUG

See merge request espressif/esp-idf!30956
2024-07-26 17:37:03 +08:00
wanlei
3cf069c7d8 feat(esp32c61): disable unsupported build test 2024-07-16 16:06:19 +08:00
Marius Vikhammer
b6d3e1e8e3 test(newlib): fixed newlib test failing to build for C5 2024-07-11 09:33:04 +08:00