We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f594ab2 commit 1207bfcCopy full SHA for 1207bfc
ports/espressif/supervisor/port.c
@@ -77,6 +77,10 @@
77
78
#include "esp_debug_helpers.h"
79
80
+#ifdef CONFIG_SPIRAM
81
+#include "esp32/spiram.h"
82
+#endif
83
+
84
#define HEAP_SIZE (48 * 1024)
85
86
uint32_t *heap;
@@ -158,8 +162,11 @@ safe_mode_t port_init(void) {
158
162
#endif
159
163
160
164
#ifdef CONFIG_SPIRAM
161
- heap = (uint32_t *)(DRAM0_CACHE_ADDRESS_HIGH - CONFIG_SPIRAM_SIZE);
- heap_size = CONFIG_SPIRAM_SIZE / sizeof(uint32_t);
165
+ if (esp_spiram_is_initialized()) {
166
+ size_t spiram_size = esp_spiram_get_size();
167
+ heap = (uint32_t *)(SOC_EXTRAM_DATA_HIGH - spiram_size);
168
+ heap_size = spiram_size / sizeof(uint32_t);
169
+ }
170
171
172
if (heap == NULL) {
0 commit comments