Hello!
it seems that SDRAM.begin can be repeated with different parameters without warning. For example:
SDRAM.begin(SDRAM_START_ADDRESS + 2 * 1024 * 1024);
// 2MB of contiguous memory available at the beginning
uint32_t* framebuffer = (uint32_t*)SDRAM_START_ADDRESS;
// We can't allocate anymore the huge 7MB array
SDRAM.begin(SDRAM_START_ADDRESS);
uint8_t* myVeryBigArray = (uint8_t*)SDRAM.malloc(7 * 1024 * 1024);
if (myVeryBigArray == NULL) {
Serial.println("Oops, too big :)");
}
allocates 7MB without error
That can be problematic when - for example - Arduino_H7_Video for Arduino GIGA internally allocates nearly all SDRAM for framebuffers
#if defined(ARDUINO_GIGA)
/* Configure SDRAM */
SDRAM.begin(dsi_getFramebufferEnd());
#endif
and the user is not prevented from re-initializing it
Hello!
it seems that SDRAM.begin can be repeated with different parameters without warning. For example:
allocates 7MB without error
That can be problematic when - for example - Arduino_H7_Video for Arduino GIGA internally allocates nearly all SDRAM for framebuffers
and the user is not prevented from re-initializing it