Commit Graph

16 Commits

Author SHA1 Message Date
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
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
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
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