Also, if I declare the array of size larger than 3585 bytes outside the main() or use malloc, there is no issue.
PS: I am using esp-idf 5.0.1 stable
- #include "freertos/FreeRTOS.h"
- #include "freertos/task.h"
- #include <stdio.h>
- void app_main(void)
- {
- uint8_t int_array[3585] = {0};
- while (1)
- {
- int_array[0]++;
- array[0]++;
- printf("static array size: %d, count: %d\n", (unsigned int)sizeof(int_array), (unsigned int)int_array[0]);
- vTaskDelay(pdMS_TO_TICKS(1000));
- }
- }