Commit Graph

437 Commits

Author SHA1 Message Date
Armando
7dbd3f6909 feat(ci): Enable p4 example, test_apps and unit tests CI build 2023-08-24 12:51:19 +08:00
Alexey Gerenkov
3247253671 Merge branch 'feature/newlib_getentropy' into 'master'
feat(newlib): Implement getentropy() function

Closes IDFGH-10746 and IDF-7383

See merge request espressif/esp-idf!25192
2023-08-18 23:43:29 +08:00
Armando
706d684418 feat(esp32p4): introduced new target esp32p4, supported hello_world 2023-08-09 19:33:25 +08:00
Alexey Gerenkov
f8e020b1d7 feat(newlib): Implement getentropy() function
Closes https://github.com/espressif/esp-idf/issues/11963
2023-08-08 18:06:58 +03:00
Jakob Hasse
8042362e2a refactor: moved semaphore.h to newlib platform_include
Closes https://github.com/espressif/esp-idf/issues/11540
2023-08-08 16:45:57 +08:00
Darian Leung
1e51387222 refactor(freertos): Refactor usage of portSTACK_TYPE to StackType_t
portSTACK_TYPE is an internal macro defined by the porting layer. This commit
changes all references to StackType_t which is the official type exposed by
FreeRTOS.
2023-07-31 16:59:41 +02:00
Zim Kalinowski
8433229958 fix(newlib): included limits.h to fix warning 2023-07-12 10:03:03 +08:00
Alexey Gerenkov
e9345bcced build: Adds support for Clangs's toolchain compiler-rt 2023-06-08 16:49:37 +03:00
Marius Vikhammer
1590fbd31c ci: misc fixes for newlib test app
Enabled additional tests for C2, added config for testing with newlib nano
as well as cleaned up old configs
2023-05-10 11:14:15 +08:00
Zim Kalinowski
a825dde9c0 newlib: move test to pytest 2023-05-08 12:31:48 +02:00
laokaiyao
bf2a7b2df6 esp32h4: removed esp32h4 related codes 2023-04-23 12:03:07 +00:00
Ivan Grokhotkov
35ea136d5a
newlib: implement fsync for the case of CONFIG_VFS_SUPPORT_IO=0
This feature allows calling fsync even if the vfs component is not
used.
The second part of the commit adds an fsync call in the panic test app
enabling it to be used over usb-serial-jtag.
2023-04-18 11:19:36 +02:00
Cao Sen Miao
e5355e57a1 newlib: Put atomic function in IRAM 2023-03-24 11:18:55 +08:00
Alexey Lapshin
a32bbedcd9 newlib: implement 8/16-bit atomic operations for riscv 2023-02-22 05:33:03 +00:00
Alexey Lapshin
8849b1b5aa newlib: fix and add new atomic tests for multicore chips 2023-02-22 05:33:03 +00:00
Cao Sen Miao
fd3e0b0b18 esp32h2(ci): enable target test 2023-02-15 10:20:43 +08:00
Marius Vikhammer
f9c1a2b791 Merge branch 'feature/core_c6_component_tests' into 'master'
ci: update idf-core related tests for C6

Closes IDF-6888

See merge request espressif/esp-idf!22282
2023-02-14 16:47:52 +08:00
Marius Vikhammer
25abc7f6d8 ci: update idf-core related tests for C6 2023-02-13 13:01:57 +08:00
Ivan Grokhotkov
bb25d6abd3 Merge branch 'bugfix/newlib_leftover_files' into 'master'
newlib: remove leftover file from the binary distribution

See merge request espressif/esp-idf!22252
2023-02-12 03:08:25 +08:00
Marius Vikhammer
6233b0aa64 Merge branch 'feature/c6_newlib_nano' into 'master'
newlib: update newlib nano documentation for C6

See merge request espressif/esp-idf!22219
2023-02-09 10:13:47 +08:00
Marius Vikhammer
2e55775f95 Merge branch 'bugfix/newlib_tz_env_mutex' into 'master'
newlib: Use correct recursive mutex for env and regular mutex for tz

Closes IDFGH-9266

See merge request espressif/esp-idf!22200
2023-02-08 13:39:36 +08:00
Marius Vikhammer
65a4058e8c newlib: update newlib nano documentation for C6
C6 ROM has the the full IO formatting functions included.
2023-02-08 10:56:28 +08:00
Ivan Grokhotkov
e10ff6b4e3
newlib: remove leftover file from the binary distribution 2023-02-06 22:23:48 +01:00
wuzhenghui
44df5b31af feature: add ram loadable app support 2023-02-01 17:57:22 +08:00
Steve Jothen
7ca5fa87c0 Use correct recursive mutex for env and regular mutex for tz 2023-01-30 10:59:53 +01:00
Cao Sen Miao
94120b82c2 esp32h2: add build test 2023-01-17 10:29:04 +08:00
Guillaume Souchere
ec34a0f5f5 newlib: Update the esp32c2 config default to avoid RTC related test to not run on esp32c2
Set CONFIG_NEWLIB_TIME_SYSCALL_USE_HRT to enable to force CONFIG_ESP_TIME_FUNCS_USE_RTC_TIMER to disable
and hence prevent the following tests from being executed:

- Timestamp after abort is correct in case RTC & High-res timer have + big error
- Timestamp after restart is correct in case RTC & High-res timer have + big error
- Timestamp after restart is correct in case RTC & High-res timer have - big error
2023-01-03 08:33:38 +01:00
Cao Sen Miao
4713a9a7f2 ESP32H2: Introduce new chip target esp32h2, hello_world example supported 2022-12-29 12:29:14 +08:00
Ivan Grokhotkov
ff23012d68 Merge branch 'contrib/github_pr_10334' into 'master'
Set errno in adjtime (GitHub PR)

Closes IDFGH-8915

See merge request espressif/esp-idf!21516
2022-12-13 19:36:49 +08:00
jofrev
60767c234d Set errno in adjtime if delta is too large
errno should be set to EINVAL in this case according to adjtime's man
page.
2022-12-08 22:35:50 +00:00
jofrev
1005b45ca8 Set errno in adjtime if newlib time funcs are not implemented
Other time functions (e.g. settimeofday) set errno to ENOSYS if
IMPL_NEWLIB_TIME_FUNCS is not set.
adjtime should probably do the same.
2022-12-08 22:34:49 +00:00
Alexey Gerenkov
893cc19f75 tools: Adds newlib nano support for clang builds 2022-12-06 12:33:09 +03:00
Song Ruo Jing
1575b9e43a ci: Disable all currently failed target tests for esp32c6 2022-11-28 12:09:08 +08:00
Song Ruo Jing
7466ddfa8c ci: Make consistence between pytest_*.py and .build-test-rules.yml for esp32c6 (i.e. to pass check_test_scripts_build_test_rules.py) 2022-11-28 11:58:30 +08:00
Song Ruo Jing
e13a4ad963 ci: Disable some unit-test-apps for esp32c6 to pass ci build stage 2022-11-28 11:58:30 +08:00
laokaiyao
8677216576 esp32h2: renaming esp32h2 to esp32h4 2022-11-08 17:05:33 +08:00
Martin Vychodil
c9c7573f71 Storage: Partition APIs moved to the new component 'esp_partition'
All the partition handling API functions and data-types were moved from the 'spi_flash' component to the new one named 'esp_partition'. See Storage 5.x migration guide for more details
2022-11-02 21:54:45 +01:00
Song Ruo Jing
2557e24a28 ci: Enable esp32c6 example, test_apps, and unit tests CI build stage 2022-11-01 11:23:21 +08:00
wuzhenghui
62f9ddcb82 esp32c6: add newlib support 2022-09-26 20:32:13 +08:00
Ivan Grokhotkov
512b59f388 Merge branch 'test/newlib_blksize' into 'master'
newlib: add test for st_blksize and FILE buffer size

See merge request espressif/esp-idf!19366
2022-08-16 23:02:59 +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
Ivan Grokhotkov
cd70631f13
newlib: add test for st_blksize and FILE buffer size
Inspired by https://github.com/joltwallet/esp_littlefs/pull/91/files#r935872478
2022-08-02 20:42:45 +02: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
Armando (Dou Yiwen)
9f6f61345b Merge branch 'feature/adc_driver_ng' into 'master'
ADC Driver NG

Closes IDF-4560, IDF-3908, IDF-4225, IDF-2482, IDF-4111, IDF-3610, IDF-4058, IDF-3801, IDF-3636, IDF-2537, IDF-4310, IDF-5150, IDF-5151, and IDF-4979

See merge request espressif/esp-idf!17960
2022-07-19 21:28:31 +08:00
Armando
5b523a3313 esp_adc: new esp_adc component and adc drivers 2022-07-15 18:31:00 +08:00
David Čermák
1a7dfa42e6 Merge branch 'bugfix/cpp_include_fix_newlib_net_if_h' into 'master'
Add C++ include guard to if.h (to fix linker errors in asio) (GitHub PR)

Closes IDFGH-7718

See merge request espressif/esp-idf!18850
2022-07-15 13:16:47 +08:00
David Cermak
adb79a4852 newlib: Fix header issues with C++ guards and implicit inclusion
* Added C++ sentinels if missed
* Used #pragma once, removed macro's with leading underscores
* Updated copyright checker to allow "BSD-2-Clause-FreeBSD AND
Apache-2.0" for newlib files
* Fixed minor compilation issues/implicit inclusions
2022-07-14 08:32:04 +02:00
0xFEEDC0DE64
48c5b45e99 Add C++ include guard to if.h (to fix linker errors in asio) 2022-07-14 07:48:58 +02:00
Fu Hanxi
c0568611dd docs: changes docs supported targets tables 2022-07-14 08:26:32 +08:00
Cao Sen Miao
a690a87829 spi_flash: Remove legacy spi_flash drivers 2022-07-01 11:01:34 +08:00
simon.chupin
45482bd1c0 components: Change copyright in components files 2022-06-17 16:59:56 +02:00
morris
6eb450fa87 newlib: ROM library is build with time_t 64bit on esp32c2 2022-06-09 10:48:31 +08:00
morris
aa3ddbc3c6 Merge branch 'test/enable_c2_target_tests' into 'master'
ci: enable target tests for ESP32-C2

Closes IDF-4989

See merge request espressif/esp-idf!18182
2022-06-03 16:41:24 +08:00
Anton Maklakov
bc932c646e Merge branch 'bugfix/dirent-definition' into 'master'
newlib: dirent d_ino type fix

See merge request espressif/esp-idf!18336
2022-06-02 19:48:53 +08:00
Michael (XIAO Xufeng)
6a8aed12ee ci: partially enable ut tests for esp32c2
Disabled test cases are tracked in:

 IDF-4465, IDF-5045, IDF-5057, IDF-5058, IDF-5059, IDF-5060, IDF-5061, IDF-5131

- test_fatfs: IDF-5136

- test_pm: IDF-5053

- test_cache_mmu: IDF-5138

- test_partitions: IDF-5137

- test_vfs: IDF-5139

- test_freertos: IDF-5140

- test_wpa_supplicant: IDF-5046

- test_mbedtls: IDF-5141

- test_pthread: IDF-5142

- test_protocomm: IDF-5143

- test_lightsleep: IDF-5053

- test_taskwdt: IDF-5055

- test_tcp_transport: IDF-5144

- test_app_update: IDF-5145

- test_timer: IDF-5052

- test_spi: IDF-5146

- test_rtc_clk: IDF-5060

- test_heap: IDF-5167

ci: fixed issues for tests of libgcc, ets_timer, newlib

test_pm: support on C2
2022-06-02 14:23:35 +08:00
Scott Mabin
c947585ee4 newlib: dirent d_ino type fix
As per the posix spec, `d_ino` should be defined as `ino_t`. See the
reference:
http://pubs.opengroup.org/onlinepubs/7908799/xsh/dirent.h.html.
2022-06-01 13:49:32 +01:00
Djordje Nedic
facab8c5a7 tools: Increase the minimal supported CMake version to 3.16
This updates the minimal supported version of CMake to 3.16, which in turn enables us to use more CMake features and have a cleaner build system.
This is the version that provides most new features and also the one we use in our latest docker image for CI.
2022-06-01 06:35:02 +00:00
Ivan Grokhotkov
0c10b937f5 Merge branch 'bugfix/freertos_smp_disable_interrupt_usage' into 'master'
FreeRTOS: Replace portSET_INTERRUPT_MASK_FROM_ISR() call for SMP

Closes IDF-5062 and IDF-5066

See merge request espressif/esp-idf!18301
2022-06-01 00:18:26 +08:00
Anton Maklakov
bf3892acee newlib: stdatomic: fix conflicting types for __atomic_load/__atomic_store 2022-05-30 14:48:12 +07:00
Darian Leung
daa950d9ed freertos: Replace portSET_INTERRUPT_MASK_FROM_ISR() call for SMP
The behavior of portSET_INTERRUPT_MASK_FROM_ISR() has changed in SMP FreeRTOS. It's
previous behavior is now implemented in portDISABLE_INTERRUPTS() and portRESTORE_INTERRUPTS().

This commit replaces all portSET_INTERRUPT_MASK_FROM_ISR() and portCLEAR_INTERRUPT_MASK_FROM_ISR()
calls with portDISABLE_INTERRUPTS() and portRESTORE_INTERRUPTS() respectively
2022-05-30 06:11:24 +08:00
jiangguangming
c7beae1d6a newlib: 64-bits time_t test pass
please keep in mind that don't use nano-foramt printf for 64-bits
2022-05-28 08:52:55 +00:00
jiangguangming
4302e28698 newlib: use newlib nano format default 2022-05-28 08:52:55 +00:00
Andrei Safronov
3d9814bf8b newlib: implement __atomic_load/__atomic_store functions 2022-05-11 17:00:14 +03:00
Ivan Grokhotkov
77b754b47f
newlib: fix return value of no-VFS _read_r if nothing received
'read' function should return 0 when encountering an end of file. When
newlib calls read and sees EOF returned, it assumes that this
condition is permanent and never calls 'read' for this file again
(unless the read pointer is moved using fseek).
The correct behavior in case no characters were received over UART is
to return -1. In this case newlib will retry reading from file on next
call to fread, fgetc or another function which calls __srefill_r.
2022-05-02 20:47:18 +02:00
Ivan Grokhotkov
47659be5b8
build system: remove lwip from common requirements
lwip was added to common requirements list to provide "sys/socket.h"
header to all components without additional requirements specified.

However, lwip pulls in a lot of dependencies on other components.
This commit removes lwip from common requirements to reduce the number
of components in G1-only apps.

To compensate for this removal, the following changes are made:
- newlib (which is a common requirement) has a public dependency on
  lwip if lwip is present in the build. This ensures that sys/socket.h
  is available as long as lwip component is included into the build.
- lwip is now a public requirement of esp-tls since esp_tls.h includes
  sys/socket.h header.
- lwip is now a public requirement o esp_http_client because
  sys/socket.h is included from esp_http_client.h
- lwip is now a private requirement of esp_wifi for "smartconfig_ack"
- lwip is now a private requirement of mqtt for socket functions
- lwip is now a public requirement of tcp_transport because
  esp_transport_tcp.h includes sys/socket.h header.
- mbedtls checks if lwip component is present in the build. If yes,
  net_sockets.c is added to the build, along with the dependency on
  lwip. Previously lwip was a public requirement of mbedtls
  unconditionally.

system/g1_components test app is updated to reflect the changes

Default public dependencies of a component before and after this
change, except common requirements:

- esp_timer (public dependency of freertos)
- bootloader_support (public dependency of esp_hw_support)
- vfs (public dependency of lwip)
- esp_wifi (public dependency of lwip)
- esp_event (public dependency of esp_wifi)
- esp_netif (public dependency of esp_event)
- esp_eth (public dependency of esp_netif)
- esp_phy (public dependency of esp_wifi)

After:

- esp_timer (public dependency of freertos)
- bootloader_support (public dependency of esp_hw_support)

Altogether, the following components have been always added as
public requirements to all other components, and are not added now
([breaking-change]):

- lwip
- vfs
- esp_wifi
- esp_event
- esp_netif
- esp_eth
- esp_phy

Application components now need to explicitly declare dependencies on
these components.
2022-05-02 20:47:17 +02:00
Ivan Grokhotkov
708e99497b
global: add dependency on esp_timer component and include esp_timer.h
Some components were including esp_timer.h without declaring a
dependency on esp_timer component. This used to work due to a
transitive public dependency on esp_timer from freertos component.
Add explicit dependencies where needed.
Also some source files were using esp_timer functions without
including the header file. This used to work because esp_timer.h was
included from freertos port header file. This commit adds esp_timer.h
includes where needed.
2022-04-25 18:39:23 +02:00
Marius Vikhammer
45c1d1cba2 Merge branch 'feature/move_target_kconfig_2' into 'master'
system: move kconfig options out of target component

See merge request espressif/esp-idf!17321
2022-04-24 13:29:43 +08:00
Marius Vikhammer
d2872095f9 soc: moved kconfig options out of the target component.
Moved the following kconfig options out of the target component:
 * CONFIG_ESP*_DEFAULT_CPU_FREQ* -> esp_system
 * ESP*_REV_MIN -> esp_hw_support
 * ESP*_TIME_SYSCALL -> newlib
 * ESP*_RTC_* -> esp_hw_support

Where applicable these target specific konfig names were merged into
a single common config, e.g;
CONFIG_ESP*_DEFAULT_CPU_FREQ -> CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ
2022-04-21 12:09:43 +08:00
Ivan Grokhotkov
71bab1078f
newlib: fix ESHUTDOWN and ENOTSOCK having the same numerical value 2022-04-18 12:10:30 +02:00
Anton Maklakov
6200d2328d Merge branch 'bugfix/printf-placeholder-for-time_t' into 'master'
components: correct printf() placeholder for time_t

See merge request espressif/esp-idf!17439
2022-03-17 16:08:08 +08:00
Ivan Grokhotkov
d1abdbae88 Merge branch 'bugfix/stdatomic_builtin-declaration-mismatch' into 'master'
newlib: stdatomic: fix builtin-declaration-mismatch

See merge request espressif/esp-idf!16954
2022-03-17 03:36:18 +08:00
Ivan Grokhotkov
4aa2719e13
spi_flash, newlib: fix NULL pointer dereference on OOM
https://pvs-studio.com/en/blog/posts/cpp/0790/#ID88049D3FA2
Reported in https://github.com/espressif/esp-idf/issues/6440
2022-03-14 18:16:42 +01:00
Anton Maklakov
e27f1331e4 components: correct printf() placeholder for time_t
Using C99 %jd, https://en.cppreference.com/w/c/chrono/time_t
2022-03-14 14:05:47 +07:00
Sudeep Mohanty
a9fda54d39 esp_hw_support/esp_system: Re-evaluate header inclusions and include directories
This commit updates the visibility of various header files and cleans up
some unnecessary inclusions. Also, this commit removes certain header
include paths which were maintained for backward compatibility.
2022-03-07 11:18:08 +05:30
Anton Maklakov
3ab9acddc1 newlib: stdatomic: fix conflicting types for atomic built-in functions
Also use `unsigned int`, `short unsigned int`,`long long unsigned int` etc types
instead of uintN_t. Because some platforms have uintN_t types that don't
conrrespont to built-in prototypes.
2022-03-02 16:22:45 +07:00
Marius Vikhammer
edb76f14d6 esp_timer: remove legacy ESP32 FRC timer implementation. 2022-02-10 15:17:49 +08:00
Darian Leung
57fd78f5ba freertos: Remove legacy data types
This commit removes the usage of all legacy FreeRTOS data types that
are exposed via configENABLE_BACKWARD_COMPATIBILITY. Legacy types can
still be used by enabling CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY.
2022-02-09 23:05:45 +08:00
Fu Hanxi
a801555299 ci: replace all component ut with pytest-embedded 2022-01-24 16:37:23 +08:00
laokaiyao
cf049e15ed esp8684: rename target to esp32c2 2022-01-19 11:08:57 +08:00
Ivan Grokhotkov
d2b894862c newlib: auto-detect sizeof(time_t)
To make the transition from 32-bit time_t to 64-bit time_t smoother,
detect the size of this type in CMake and remove the manual option in
Kconfig.
The information about 64-bit time_t support is moved from Kconfig help
string into the "system time" section of the API reference.
2022-01-11 19:01:21 +01:00
Sudeep Mohanty
e22b4007d3 esp_hw_support: Removed deprecated CPU util functions
The following files were deleted:
- components/esp_hw_support/include/soc/cpu.h
- components/soc/esp32s3/include/soc/cpu.h

The following functions are deprecated:
- get_sp()

The following functions declared in soc/cpu.h are now moved to esp_cpu.h:
- esp_cpu_configure_region_protection()

The following functions declared in soc/cpu.h are now moved to components/xtensa/include/esp_cpu_utils.h:
- esp_cpu_process_stack_pc()

All files with soc/cpu.h inclusion are updated to include esp_cpu.h instead.

Signed-off-by: Sudeep Mohanty <sudeep.mohanty@espressif.com>
2021-12-28 16:58:37 +05:30
Ivan Grokhotkov
01033a3a60 newlib: stdatomic: implement missing "op_fetch", "nand" builtins
* Adds implementations of __{atomic,sync}_nand_fetch_n. These builtins
  were implemented for other operations but were not defined for NAND.
* Adds implementation of __atomic_OP_fetch_n for all OPs.
* Adds implementation of __sync_OP_and_fetch_n for all OPs.

Reported in https://github.com/espressif/arduino-esp32/issues/5948
2021-12-14 16:06:12 +01:00
Ivan Grokhotkov
d83ce227aa newlib: implement posix_memalign, sysconf, realpath
Closes https://github.com/espressif/esp-idf/issues/6119
Closes https://github.com/espressif/esp-idf/issues/7798
2021-12-13 14:40:21 +01:00
Cao Sen Miao
eddc196081 esp_clk: refactor target/clk.h to private/esp_clk.h 2021-11-26 14:56:30 +08:00
Roland Dobai
766aa57084 Build & config: Remove leftover files from the unsupported "make" build system 2021-11-11 15:32:36 +01:00
Cao Sen Miao
36f6d16b8d ESP8684: add soc, riscv, newlib support 2021-11-06 17:33:44 +08:00
Darian Leung
d6f2fa4bab freertos: Remove critical nested macros
This commit removes the following critical nested macros as follows:

- portENTER_CRITICAL_NESTED()
- portEXIT_CRITICAL_NESTED()

They are replaced with portSET_INTERRUPT_MASK_FROM_ISR() and
portCLEAR_INTERRUPT_MASK_FROM_ISR() which are the proper FreeRTOS interfaces.

Created a portmacro_deprecated.h for each port to contain deprecated API
that were originally from portmacro.h
2021-10-22 13:17:20 +08:00
Andrei Safronov
f4803c5aaf newlib: fix clang atomics
Correction of the SYNC_LOCK_* macros in stdatomic
2021-10-20 23:33:53 +03:00
Scott Mabin
f06bc441f3 Merge branch 'bugfix/remove-uneeded-clang-ifdefs' into 'master'
remove `__clang__` ifdef around atomic libcalls

See merge request espressif/esp-idf!15489
2021-10-20 14:54:28 +00:00
Ivan Grokhotkov
f31f360279 Merge branch 'feature/riscv-msave-restore' into 'master'
build system: add COMPILER_SAVE_RESTORE_LIBCALLS option

Closes IDF-3732

See merge request espressif/esp-idf!15004
2021-10-14 23:25:49 +00:00
Scott Mabin
d5e4fc8356 remove __clang ifdef around atomic emulation
* CI errors led me to believe these were needed, but as it turns out the
load/store intrinsics are required even when idf is built by gcc when
linking to a clang based project.
* remove ... postfix inside `SYNC_LOCK_TEST_AND_SET` expansion
2021-10-14 15:01:21 +01:00
Jakob Hasse
6e59f9e8be [newlib]: Added missing includes
Closes https://github.com/espressif/esp-idf/issues/7498
2021-10-14 11:26:56 +08:00
Scott Mabin
d93b53b9e5 newlib: provide missing atomic libcalls
Provide emulated atomic load & store libcalls for u8, u16 & u32 integer
types. This is required when building with Clang as llvm does not lower
these operations to native load / stores, where as gcc does.

Provide `sync_lock_test_and_set` atomic implementations for all
supported integer types.

Closes https://github.com/espressif/esp-idf/issues/7591.
Closes https://github.com/espressif/esp-idf/issues/7592.
2021-10-08 18:46:09 +08:00
Ivan Grokhotkov
95ee8104bf build system: add COMPILER_SAVE_RESTORE_LIBCALLS option
Add new Kconfig option to enable -msave-restore flag for RISC-V
targets. This option can be used to reduce binary size by replacing
inlined register save/restore sequences with library calls.
2021-10-07 15:01:35 +08:00
Ivan Grokhotkov
8f0ee18931 Merge branch 'feature/clang_toolchain_compat' into 'master'
Build system: minimal changes for clang compatibility

See merge request espressif/esp-idf!15168
2021-09-23 08:19:09 +00:00
Ivan Grokhotkov
d0f960a634 newlib: don't use gcc-specific pragmas for clang 2021-09-16 11:07:54 +02:00
Ivan Grokhotkov
ccda990ce5 newlib: set errno in the explicitly provided reent structure
Since these functions receive the pointer to reent structure, they
should set errno in it rather than using thread-local errno.

This didn't cause practical issues because console functions in IDF
are only called from threads, and in that case 'r' is a pointer to
the thread-local structure, so &errno is the same thing as
&__errno_r(r). Still, fixing this for consistency.
2021-09-16 09:00:07 +02:00
Ivan Grokhotkov
5da66d1d39 newlib: implement _fstat_r stub for console
When CONFIG_VFS_SUPPORT_IO is disabled, _read_r and _write_r
implementations in syscalls.c are used to provide console I/O via
esp_rom_uart_tx_one_char/esp_rom_uart_rx_one_char.

When newlib opens a (FILE*) stream, it calls fstat to check if the
underlying file is character-oriented. In this case, it configures the
stream to use line buffering. Otherwise (or if fstat fails) the stream
is opened as block buffered.

Since fstat wasn't provided, stdin/stdout/stderr streams got opened in
block buffered mode. For console, we need line buffered output so that
the stream buffer is flushed each time a complete line (ending with
'\n') is sent to stdout or stderr.

Fix by implementing _fstat_r stub, setting st->st_mdoe=S_IFCHR.
2021-09-16 09:00:07 +02:00
Andrei Safronov
9159aa58d3 tests: refactoring of the gcc's inner functions, because clang doesn't support them 2021-09-10 19:51:27 +03:00
Sachin Parekh
41973b761e newlib: Override __assert and __assert_func
Default assert implementation calls fiprintf, which tries to acquire a
lock and fails if it is executing in critical section or ISR
2021-08-05 11:09:22 +05:30