dynamicBitmapGetAddress return wrong Address for external SDRAM
Hello,
I have a problem with dynamic bitmaps when they are generated on an external SDRAM.
We are using a STM32H743BGTx with TouchGFX 4.23.2 and STM32Cube Package 1.11.1.
We create a bitmap cache in the external SDRAM:
FrontendApplication::FrontendApplication(Model& m, FrontendHeap& heap)
: FrontendApplicationBase(m, heap)
{
uint16_t* const cacheStartAddr = (uint16_t*)0xD0000000;
/* Bit per picture 320*240*3*8 */
const uint32_t cacheSize = 320*240*3 + 500;//
Bitmap::removeCache();
Bitmap::setCache(cacheStartAddr, cacheSize, 1);
}Then we create a new dynamic bitmap as follows:
void Screen1View::setupScreen()
{
const int width = 320;
const int height = 240;
//Create the dynamic bitmap
bmpId = Bitmap::dynamicBitmapCreate(width, height, Bitmap::RGB565);
if (bmpId != BITMAP_INVALID)
{
bool isDynamic = Bitmap::isDynamicBitmap(bmpId);
uint32_t nr = Bitmap::dynamicBitmapGetNumberOfBitmaps();
uint8_t *imgLocation = Bitmap::dynamicBitmapGetAddress(bmpId); //Debug Result = 0xf0000028
uint8_t *nextfree = Bitmap::getCacheTopAddress(); //Debug Result = 0xd0025828
memset(imgLocation, 0xF0, width*height*2); //Will fail cause of invalid address
}
Screen1ViewBase::setupScreen();
if(bmpId != BITMAP_INVALID)
{
CameraImage.setBitmap(Bitmap(bmpId));
CameraImage.invalidate();
}
}The function dynamicBitmapGetAddress(bmpId) points to a completely wrong address. memset goes wrong of course. However, the function getCacheTopAddress() points to the correct address. Interestingly, it works if we use an internal RAM address such as 0x30000000 for the bitmap cache. The external SDRAM works, we have already tested this. Can someone please help us here.
