2025-06-28 5:39 AM
I am using TouchGFX to design GUI, and I want to use a dynamic bitmap to show an image captured by the camera. The camera is about 600*480 size. But I set the CacheAddress as following, and It turns out that the GUI cannot run properly. Is there any problem with it?
uint16_t* const cacheStartAddr = (uint16_t *)0xC0008000;
const uint32_t cacheSize_own = 0x100000; //1 MB, as example
Bitmap::setCache(cacheStartAddr, cacheSize_own, 1);
2025-06-30 3:50 AM
Hello @Z-YF ,
Are you able to make your project work without the dynamic bitmap first?
What is the exact format of the camera's output?
What do you mean by "the GUI cannot run properly", what is happening exactly?
Please read this article to use dynamic bitmap : https://support.touchgfx.com/docs/development/ui-development/touchgfx-engine-features/dynamic-bitmaps
Regards,
2025-06-30 3:53 AM
You know, my main concern is where I can allocate the bitmap cache. Because there is no SDRAM on the N6-DK board.
2025-06-30 5:28 AM
The STM32N6570-dk has 4.2 Mbytes of contiguous SRAM, could you place the bitmap cache there?
Regards,
2025-06-30 5:32 AM
I tried, but it failed. I set the start address as 0x34000000, the touchgfx can actually run, but it just cannot show the dynamic bitmap. And if I set a new screen to display this bitmap, I cannot skip to the bitmap screen, but I can show the main screen and the starting one.
2025-07-02 4:15 AM
Hello @Z-YF ,
It seems that the chip can indeed have SDRAM at 0xC000 0000 but the DK board itself doesn't have SDRAM connected at that address.
Instead, you should use the PSRAM on XPSI1 located at 0x9000 0000.
Regards,
2025-07-30 11:29 PM
Hello @Z-YF.
The TBS for STM32N6570-DK available in TouchGFX Designer is configured to support a bitmap cache next to the framebuffers in internal SRAM.
TouchGFX Demo 7 uses dynamic bitmaps in the video and text demo. You can try importing TouchGFX Demo 7 to see how it is used. The bitmap cache setup is done in FrontendApplication.cpp and looks like this:
#include <gui/common/FrontendApplication.hpp>
#if !defined(NO_BITMAP_CACHE)
LOCATION_PRAGMA_NOLOAD("TouchGFX_Framebuffer")
uint16_t bitmapCacheBuffer[800 * 480 + 800] LOCATION_ATTRIBUTE_NOLOAD("TouchGFX_Framebuffer");
#endif
FrontendApplication::FrontendApplication(Model& m, FrontendHeap& heap)
: FrontendApplicationBase(m, heap)
{
HAL::getInstance()->setFrameRateCompensation(true);
#if !defined(NO_BITMAP_CACHE)
Bitmap::setCache(bitmapCacheBuffer, sizeof(bitmapCacheBuffer), 10);
#endif
}
You can, of course, also use the PSRAM available on the STM32N6570-DK for the bitmap cache. However, make sure to configure the MPU correctly for this memory region then. You can use the MPU configuration for the framebuffer region as reference.
Best regards,
Johan