Skip to content

Commit b1529bc

Browse files
authored
nuttx/esp32s3: Apply ibus/dbus adjustment to internal ram 1 as well (#3421)
1 parent 773efc0 commit b1529bc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

core/shared/platform/nuttx/nuttx_platform.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
#define IRAM0_CACHE_ADDRESS_HIGH 0x44000000
2020
#define IRAM_ATTR locate_data(".iram1")
2121

22+
#define INTERNAL_SRAM_1_DBUS_ADDRESS_LOW 0x3fc88000
23+
#define INTERNAL_SRAM_1_DBUS_ADDRESS_HIGH 0x3fcf0000
24+
#define INTERNAL_SRAM_1_IBUS_ADDRESS_LOW 0x40378000
25+
#define INTERNAL_SRAM_1_IBUS_ADDRESS_HIGH 0x403e0000
26+
2227
#define in_ibus_ext(addr) \
2328
(((uint32)addr >= IRAM0_CACHE_ADDRESS_LOW) \
2429
&& ((uint32)addr < IRAM0_CACHE_ADDRESS_HIGH))
@@ -182,6 +187,11 @@ os_get_dbus_mirror(void *ibus)
182187
if (in_ibus_ext(ibus)) {
183188
return (void *)((uint8 *)ibus - MEM_DUAL_BUS_OFFSET);
184189
}
190+
else if (INTERNAL_SRAM_1_IBUS_ADDRESS_LOW <= (uintptr_t)ibus
191+
&& (uintptr_t)ibus < INTERNAL_SRAM_1_IBUS_ADDRESS_HIGH) {
192+
return (void *)((uintptr_t)ibus - INTERNAL_SRAM_1_IBUS_ADDRESS_LOW
193+
+ INTERNAL_SRAM_1_DBUS_ADDRESS_LOW);
194+
}
185195
else {
186196
return ibus;
187197
}

0 commit comments

Comments
 (0)