Commit Graph

286 Commits

Author SHA1 Message Date
KonstantinKondrashov
c19b37d2a9 esp_system: Adds sync of FRC & RTC counters in esp_restart
In case when FRC and RTC counters are very different then
the need to sync them before to restart the ESP
to get the correct system time after reboot.
2021-07-21 10:23:24 +05:00
Renz Bagaporo
7c22cccb9c esp32: cleanup build script 2021-07-16 20:14:27 +08:00
Ivan Grokhotkov
ca51cd67a4 Merge branch 'bugfix/correct_clang_atomics' into 'master'
newlib,clang: implement __sync_* atomics for clang/llvm toolchain.

Closes LLVM-92

See merge request espressif/esp-idf!14269
2021-07-15 19:01:32 +00:00
Andrei Safronov
40daaa9d56 newlib,clang: implement __sync_* atomics for clang/llvm toolchain. 2021-07-15 20:36:40 +03:00
Ivan Grokhotkov
cbf207bfb8 newlib: add C++ guards to the platform-specific dirent.h
Before newlib 3.3.0, <dirent.h> bundled in newlib did not include any
function declarations. Instead, the file included the platform-
specific <sys/dirent.h>. This inclusion was inside a C++ guard block.
ESP-IDF provided sys/dirent.h inside newlib component, and this file
contained all the necessary function and structure declarations.

Since da418955f5,
common function declarations have been added to <dirent.h> in newlib.
However, the inclusion of sys/dirent.h has been moved out of the C++
guard block. However we didn't notice this change and did not update
sys/dirent.h in ESP-IDF newlib component to and the now-required
C++ guards there.

This commit adds the missing C++ guards to the platform-specific
sys/dirent.h.

The declarations of common dirent.h functions are now present both in
<dirent.h> (provided by newlib) and in sys/dirent.h (provided by IDF).
We keep the declarations in sys/dirent.h for compatibility, since some
ESP-IDF files and applications may include <sys/dirent.h> directly,
rather than <dirent.h>.

Closes https://github.com/espressif/esp-idf/issues/7204
2021-07-08 15:53:58 +02:00
Shu Chen
6fce2930d0 esp32h2: enable more components to support esp32h2
Involved components:
 * app_trace
 * esp-tls
 * esp_adc_cal
 * esp_pm
 * esp_serial_slave_link
 * esp_timer
 * freertos
 * idf_test
 * log
 * mbedtls
 * newlib
 * perfmon
 * spi_flash
 * spiffs
 * ulp
 * unity
 * vfs
2021-07-01 19:53:11 +08:00
Omar Chebib
da731a7eeb psram: add configuration macros to move workaround libc functions to flash
Workaround libc can be moved to flash thanks to KConfig macros.
However, the following functions: `itoa`, `memcmp`, `memcpy`, `memset`, `strcat`, `strcmp`, and `strlen` are always kept it in IRAM.
2021-06-23 17:40:02 +08:00
morris
9afdf54748 hal: added HAL_ASSERT 2021-06-22 11:28:01 +08:00
Marius Vikhammer
79b5dedeb1 CI: minor testcases fixes and disable some cases that cant run on S3 2021-06-15 13:39:48 +08:00
Anton Maklakov
e5faf4f924 ci: fix test_build_system* fails 2021-06-07 18:48:38 +07:00
Anton Maklakov
b46b50eaa6 newlib: Add ESP_ROM_HAS_RETARGETABLE_LOCKING capability for C3 and S3 chips 2021-06-07 12:53:45 +07:00
Ivan Grokhotkov
1ca2afd982 Merge branch 'bugfix/add-MAXNAMLEN-definition' into 'master'
[newlib]add the definition of MAXNAMLEN in sys/dirent.h

Closes IDF-3219

See merge request espressif/esp-idf!13535
2021-05-17 08:03:35 +00:00
WangQixiang
65ec83a456 change MAXNAMLEN to 255 2021-05-13 11:56:52 +08:00
WangQixiang
c9c8633cba add the definition of MAXNAMLEN in sys/dirent.h 2021-05-12 16:07:19 +08:00
Ivan Grokhotkov
6f8e0d9d55 test: add test app for stdatomic functions 2021-05-10 18:13:36 +02:00
Ivan Grokhotkov
742102079a newlib: stdatomic: emulate 64-bit atomics on 32-bit SMP SoCs
Closes https://github.com/espressif/esp-idf/issues/3163
2021-05-10 18:13:36 +02:00
Ivan Grokhotkov
32fcd4f02a newlib: stdatomic: fix prototypes, don't disable compiler warnings 2021-05-10 18:13:35 +02:00
Sachin Parekh
b1eacc24f2 stdatomic: Implemented legacy __sync APIs and __atomic_exchange_n
These APIs are used when the architecture doesn't have atomic
instruction support

Closes https://github.com/espressif/esp-idf/issues/6463
2021-04-23 11:18:58 +05:30
Renz Bagaporo
a202a604d8 esp32: move system libs 2021-03-31 19:17:33 +08:00
Renz Bagaporo
e6edf34e82 esp32: move esp_clk functions 2021-03-31 19:17:33 +08:00
Renz Bagaporo
50745fa61b newlib: use system time in test 2021-03-25 15:47:19 +08:00
Renz Bagaporo
5a90113136 newlib: change microseconds offset type 2021-03-25 15:37:48 +08:00
Angus Gratton
fa2946d651 Merge branch 'feature/support_esp32s3_beta_3' into 'master'
Support ESP32S3 beta 3 target

Closes IDF-2908

See merge request espressif/esp-idf!12661
2021-03-23 10:17:58 +00:00
Renz Bagaporo
97a2d9552e newlib: persist rtc clk corrections 2021-03-19 12:04:06 +08:00
Marius Vikhammer
2aead8ba57 Support ESP32S3 Beta 3 target
Update ROM API. Port changes from bringup branch.
2021-03-18 10:24:22 +08:00
Angus Gratton
fd164b82b6 Merge branch 'refactor/move_from_xtensa' into 'master'
Movements from xtensa

Closes IDF-2164

See merge request espressif/esp-idf!10556
2021-03-11 00:24:25 +00:00
Angus Gratton
90ec0b0327 bootloader: Allow 'silent assert' config to work in bootloader
Requires adding the 'newlib' component to the bootloader project, for
platform_include header.
2021-03-03 10:26:57 +11:00
Renz Bagaporo
b1027005df arch: move stdatomic 2021-02-26 18:40:00 +08:00
Renz Bagaporo
0f03f450ff esp_hw_support: create esp_cpu
Create a esp_cpu header that contains CPU-related functions and
utilities.
2021-02-26 13:34:29 +08:00
Renz Bagaporo
03dce3668c esp_common: move tests 2021-02-24 12:16:37 +08:00
Angus Gratton
084c38a011 Merge branch 'bugfix/riscv_stack_alignment' into 'master'
core: fix cases where riscv SP were not 16 byte aligned

Closes IDF-2745

See merge request espressif/esp-idf!12413
2021-02-19 05:59:39 +00:00
Marius Vikhammer
c36dd7834f core: fix cases where riscv SP were not 16 byte aligned
RISC-V stack pointer should always be 16 byte aligned, but for some cases where
we were doing manual SP manipulation this was not always the case.
2021-02-19 11:26:21 +08:00
Angus Gratton
8c799e6469 Merge branch 'bugfix/newlib_header_additional_defines' into 'master'
newlib: fix possible redefinition of likely/unlikely macros

Closes IDFGH-4631

See merge request espressif/esp-idf!12370
2021-02-19 02:35:28 +00:00
Marius Vikhammer
eec2419390 system: enable shared stack watchpoint
Enable shared stack watchpoint for overflow detection

Enable unit tests:
 * "test printf using shared buffer stack" for C3
 * "Test vTaskDelayUntil" for S2
 * "UART can do poll()" for C3
2021-02-18 15:38:30 +08:00
Angus Gratton
7778779489 newlib: Avoid introducing ESP-IDF macros from newlib platform headers
Also, rewrite the assert.h header to be clearer

Closes https://github.com/espressif/esp-idf/issues/6445
2021-02-12 15:18:05 +11:00
Angus Gratton
807c8549e1 Merge branch 'bugfix/esp32s2_wakeup_from_light_sleep_fix' into 'master'
esp32s2 light sleep fix

Closes IDFCI-122

See merge request espressif/esp-idf!10269
2021-02-11 07:34:57 +08:00
Renz Bagaporo
f5154b82e3 newlib: init microseconds offset 2021-01-22 14:51:50 +08:00
ninh
25dcc68b5d newlib: keep esp_rtc_get_time_us when rewrite the value of RTC_SLOW_CLK_CAL_REG 2021-01-21 02:28:21 +00:00
morris
753a929525 global: fix sign-compare warnings 2021-01-12 14:05:08 +08:00
KonstantinKondrashov
aec5776091 newlib: Fix a case in FD_ISSET macro when n==-1 2021-01-06 20:54:24 +00:00
ninh
e908a32381 put pm_slp_iram_opt and pm_rtos_iram_opt related attributes in esp_pm/linker.lf 2021-01-06 03:40:28 +00:00
Marius Vikhammer
f54e9269f3 esp_system: Don't compile sleep_mode.c on c3 2020-12-31 15:20:05 +11:00
Marius Vikhammer
3458469204 newlib: Update esp32c3 ROM support, use single init function 2020-12-31 09:27:37 +11:00
Ivan Grokhotkov
b7b9ea4361 newlib: add _RETARGETABLE_LOCKING support
This adds support for the retargetable locking implementation in
newlib 3. This feature will be enabled in the future toolchain builds.
With the present version of the toolchain, this code doesn't get used.

When _RETARGETABLE_LOCKING gets enabled, newlib locking implementation
will be modified as follows:

- Legacy ESP-specific _lock_xxx functions are preserved. This is done
  because ROM copies of newlib in ESP32 and ESP32-S2 rely on these
  functions through the function pointer table. Also there is some
  code in IDF which still uses these locking functions.

- New __retarget_lock_xxx functions are introduced. Newlib expects
  these functions to be provided by the system. These functions work
  pretty much the same way as the ESP-specific _lock_xxx functions,
  except one major difference: _lock_acquire receives the lock pointer
  by value, and as such doesn't support lazy initialization.

- Static locks used by newlib are now explicitly initialized at
  startup. Since it is unlikely that these static locks are used at
  the same time, all compatible locks are set to point to the same
  mutex. This saves a bit of RAM. Note that there are still many locks
  not initialized statically, in particular those inside FILE
  structures.
2020-12-29 16:18:04 +01:00
Angus Gratton
99d93c1227 newlib: Update unit tests for ESP32-C3 2020-12-24 14:18:01 +11:00
Liu Ning
57aa65eeed components/pm: Add sleep related code iram opt chioce 2020-12-23 14:45:36 +08:00
Angus Gratton
5228d9f9ce esp32c3: Apply one-liner/small changes for ESP32-C3 2020-12-01 10:58:50 +11:00
Angus Gratton
420aef1ffe Updates for riscv support
* Target components pull in xtensa component directly
* Use CPU HAL where applicable
* Remove unnecessary xtensa headers
* Compilation changes necessary to support non-xtensa gcc types (ie int32_t/uint32_t is no
  longer signed/unsigned int).

Changes come from internal branch commit a6723fc
2020-11-13 07:49:11 +11:00
Angus Gratton
66fb5a29bb Whitespace: Automated whitespace fixes (large commit)
Apply the pre-commit hook whitespace fixes to all files in the repo.

(Line endings, blank lines at end of file, trailing whitespace)
2020-11-11 07:36:35 +00:00
Renz Bagaporo
b3a7c6e27e components: remove some unneeded headers from source files 2020-10-22 19:37:10 +08:00