Skip to main content
Dd.21
Associate III
April 6, 2021
Question

after using serial flash for fonts, the code jump to hardfault handler.

  • April 6, 2021
  • 7 replies
  • 2535 views

I want to put my font data into external flash from internal flash. So, I configure and implement my code following docs of touchgfx-4.16.

​https://support.touchgfx.com/docs/development/scenarios/using-serial-flash

There are some source codes;

static FontFlashReader fontReader;
 
static STM32TouchController tc;
//static STM32L4DMA dma;
static NoDMA dma;
//static LCD24bpp display;
static LCD16bppSerialFlash display(fontReader);
static ApplicationFontProvider fontProvider;
static Texts texts;
static TouchGFXHAL hal(dma, display, tc, 320, 360);
 
static WatchButtonController buttonController;
 
void touchgfx_init()
{
 Bitmap::registerBitmapDatabase(BitmapDatabase::getInstance(), BitmapDatabase::getInstanceSize());
 TypedText::registerTexts(&texts);
 Texts::setLanguage(0);
 
 hal.setDataReader(&fontReader);
 fontProvider.setFlashReader(&fontReader);
 FontManager::setFontProvider(&fontProvider);
 
 FrontendHeap& heap = FrontendHeap::getInstance();
 /*
 * we need to obtain the reference above to initialize the frontend heap.
 */
 (void)heap;
 
 /*
 * Initialize TouchGFX
 */
 hal.initialize();
 hal.setButtonController(&buttonController);
}

It is fine to get font data from external flash.

But, there always be a hard-fault when LCD drawing Text.

debug info

0693W000008yj2YQAQ.png

This topic has been closed for replies.

7 replies

RGenn.1
Associate
April 6, 2021

I have the same problem in IAR IDE.

In your project the image in the external flash work fine? Only one image without the text and font in the project.

In my project the images in external flash has no problem.

Dd.21
Dd.21Author
Associate III
April 6, 2021

Same problem.​

Is there anything else that needs to be configured, in addition to the code listed above.

Dd.21
Dd.21Author
Associate III
April 6, 2021

Thanks! If I find any solutions or differences, I will upload my letter in time.

RGenn.1
Associate
April 6, 2021

thanks

RGenn.1
Associate
April 16, 2021

Any news?

Dd.21
Dd.21Author
Associate III
April 17, 2021
Sorry, there is still a problem