Commit Graph

564 Commits

Author SHA1 Message Date
Jakob Hasse
b3271a51af Merge branch 'bugfix/common_components_linux' into 'master'
[build system]: Fixed common requirement for Linux target

Closes IDF-3638

See merge request espressif/esp-idf!14743
2021-08-17 08:48:38 +00:00
Michael (XIAO Xufeng)
a0d2efe1be Merge branch 'bugfix/xmc_overerase' into 'master'
bootloader: add xmc spi_flash startup flow to improve reliability

See merge request espressif/esp-idf!13895
2021-08-13 15:27:48 +00:00
Jakob Hasse
7029f0537e [build system]: Fixed common requirement for Linux 2021-08-13 16:50:29 +08:00
Michael (XIAO Xufeng)
dd40123129 bootloader: add xmc spi_flash startup flow to improve reliability 2021-08-12 17:22:42 +08:00
Jakob Hasse
84d184bdb0 Merge branch 'bugfix/nvs_corrupted_storage_crashes_app' into 'master'
[NVS]: fix crashes from entry state 1

See merge request espressif/esp-idf!14548
2021-08-06 09:14:21 +00:00
Jakob Hasse
9bb2fc2afd Merge branch 'feature/esp_common_linux_in_host_tests' into 'master'
[nvs]: use real esp_common on host tests

See merge request espressif/esp-idf!14408
2021-08-05 08:31:21 +00:00
Armando (Dou Yiwen)
03fb3973a2 Merge branch 'feature/support_quad_flash_octal_psram_on_esp32s3' into 'master'
mspi: support up-to-80MHz quad flash & up-to-80MHz octal psram on esp32s3

Closes IDF-3603

See merge request espressif/esp-idf!14346
2021-08-04 03:57:16 +00:00
Jakob Hasse
0b86f81847 [nvs]: use real esp_common on host tests 2021-08-03 19:47:17 +08:00
Armando
2b52f7f696 mspi: fix no buffer reset before each psram read issue
In psram timing tuning driver, we rely on psram read and write functions
defined in `spi_timing_config.c`. If we don't do buffer reset (clear to
0), the function may untouch the buffer, which will keep last time value
(since we reuse the buffer). Therefore, if the first read is expected,
but next few reads didn't modify the buffer content, we will still see
the expected data.

These functions relies on `esp_rom_opiflash_exec_cmd`.
2021-08-03 16:54:01 +08:00
Armando
3cbf202267 mspi: cancel oct flash 40m dtr, oct flash 80m str, oct psram 40m tuning 2021-08-03 16:54:01 +08:00
Armando
038b7b1fa9 mspi: update 80MHz DTR tuning algorithm and Oct PSRAM 80M DTR tuning parameters 2021-08-03 16:54:00 +08:00
Armando
0f91a01a46 mspi: support up-to-80MHz quad flash & up-to-80MHz octal psram on esp32s3 2021-08-03 16:54:00 +08:00
Cao Sen Miao
992de2750e spi_flash: add support for ext flash 2021-07-31 14:11:35 +08:00
Jakob Hasse
de6b54de66 [nvs_flash]: Entries with state == 1 don't crash 2021-07-30 18:33:27 +08:00
Cao Sen Miao
c29b3e2e36 spi_flash: move the unlock patch to bootloader and add support for GD 2021-07-29 10:46:33 +08:00
Michael (XIAO Xufeng)
58022f8599 Merge branch 'bugfix/esp_flash_erase_0' into 'master'
esp_flash: fix esp_flash_erase_region over-erase with 0 length (Github PR)

Closes IDFGH-5592

See merge request espressif/esp-idf!14498
2021-07-28 15:09:08 +00:00
Ivan Grokhotkov
7534c4467f rom, spi_flash: add a patch for esp_flash_erase_region for C3, S3, H2 2021-07-24 13:28:25 +02:00
Ivan Grokhotkov
118fafef07 spi_flash: add test case for esp_flash_erase_region with 0 size 2021-07-23 14:14:57 +02:00
negativekelvin
8e6700c156
esp_flash_api fixes 2021-07-23 02:35:27 -07:00
Omar Chebib
bd96484f7b host tests: add missing header files for compiling host tests 2021-07-20 17:44:20 +08:00
Renz Bagaporo
7c22cccb9c esp32: cleanup build script 2021-07-16 20:14:27 +08:00
Renz Bagaporo
844af01eb4 esp32: move spiram, himem 2021-07-16 20:14:26 +08:00
Omar Chebib
b967dc0dbf espsystem: add support for RISC-V panic backtrace
Add .eh_frame and .eh_frame_hdr sections to the binary (can be
enabled/disabled within menuconfig). These sections are parsed
when a panic occurs. Their DWARF instructions are decoded and
executed at runtime, to retrieve the whole backtrace. This
parser has been tested on both RISC-V and x86 architectures.

This feature needs esptool's merge adjacent ELF sections feature.
2021-07-13 15:42:40 +08:00
Jakob Hasse
2ac44f1e76 [spi_flash]: fixed test disabling
* MR 14212 accidentally disabled the test
  "spi_flash deadlock with high priority
  busy-waiting task"
  for all targets except S3 without legacy
  flash implementation. The test is now
  disabled for all targets, since
  the same issue appeared on other targets, too.
2021-07-05 11:25:15 +08:00
Cao Sen Miao
fecf27e54c spi_flash: add support for 32Mbit address GD flash, for GD25Q256 2021-07-02 17:13:51 +08:00
Angus Gratton
b0f68decaf Merge branch 'bugfix/exclude_spi_flash_deadlock_test_on_s3' into 'master'
[spi_flash]: Disable deadlock test from S3

See merge request espressif/esp-idf!14212
2021-07-02 05:49:15 +00: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
Jakob Hasse
7a0d40582e [spi_flash]: Disable deadlock test from S3 2021-07-01 15:29:47 +08:00
Armando
bc248278f8 spiflash: add octal spi psram support on 727 2021-06-25 19:41:57 +08:00
Michael (XIAO Xufeng)
1c14ad0844 Merge branch 'test/flash_perf_thr_update_by_grafana_avg' into 'master'
ci: adjust spi_flash performance value according to more test data

See merge request espressif/esp-idf!13958
2021-06-17 05:04:40 +00:00
Michael (XIAO Xufeng)
904afc65f8 ci: adjust spi_flash performance value according to more test data
After we have the performance dashboard, we have more data and no longer depend on the threshold to ensure performance.
Set looser performance thresholds to avoid CI failure.
2021-06-17 09:49:04 +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
Michael (XIAO Xufeng)
dc6d6f225e spi_flash: reverted unwilling cs_setup argument
Partially reverted 08f1bbe0c7.

The host should have this flexibility, which is consistent to the cs_hold argument.

However, the user should know as less as possible about the host.
So the wrapper layer (esp_flash_spi_init.c) should cover this, helping to set cs_setup to 1, to meet the common requirements.
2021-06-04 15:29:53 +08:00
Cao Sen Miao
08f1bbe0c7 spi_flash: fix cs line setup to make the flash driver more stable 2021-06-01 16:41:41 +08:00
Angus Gratton
928e6c4d1c host tests: Add copyright notices and "This is a stub" notices to all stub files 2021-05-27 23:57:22 +00:00
Angus Gratton
da1f055e26 host tests: Fix log level in stub header
Reported on forum https://www.esp32.com/viewtopic.php?f=14&t=20838&p=76246
2021-05-27 23:57:22 +00:00
Angus Gratton
eecf70efd0 partition: Replace strlcpy() with strncpy()
Regression in ede477ea65 for host tests only - ESP-IDF supports
strlcpy() but strlcpy & strlcat are currently no-ops in the host
tests (to avoid libbsd dependency).
2021-05-20 09:51:29 +10:00
Angus Gratton
ede477ea65 paritition_table: Verify the partition table md5sum when loading the app
Additionally, always enable the partition MD5 check if flash encryption is on in
Release mode. This ensures the partition table ciphertext has not been modified
(CVE-2021-27926).

The exception is pre-V3.1 ESP-IDF bootloaders and partition tables, which
don't have support for the MD5 entry.
2021-05-18 01:32:59 +00:00
Ivan Grokhotkov
f92e1c45ae esp_partition: add test, docs for ESP_PARTITION_TYPE_ANY 2021-05-05 15:11:29 +02:00
0xFEEDC0DE64
1f419bd983 Allow to find any partition type (app and data) with iterator
Merges https://github.com/espressif/esp-idf/pull/6586
2021-05-05 14:54:07 +02:00
Jiang Jiang Jian
efb9f87951 Merge branch 'bugfix/fix_728_series_reboot_failure' into 'master'
[system]: Fix two  (re)boot failure issues on ESP32S3Beta

Closes WIFI-3548, WIFI-3559, and IDF-3170

See merge request espressif/esp-idf!13268
2021-04-30 03:20:47 +00:00
Michael (XIAO Xufeng)
859f7e3664 Merge branch 'feature/support_eon_flash_qaud_mode_esp_flash' into 'master'
esp_flash: support override default chip driver list

Closes IDF-2907

See merge request espressif/esp-idf!12565
2021-04-29 04:03:56 +00:00
wuzhenghui
fa8389da00 remove othercore cache disable 2021-04-29 03:10:47 +00:00
Michael (XIAO Xufeng)
26585b4b4b esp_flash: support override default chip driver list 2021-04-26 16:05:42 +08:00
Michael (XIAO Xufeng)
7defd291a4 Merge branch 'feature/refactoring_flash_encryption_to_new_api' into 'master'
spi_flash: refactoring flash encryption implementations into new api

Closes IDFGH-4493, IDFGH-4423, and IDF-657

See merge request espressif/esp-idf!12569
2021-04-26 06:34:48 +00:00
Cao Sen Miao
2059990c94 ci: Add more information for flash performance test 2021-04-25 17:59:10 +08:00
Cao Sen Miao
0d81edb174 spi_flash: refactoring flash encryption into new api 2021-04-25 17:09:25 +08:00
Jakob Hasse
68393c41c4 doc: linux host test documentation 2021-04-23 09:27:35 +08:00
Jakob Hasse
2fb5b42eb1 [nvs] add nvs page host test to CI
Closes IDF-2425
2021-04-20 14:40:16 +08:00
Cao Sen Miao
ed16e9b5d6 spi_flash: enable unit-test for flash suspend 2021-04-15 12:05:40 +08:00
Michael (XIAO Xufeng)
93712eae49 Merge branch 'bugfix/fix_flash_ci' into 'master'
esp_flash: fix host number for passing ci

See merge request espressif/esp-idf!13090
2021-04-13 03:23:02 +00:00
Michael (XIAO Xufeng)
8cfcf6da7a Merge branch 'bugfix/enable_gpio18_gpio19_esp32c3' into 'master'
gpio: Disable USB JTAG when setting pins 18 and 19 as GPIOs on ESP32C3

Closes IDF-2964

See merge request espressif/esp-idf!12753
2021-04-12 09:39:55 +00:00
Cao Sen Miao
c185a4947f esp_flash: fix host number for passing ci 2021-04-09 17:43:39 +08:00
Michael (XIAO Xufeng)
925dacd7fb Merge branch 'bugfix/remove_HSPI_macro_on_c3' into 'master'
spi: remove HSPI macros on esp32c3 and esp32s3

Closes IDF-2535

See merge request espressif/esp-idf!12637
2021-04-08 09:33:18 +00:00
Omar Chebib
cd79f3907d gpio: Disable USB JTAG when setting pins 18 and 19 as GPIOs on ESP32C3
When `DIS_USB_JTAG` eFuse is NOT burned (`False`), it is not possible
to set pins 18 and 19 as GPIOs. This commit solves this by manually
disabling USB JTAG when using pins 18 or 19.
The functions shall use `gpio_hal_iomux_func_sel` instead of
`PIN_FUNC_SELELECT`.
2021-04-08 14:01:18 +08:00
Armando
9b9ea71ff9 spi: remove HSPI macro on esp32c3 and esp32s3 2021-04-06 13:42:49 +08:00
Angus Gratton
94ac251091 Merge branch 'doc/general_notes' into 'master'
doc: Update docs about startup sequence and memory types

Closes IDF-2321, IDF-2409, and IDFGH-1540

See merge request espressif/esp-idf!12636
2021-04-05 23:51:25 +00:00
Renz Bagaporo
e6edf34e82 esp32: move esp_clk functions 2021-03-31 19:17:33 +08:00
Renz Bagaporo
4a08264e7a esp_system: split esp_system.h header 2021-03-31 19:13:03 +08:00
Angus Gratton
492b061cbc doc: update the memory types and startup docs 2021-03-31 09:37:28 +11:00
Cao Sen Miao
c54ea54d98 spi_flash: make suspend off by default and add more information for using suspend 2021-03-26 13:57:14 +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
Michael (XIAO Xufeng)
ed624c48f6 Merge branch 'feature/flash_unique_id' into 'master'
spi_flash: add a new feature to read the unique id of the flash chip

Closes IDFGH-2085

See merge request espressif/esp-idf!11421
2021-03-22 06:51:21 +00: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
Cao Sen Miao
78a2dbe42a spi_flash: add a new function to support read the unique id
Close https://github.com/espressif/esp-idf/pull/4255
2021-03-15 11:40:33 +08:00
jiangguangming
ae04518a32 spi_flash: make spiflash compatible with ESP32C3 and ESP32S3 ROM 2021-03-12 17:31:13 +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
Michael (XIAO Xufeng)
ffa93ed9ec Merge branch 'bugfix/simple_ota_example_test' into 'master'
ota: fix ota with flash encryption

Closes IDFGH-4740, IDFCI-442, and IDFCI-448

See merge request espressif/esp-idf!12412
2021-03-04 09:45:58 +00:00
Michael (XIAO Xufeng)
e9ecc4a0af Merge branch 'bugfix/esp32s3_flash_read_write' into 'master'
spi_flash: modify nvs reading writing issue on esp32s3

Closes WIFI-3438 and IDF-2866

See merge request espressif/esp-idf!12604
2021-03-04 03:53:35 +00:00
Cao Sen Miao
0b7caf96a9 spi_flash:modify nvs reading writing issue on esp32s3 2021-03-03 22:02:32 +08:00
Angus Gratton
d6f4d99d93 core system: Fix warnings in compilation when assertions are disabled
Adds a CI config for hello world that sets this, to catch future regressions
2021-03-03 10:26:57 +11:00
Cao Sen Miao
6fbf61493c ota: fix ota with flash encryption 2021-03-01 14:11:55 +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
Michael (XIAO Xufeng)
476fdcba68 spi_flash: update docs after adding CONFIG_SPI_FLASH_AUTO_SUSPEND 2021-02-24 20:20:18 +08: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
Marius Vikhammer
e52e75f2de spi_flash: disable mmap into instr space unit test for C3
On C3 the cache is programmatically split between Icache and dcache and with the default setup we dont leave a lot pages
available for additional mmaps into instruction space. Disabling this test for now since any hypothetical use case for this
is no longer supported "out of the box"
2021-02-18 15:38:30 +08:00
Michael (XIAO Xufeng)
2c0962f727 Merge branch 'feature/spi_flash_auto_suspend_default_on_c3' into 'master'
spi_flash: make the auto_suspend default y on C3

See merge request espressif/esp-idf!12233
2021-02-09 19:50:48 +08:00
Michael (XIAO Xufeng)
747ac00f9b Merge branch 'bugfix/flash_encyption_80Mflash_40Mram' into 'master'
flash_encryption/psram: fixed the issue that block when flash_encryption_write

See merge request espressif/esp-idf!12177
2021-02-05 22:00:26 +08:00
Cao Sen Miao
c1b41ece32 flash_encryption: Quick fixed the issue that block when flash_encryption_write, Related https://github.com/espressif/esp-idf/issues/6322, Related https://github.com/espressif/esp-idf/issues/6254 2021-02-05 20:10:42 +08:00
Cao Sen Miao
b1d3d0ac74 suspend_test: delay more time for erase 2021-02-04 16:47:41 +08:00
Cao Sen Miao
e38326d715 spi_flash: fix the issue that ext flash hold is not controlled properly 2021-02-04 14:44:51 +08:00
Cao Sen Miao
8020c46da7 spi_flash: enable ext flash unit-test on esp32c3 2021-02-04 14:44:50 +08:00
Michael (XIAO Xufeng)
a0573f5b9f spi_flash: make the auto_suspend default y on C3 2021-02-04 14:11:04 +08:00
Mahavir Jain
e712a91488 spi_flash: add config option to enable encrypted partition read/write
This feature can be disabled to save some IRAM (approx 1KB) for cases
where flash encryption feature is not required.
2021-01-28 12:19:21 +00:00
Mahavir Jain
8a01cc2c26 Revert "esp_partition: disable encrypted reads/writes if flash encryption is disabled"
This reverts commit bf35ef1ce7.

It has been noticed that there are scenarios where even though firmware is not enabled
with flash encryption config feature, it should be able to write to encrypted partitions.

This revert adds the feature back which was removed around v4.0 timelines, and same
change will be backported to all releases (upto v4.0) for consistency.
2021-01-28 12:19:21 +00:00
Cao Sen Miao
f3e79ca166 spi_flash(c3): add boya chip support for suspend feature 2021-01-25 11:14:06 +08:00
Cao Sen Miao
9905da46e0 spi_flash: Add auto suspend mode on esp32c3 2021-01-25 11:14:02 +08:00
KonstantinKondrashov
1f37a5f162 spi_flash(esp32-s2): Add the workaround of a reboot issue when SPI HW suspend is enabled 2021-01-25 11:13:38 +08:00
KonstantinKondrashov
60e58eaddb spi_flash: Add auto-suspend mode for ESP32-S2
Uses HW auto_wait_idle, HW auto_suspend and SW resume
2021-01-25 11:13:38 +08:00
KonstantinKondrashov
afef16c2e9 spi_flash: Support suspend/resume mode for operations
- Adds arbitration between the erase and write in suspend mode
     (If the flash memory is suspended then only a read operation can be performed.)
- espcoredump: Dump does not use suspend feature, just resume before continue.
- spi_flash: Add release_cpu() to do suspend/release_cpu/resume
2021-01-25 11:13:38 +08:00
Angus Gratton
a7da0c894b Merge branch 'feature/c3_master_flash_enc_support' into 'master'
flash encryption: merge C3 flash encryption changes to master

See merge request espressif/esp-idf!12040
2021-01-22 12:58:38 +08:00
Cao Sen Miao
d69a07ae20 spi_flash: enable spi_flash write unit-test on esp32c3 2021-01-19 12:04:57 +08:00
Marius Vikhammer
03fa63b0c9 bootloader: add flash encryption support for C3
Adds flash encryption support for C3 and updates docs for S2 & C3
2021-01-18 14:10:54 +08:00
morris
753a929525 global: fix sign-compare warnings 2021-01-12 14:05:08 +08:00
Angus Gratton
edac64b703 Merge branch 'feature/c3_master_unit_test' into 'master'
C3: build unit tests for C3

See merge request espressif/esp-idf!11856
2021-01-11 18:11:06 +08:00
Marius Vikhammer
9c8e4fd4c5 C3: build and run unit tests
Enable building and running of unit tests in CI for C3 as well as fix
related compile errors

Also enables building of C3 test apps
2021-01-11 11:34:37 +08:00
Cao Sen Miao
228a819a42 spi_flash: idf repo stuff tobe consistent with that in rom 2021-01-08 18:36:23 +08:00
Michael (XIAO Xufeng)
56cdf4268f Merge branch 'ci/alternative_flash_performance' into 'master'
ci: only run flash performance test on specified runners

Closes IDF-2520

See merge request espressif/esp-idf!11673
2021-01-04 15:35:53 +08:00
Ivan Grokhotkov
7f3b16a99d freertos: always enable static allocation
to use it for newlib locks
2020-12-29 16:18:04 +01:00
Angus Gratton
c3ba995f2c Merge branch 'ci/ccomp_performance_tests' into 'master'
unit_test: Refactor all performance tests that rely on cache compensated timer

See merge request espressif/esp-idf!11709
2020-12-24 13:44:52 +08:00
Michael (XIAO Xufeng)
d5e1f43175 Merge branch 'feature/support_ext_flash_c3' into 'master'
esp_flash: support external flash on C3

Closes IDF-2123

See merge request espressif/esp-idf!11648
2020-12-24 10:30:20 +08:00
Cao Sen Miao
83f6eaf0d2 ci: make flash performance test alternative 2020-12-22 16:46:04 +08:00
Marius Vikhammer
0a95151a75 unit_test: Refactor all performance tests that rely on cache compensated timer
There is no ccomp timer on C3, which means our performance tests will start
failing again due to variance caused by cache misses.

This MR adds TEST_PERFORMANCE_CCOMP_ macro that will only fail
performance test if CCOMP timer is supported on the target
2020-12-22 18:56:24 +11:00
Michael (XIAO Xufeng)
ad6ed3fd2e mmap: fixed the issue mmap cannot be called with pointers to psram 2020-12-22 13:42:42 +08:00
Michael (XIAO Xufeng)
7f3e61cf63 esp_flash: add support for external flash on C3 2020-12-22 13:31:04 +08:00
Angus Gratton
06ec032c0c spi_flash: Simplify init-time size check 2020-12-17 15:34:13 +11:00
Cao Sen Miao
0736c91d68 soc: Remove cache constants from soc.h 2020-12-17 15:34:13 +11:00
Angus Gratton
d4c9a45675 spi_flash: Add ESP32-C3 support
Based on internal commit 3ef01301fff
2020-12-17 15:34:13 +11:00
Jakob Hasse
00819a3022 NVS flash: host-based unit test of nvs::Page
* General tests like page loading from flash
* Rough test of fixed-size data types
* Rough test of blob read
* Added coverage target in cmake, also accessible
  via `idf.py coverage`
* Fixed unsigned comparison in comp. enum table
* introducing temporary LINUX_TARGET define
2020-12-14 18:53:14 +08:00
Jakob Hasse
c233ce0449 spi_flash: mocking should be possible now
The following three headers will be mockes:
* esp_flash.h
* esp_spi_flash.h
* esp_partition.h
* counter functions live in own header
* add spi_flash sim dir for esp_err.h to Unity
* modified gen_esp_err_to_name.py to ignore
  sim/ dir in spi_flash component

Add cmock .yaml config file
Add spi hal header until soc can mock the hal
  layer as well.
2020-12-14 18:53:14 +08:00
Jakob Hasse
52093fa4ef linux: added linux target
* add toolchain file
* add linux to preview targets
* add stub for dfu number in cmake
* excluded unity runner per default
* Added esp_attr.h and esp_partition.h linux stubs
* component.cmake check list for emptyness
* added switch for linux in unity cmake file
* Added Linux host example app
2020-12-14 18:53:14 +08:00
Jakob Hasse
60dfd87e65 SPI Flash: fix doc error in esp_partition.h 2020-12-10 17:03:56 +08:00
Cao Sen Miao
eeddd44d0a esp_flash: update document to reflect the restrictions of mmap/cache 2020-12-04 11:10:43 +08:00
Angus Gratton
5228d9f9ce esp32c3: Apply one-liner/small changes for ESP32-C3 2020-12-01 10:58:50 +11:00
Cao Sen Miao
a610b3ac42 spi_flash: add a block of flash chip supports in the document 2020-11-24 15:46:53 +08:00
Cao Sen Miao
11188d2143 esp_flash:fix bug about clearing WLE automatically after actions 2020-11-12 16:44:29 +08:00
Angus Gratton
1a35b5ac9b Merge branch 'feat/esp_flash_yield_refactor' into 'master'
esp_flash: refactor to support various type of yield

See merge request espressif/esp-idf!10425
2020-11-12 16:23:02 +08: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
Angus Gratton
e82eac4354 cmake: Apply cmakelint fixes 2020-11-11 07:36:35 +00:00
Michael (XIAO Xufeng)
7ddfcfb8d2 esp_flash_test: improve unit test
From now on, we have two tags for esp_flash tests:

- [esp_flash] for main flash chip only tests
- [esp_flash_3] for tests with external flash chips

To Run all tests, type `[esp_flash`; to run tests for main flash chip
only, type `[esp_flash].
2020-11-10 19:05:28 +08:00
Michael (XIAO Xufeng)
8ae09194ac esp_flash: refactor to support various type of yield
There is a periodically yield in the esp_flash driver, to ensure the
cache will not be disabled for too long on ESP32.

On ESP32-S2 and later, we need to support more different kind of yield:

1. polling conditions, including timeout, SW read request, etc.
2. wait for events, including HW done/error/auto-suspend, timeout
semaphore, etc.

The check_yield() and yield() is separated into two parts, because we
may need to insert suspend, etc. between them.
2020-11-10 19:05:22 +08:00
Michael (XIAO Xufeng)
d48c4e1da7 spi_flash_test: workaround for broken ROM API after new API calls. 2020-10-29 18:21:44 +08:00
Michael (XIAO Xufeng)
b4c3718e39 flash_test: test 32bit address region if chip size meet 2020-10-29 18:21:27 +08:00
Michael (XIAO Xufeng)
3bacf35310 esp_flash: support high capacity flash chips (32-bit address) 2020-10-29 18:20:11 +08:00
Renz Bagaporo
79887fdc6c soc: descriptive part occupy whole component 2020-10-28 07:21:29 +08:00
Michael (XIAO Xufeng)
2a329df051 Merge branch 'feat/spi_flash_qio_test' into 'master'
spi_flash: add unit tests for qio mode

See merge request espressif/esp-idf!8303
2020-10-27 12:24:05 +08:00
Renz Bagaporo
21e46d5b3c ci: use actual esp_system headers for host test 2020-10-22 19:42:34 +08:00
Renz Bagaporo
b3a7c6e27e components: remove some unneeded headers from source files 2020-10-22 19:37:10 +08:00
Michael (XIAO Xufeng)
3c167497ad Merge branch 'bugfix/esp_flash_erase_timeout' into 'master'
esp_flash: change timeout threshold and can close timeout

Closes IDF-2023

See merge request espressif/esp-idf!10138
2020-10-12 12:49:36 +08:00
Cao Sen Miao
b9f6efd99a esp_flash: change timeout threshold and can close timeout 2020-10-12 10:43:25 +08:00
Cao Sen Miao
98cb2e5af3 spi_flash: add a unit test for HSPI on esp32s2 2020-10-09 20:57:00 +08:00
Michael (XIAO Xufeng)
fe37db3271 esp_flash: fix the incorrect check_idle logic in LL and chip_driver 2020-10-02 05:34:36 +00:00
Cao Sen Miao
f448e97fea flash:patch for clearing WEL in ROM 2020-09-28 12:53:06 +08:00
Jiang Jiang Jian
b626e306da Merge branch 'bugfix/can_mmap_after_get_enough_free_mmu_pages' into 'master'
flash_mmap: can mmap after get enough free MMU pages

Closes IDFCI-49 and IDFCI-84

See merge request espressif/esp-idf!9728
2020-09-23 21:03:53 +08:00
jiangguangming
28145e0894 support flash instr and rodata copy to SPIRAM 2020-09-22 15:15:03 +08:00
morris
61f89b97c6 bringup esp32-s3 on FPGA 2020-09-22 15:15:03 +08:00
Cao Sen Miao
d7e50c6457 spi_flash:bringup some flash supports for esp32s3 2020-09-22 15:15:03 +08:00
jiangguangming
052f88f1d1 flash_mmap: restore interrupt and cache before err return 2020-09-21 07:37:50 +00:00
jiangguangming
61e341e791 flash_mmap: can mmap after get enough free MMU pages 2020-09-21 07:37:50 +00:00
Michael (XIAO Xufeng)
4e287a09fe spi_flash: add unit tests for qio mode 2020-09-20 01:57:14 +08:00
Michael (XIAO Xufeng)
fefdee1349 bootloader: fix the WRSR format for ISSI flash chips
1. The 2nd bootloader always call `rom_spiflash_unlock()`, but never help to clear the WEL bit when exit. This may cause system unstability.

   This commit helps to clear WEL when flash configuration is done.

   **RISK:** When the app starts, it didn't have to clear the WEL before it actually write/erase. But now the very first write/erase operation should be done after a WEL clear. Though the risk is little (all the following write/erase also need to clear the WEL), we still have to test this carefully, especially for those functions used by the OTA.

2. The `rom_spiflash_unlock()` function in the patch of ESP32 may (1) trigger the QPI, (2) clear the QE or (3) fail to unlock the ISSI chips.

   Status register bitmap of ISSI chip and GD chip:

| SR | ISSI | GD25LQ32C |
| -- | ---- | --------- |
| 0  | WIP  | WIP       |
| 1  | WEL  | WEL       |
| 2  | BP0  | BP0       |
| 3  | BP1  | BP1       |
| 4  | BP2  | BP2       |
| 5  | BP3  | BP3       |
| 6  | QE   | BP4       |
| 7  | SRWD | SRP0      |
| 8  |      | SRP1      |
| 9  |      | QE        |
| 10 |      | SUS2      |
| 11 |      | LB1       |
| 12 |      | LB2       |
| 13 |      | LB3       |
| 14 |      | CMP       |
| 15 |      | SUS1      |

   QE bit of other chips are at the bit 9 of the status register (i.e. bit 1 of SR2), which should be read by RDSR2 command.

   However, the RDSR2 (35H, Read Status 2) command for chip of other vendors happens to be the QIOEN (Enter QPI mode) command of ISSI chips. When the `rom_spiflash_unlock()` function trys to read SR2, it may trigger the QPI of ISSI chips.

   Moreover, when `rom_spiflash_unlock()` try to clear the BP4 bit in the status register, QE (bit 6) of ISSI chip may be cleared by accident. Or if the ISSI chip doesn't accept WRSR command with argument of two bytes (since it only have status register of one byte), it may fail to clear the other protect bits (BP0~BP3) as expected.

   This commit makes the `rom_spiflash_unlock()` check whether the vendor is issi. if so, `rom_spiflash_unlock()` only send RDSR to read the status register, send WRSR with only 1 byte argument, and also avoid clearing the QE bit (bit 6).

3. `rom_spiflash_unlock()` always send WRSR command to clear protection bits even when there is no protection bit active. And the execution of clearing status registers, which takes about 700us, will also happen even when there's no bits cleared.

   This commit skips the clearing of status register if there is no protection bits active.

Also move the execute_flash_command to be a bootloader API; move
implementation of spi_flash_wrap_set to the bootloader
2020-09-19 10:51:51 +08:00
Ivan Grokhotkov
96db25c861 Merge branch 'feature/nvs_encryption_s2' into 'master'
NVS: using esp_partition API

Closes IDF-1340 and IDF-858

See merge request espressif/esp-idf!8683
2020-09-16 02:12:54 +08:00
Jakob Hasse
aca9ec28b3 NVS: using esp_partition API
* partition api changed from spi_flash* API to
  esp_partition* API and is abstracted as a C++
  interface.
* The old nvs encryption is still possible
* changed default unit test app partition table
* Partitions coming from esp_partition API are
  checked for generic flash encryption. If yes,
  an error is returned since generic flash
  encryption isn't compatible with nvs
  encryption
* esp32, esp32s2 tests don't require nvs_flash
  but mbedtls now

Closes IDF-1340
Closes IDF-858
2020-09-14 10:34:34 +08:00
Marius Vikhammer
b2f390df01 hal: update link to HAL readme.md
The HAL readme was moved during refactoring, but links were not updated.
2020-09-11 15:48:08 +08:00
Michael (XIAO Xufeng)
37e3f20252 Merge branch 'bugfix/esp_flash_write_temp_buffer_lifetime' into 'master'
esp_flash: fix write issue using buffer on stack out of lifetime

See merge request espressif/esp-idf!9932
2020-09-10 17:49:04 +08:00
Ivan Grokhotkov
b6467257b9 Merge branch 'feature/cmock_component' into 'master'
cmock as component replacing unity

See merge request espressif/esp-idf!9859
2020-09-10 16:06:20 +08:00
Michael (XIAO Xufeng)
233b4720b4 esp_flash: fix write issue using buffer on stack out of lifetime 2020-09-10 03:17:39 +00:00
Michael (XIAO Xufeng)
9e7eda9770 Merge branch 'feat/spi_flash_override_size' into 'master'
spi_flash: add config option to override flash size in bootloader header

See merge request espressif/esp-idf!10131
2020-09-03 02:57:31 +08:00
Jakob Hasse
20c068ef3b cmock: added cmock as component
* changing dependencies from unity->cmock
* added component.mk and Makefile.projbuild
* ignore test dir in gen_esp_err_to_name.py
* added some brief introduction of CMock in IDF
2020-09-02 16:38:37 +08:00
Michael (XIAO Xufeng)
c15c6a2803 Merge branch 'fix/esp_flash_delay_type' into 'master'
esp_flash: fix the data type of delay_us

See merge request espressif/esp-idf!10115
2020-09-02 01:21:12 +08:00