mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
CI: add configs for running S2, S3 unit tests with PSRAM
Fixed various minor failures detected with these configs.
This commit is contained in:
parent
36ef485c4e
commit
374712921a
@ -831,7 +831,7 @@ UT_046:
|
||||
|
||||
UT_047:
|
||||
extends: .unit_test_esp32s2_template
|
||||
parallel: 6
|
||||
parallel: 13
|
||||
tags:
|
||||
- ESP32S2_IDF
|
||||
- UT_T1_1
|
||||
@ -894,7 +894,7 @@ UT_C3_SDSPI:
|
||||
|
||||
UT_S3:
|
||||
extends: .unit_test_esp32s3_template
|
||||
parallel: 32
|
||||
parallel: 44
|
||||
tags:
|
||||
- ESP32S3_IDF
|
||||
- UT_T1_1
|
||||
|
@ -127,6 +127,11 @@ TEST_CASE("adc2 work with wifi","[adc]")
|
||||
esp_netif_create_default_wifi_sta();
|
||||
|
||||
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
|
||||
|
||||
/* Restrict the number of buffers to allocate to account for limited memory when running large number of tests */
|
||||
cfg.static_rx_buf_num = 2;
|
||||
cfg.static_tx_buf_num = 2;
|
||||
|
||||
TEST_ESP_OK(esp_wifi_init(&cfg));
|
||||
wifi_config_t wifi_config = {
|
||||
.sta = {
|
||||
|
@ -43,11 +43,11 @@ TEST_CASE("Capabilities aligned allocator test", "[heap]")
|
||||
uint32_t *not_permitted_buf = (uint32_t *)heap_caps_aligned_alloc(alignments, (alignments + 137), MALLOC_CAP_EXEC | MALLOC_CAP_32BIT);
|
||||
TEST_ASSERT( not_permitted_buf == NULL );
|
||||
|
||||
#if CONFIG_ESP32_SPIRAM_SUPPORT || CONFIG_ESP32S2_SPIRAM_SUPPORT
|
||||
#if CONFIG_SPIRAM
|
||||
alignments = 0;
|
||||
printf("[ALIGNED_ALLOC] Allocating from external memory: \n");
|
||||
|
||||
for(;alignments <= 1024 * 1024; alignments++) {
|
||||
for(;alignments <= 1024 * 512; alignments++) {
|
||||
//Now try to take aligned memory from IRAM:
|
||||
uint8_t *buf = (uint8_t *)heap_caps_aligned_alloc(alignments, 10*1024, MALLOC_CAP_SPIRAM);
|
||||
if(((alignments & (alignments - 1)) != 0) || (!alignments)) {
|
||||
@ -112,11 +112,10 @@ TEST_CASE("Capabilities aligned calloc test", "[heap]")
|
||||
uint32_t *not_permitted_buf = (uint32_t *)heap_caps_aligned_calloc(alignments, 1, (alignments + 137), MALLOC_CAP_32BIT);
|
||||
TEST_ASSERT( not_permitted_buf == NULL );
|
||||
|
||||
#if CONFIG_ESP32_SPIRAM_SUPPORT || CONFIG_ESP32S2_SPIRAM_SUPPORT
|
||||
#if CONFIG_SPIRAM
|
||||
alignments = 0;
|
||||
printf("[ALIGNED_ALLOC] Allocating from external memory: \n");
|
||||
|
||||
for(;alignments <= 1024 * 1024; alignments++) {
|
||||
for(;alignments <= 1024 * 512; alignments++) {
|
||||
//Now try to take aligned memory from IRAM:
|
||||
uint8_t *buf = (uint8_t *)(uint8_t *)heap_caps_aligned_calloc(alignments, 1, 10*1024, MALLOC_CAP_SPIRAM);
|
||||
if(((alignments & (alignments - 1)) != 0) || (!alignments)) {
|
||||
|
@ -1474,30 +1474,58 @@ TEST_CASE("mbedtls AES external flash tests", "[aes]")
|
||||
#endif // CONFIG_SPIRAM_USE_MALLOC
|
||||
|
||||
|
||||
#if CONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK
|
||||
|
||||
RTC_FAST_ATTR uint8_t rtc_stack[4096];
|
||||
static SemaphoreHandle_t done_sem;
|
||||
|
||||
static void aes_ctr_stream_test_task(void *pv)
|
||||
static void __attribute__((unused)) aes_ctr_stream_test_task(void *pv)
|
||||
{
|
||||
aes_ctr_stream_test();
|
||||
xSemaphoreGive(done_sem);
|
||||
vTaskDelete(NULL);
|
||||
}
|
||||
|
||||
#if CONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK
|
||||
|
||||
TEST_CASE("mbedtls AES stack in RTC RAM", "[mbedtls]")
|
||||
{
|
||||
done_sem = xSemaphoreCreateBinary();
|
||||
static StaticTask_t rtc_task;
|
||||
memset(rtc_stack, 0, sizeof(rtc_stack));
|
||||
|
||||
size_t STACK_SIZE = 3072;
|
||||
uint8_t *rtc_stack = heap_caps_calloc(STACK_SIZE, 1, MALLOC_CAP_RTCRAM);
|
||||
TEST_ASSERT(esp_ptr_in_rtc_dram_fast(rtc_stack));
|
||||
|
||||
TEST_ASSERT_NOT_NULL(xTaskCreateStatic(aes_ctr_stream_test_task, "aes_ctr_task", sizeof(rtc_stack), NULL,
|
||||
TEST_ASSERT_NOT_NULL(xTaskCreateStatic(aes_ctr_stream_test_task, "aes_ctr_task", STACK_SIZE, NULL,
|
||||
3, rtc_stack, &rtc_task));
|
||||
TEST_ASSERT_TRUE(xSemaphoreTake(done_sem, 10000 / portTICK_PERIOD_MS));
|
||||
|
||||
/* Give task time to cleanup before freeing stack */
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
free(rtc_stack);
|
||||
|
||||
vSemaphoreDelete(done_sem);
|
||||
}
|
||||
|
||||
#endif //CONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK
|
||||
|
||||
#if CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY && CONFIG_SPIRAM_USE_MALLOC
|
||||
|
||||
TEST_CASE("mbedtls AES stack in PSRAM", "[mbedtls]")
|
||||
{
|
||||
done_sem = xSemaphoreCreateBinary();
|
||||
static StaticTask_t psram_task;
|
||||
size_t STACK_SIZE = 3072;
|
||||
uint8_t *psram_stack = heap_caps_calloc(STACK_SIZE, 1, MALLOC_CAP_SPIRAM);
|
||||
|
||||
TEST_ASSERT(esp_ptr_external_ram(psram_stack));
|
||||
|
||||
TEST_ASSERT_NOT_NULL(xTaskCreateStatic(aes_ctr_stream_test_task, "aes_ctr_task", STACK_SIZE, NULL,
|
||||
3, psram_stack, &psram_task));
|
||||
TEST_ASSERT_TRUE(xSemaphoreTake(done_sem, 10000 / portTICK_PERIOD_MS));
|
||||
|
||||
/* Give task time to cleanup before freeing stack */
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
free(psram_stack);
|
||||
|
||||
vSemaphoreDelete(done_sem);
|
||||
}
|
||||
|
||||
#endif //CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY && CONFIG_SPIRAM_USE_MALLOC
|
||||
|
@ -520,22 +520,48 @@ TEST_CASE("mbedtls SHA256 PSRAM DMA", "[mbedtls]")
|
||||
|
||||
#if CONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK
|
||||
|
||||
extern RTC_FAST_ATTR uint8_t rtc_stack[4096];
|
||||
|
||||
static SemaphoreHandle_t done_sem;
|
||||
|
||||
TEST_CASE("mbedtls SHA stack in RTC RAM", "[mbedtls]")
|
||||
{
|
||||
done_sem = xSemaphoreCreateBinary();
|
||||
static StaticTask_t rtc_task;
|
||||
memset(rtc_stack, 0, sizeof(rtc_stack));
|
||||
size_t STACK_SIZE = 3072;
|
||||
uint8_t *rtc_stack = heap_caps_calloc(STACK_SIZE, 1, MALLOC_CAP_RTCRAM);
|
||||
|
||||
TEST_ASSERT(esp_ptr_in_rtc_dram_fast(rtc_stack));
|
||||
|
||||
TEST_ASSERT_NOT_NULL(xTaskCreateStatic(tskRunSHA256Test, "tskRunSHA256Test_task", sizeof(rtc_stack), NULL,
|
||||
TEST_ASSERT_NOT_NULL(xTaskCreateStatic(tskRunSHA256Test, "tskRunSHA256Test_task", STACK_SIZE, NULL,
|
||||
3, rtc_stack, &rtc_task));
|
||||
TEST_ASSERT_TRUE(xSemaphoreTake(done_sem, 10000 / portTICK_PERIOD_MS));
|
||||
|
||||
/* Give task time to cleanup before freeing stack */
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
free(rtc_stack);
|
||||
|
||||
vSemaphoreDelete(done_sem);
|
||||
}
|
||||
|
||||
#endif //CONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK
|
||||
|
||||
#if CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY && CONFIG_SPIRAM_USE_MALLOC
|
||||
|
||||
TEST_CASE("mbedtls SHA stack in PSRAM", "[mbedtls]")
|
||||
{
|
||||
done_sem = xSemaphoreCreateBinary();
|
||||
static StaticTask_t psram_task;
|
||||
size_t STACK_SIZE = 3072;
|
||||
uint8_t *psram_stack = heap_caps_calloc(STACK_SIZE, 1, MALLOC_CAP_SPIRAM);
|
||||
|
||||
TEST_ASSERT(esp_ptr_external_ram(psram_stack));
|
||||
|
||||
TEST_ASSERT_NOT_NULL(xTaskCreateStatic(tskRunSHA256Test, "tskRunSHA256Test_task", STACK_SIZE, NULL,
|
||||
3, psram_stack, &psram_task));
|
||||
TEST_ASSERT_TRUE(xSemaphoreTake(done_sem, 10000 / portTICK_PERIOD_MS));
|
||||
|
||||
/* Give task time to cleanup before freeing stack */
|
||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
||||
free(psram_stack);
|
||||
|
||||
vSemaphoreDelete(done_sem);
|
||||
}
|
||||
|
||||
#endif //CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY && CONFIG_SPIRAM_USE_MALLOC
|
||||
|
@ -761,11 +761,11 @@ esp_err_t esp_enable_cache_wrap(bool icache_wrap_enable, bool dcache_wrap_enable
|
||||
uint32_t instruction_use_spiram = 0;
|
||||
uint32_t rodata_use_spiram = 0;
|
||||
#if CONFIG_SPIRAM_FETCH_INSTRUCTIONS
|
||||
extern uint32_t esp_spiram_instruction_access_enabled();
|
||||
extern uint32_t esp_spiram_instruction_access_enabled(void);
|
||||
instruction_use_spiram = esp_spiram_instruction_access_enabled();
|
||||
#endif
|
||||
#if CONFIG_SPIRAM_RODATA
|
||||
extern uint32_t esp_spiram_rodata_access_enabled();
|
||||
extern uint32_t esp_spiram_rodata_access_enabled(void);
|
||||
rodata_use_spiram = esp_spiram_rodata_access_enabled();
|
||||
#endif
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
CONFIG_IDF_TARGET="esp32s2"
|
||||
TEST_COMPONENTS=esp_hw_support
|
||||
TEST_COMPONENTS=esp_hw_support mbedtls esp_system
|
||||
CONFIG_ESP32S2_SPIRAM_SUPPORT=y
|
||||
|
3
tools/unit-test-app/configs/psram_s3_base
Normal file
3
tools/unit-test-app/configs/psram_s3_base
Normal file
@ -0,0 +1,3 @@
|
||||
CONFIG_IDF_TARGET="esp32s3"
|
||||
TEST_COMPONENTS=esp_hw_support mbedtls esp_system
|
||||
CONFIG_ESP32S3_SPIRAM_SUPPORT=y
|
Loading…
x
Reference in New Issue
Block a user