TouchGFX cacheing issue
Hi All,
We are using STM32F429ZIT6 MCU with 8 Mega byte SD RAM connected to FMC peripheral. And 16 Mega Byte Serial flash which is connected via SPI.
The internal memory is 2 MByte for this MCU
We are working on a touch GFX project wich have many assets so the size of total binary exceeds the 2 MB internal Flash. So I have written a bootloader which takes the binary in via a python script and places Application in the Flash memory and assets(modified the linker script) in the SPI flash
Now on every boot up the application will copy assets from spi flash and place it in SD RAM. I verified the memory dump of ram is exactly matching the assets binary contents. So I am confident that the assets are properly copied.
I am following this webpage to do this.
https://touchgfx.zendesk.com/hc/en-us/articles/203564102
As mentioned in the above webpage I am following the exact same method.
Below is the code.
class myHAL: public STM32F4HAL
{
public:
virtual bool blockCopy(void* RESTRICT dest, const void* RESTRICT src, uint32_t numBytes);
};
bool myHAL::blockCopy(void* RESTRICT dest, const void* RESTRICT src, uint32_t numBytes)
{
copySerialFlashToToRam();
HAL_Delay(1000);
return true;
}
STM32F4DMA dma;
STM32F4TouchController tc;
STM32F4Instrumentation mcuInstr;
static LCD16bpp display;
static uint16_t bitdepth = 16;
namespace touchgfx
{
void touchgfx_init()
{
uint16_t dispWidth = 218;
uint16_t dispHeight = 480;
uint16_t* cacheStartAddr = (uint16_t*)ASSETS_START_ADDRESS;
uint32_t cacheSize = SIZE_OF_ASSETS_BINARY + 100000U ;
Bitmap::cacheAll();
HAL& hal = touchgfx_generic_init<STM32F4HAL>(dma, display, tc, dispWidth, dispHeight,cacheStartAddr,
cacheSize, 0);
hal.setFrameBufferStartAddress((uint16_t*)frameBuf0, bitdepth ,true , true);
hal.setTouchSampleRate(2);
hal.setFingerSize(1);
// By default frame rate compensation is off.
// Enable frame rate compensation to smooth out animations in case there is periodic slow frame rates.
hal.setFrameRateCompensation(false);
// This platform can handle simultaneous DMA and TFT accesses to SDRAM, so disable lock to increase performance.
hal.lockDMAToFrontPorch(false);
mcuInstr.init();
//Set MCU instrumentation and Load calculation
hal.setMCUInstrumentation(&mcuInstr);
hal.enableMCULoadCalculation(true);
}
}
Now the problem is touch gfx is not taking this configuration in. I can see no image is coming up. I am not understanding what mistake I am doing.
Any help is highly appreciated.
Thanks,
Krishna
