cancel
Showing results for 
Search instead for 
Did you mean: 

What's the right implementation of TouchGFX resources on external QSPI memory?

MPast.1
Senior II

Hi all,

I would like to store all graphics resources on my external QSPI memory.

I have an STM32H743VIT6 and I use TouchGFX 4.16.

if I didn't understang wrong I modified my project following these steps:

  1. on TouchGFX projects, all image properties ( Section and Extra Sections) are converted to "ExtFlashSession")
  2. I realized an Custom Loader to be used on debugger (to store graphic contentens on external QSPI Memory)
  3. On my project I added to the linker the sections:
MEMORY
{
.......
  QUADSPI   (rx)     : ORIGIN =  0x90000000,   LENGTH = 8M
}

and

ExtFlashSection :
	{
	*(ExtFlashSection ExtFlashSection.*)
	*(.gnu.linkonce.r.*)
    . = ALIGN(0x4);
	} >QUADSPI
 
 FontFlashSection :
	{
	*(FontFlashSection FontFlashSection.*)
	*(.gnu.linkonce.r.*)
    . = ALIGN(0x4);
	} >QUADSPI
 
TextFlashSection :
	{
	*(TextFlashSection TextFlashSection.*)
	*(.gnu.linkonce.r.*)
    . = ALIGN(0x4);
	} >QUADSPI
  1. I inserted Routine to Init and access to external QSPI memory

Application crash inside void touchgfx::Texts::setLanguage(touchgfx::LanguageId id)

on "currentLanguageTypedText = typedTextDatabaseArray[id];".

Does some has any idea?

1 ACCEPTED SOLUTION

Accepted Solutions
MPast.1
Senior II

HI Tesla,

I checked the MAP file to be sure that all resource was present. They was Ok. All of them was on the right place and address.

I have a memory reader to check the memory content.

I just found the problem:

QSPI_EnableMemoryMappedMode();

must be called before MX_TouchGFX_Init(); and not after else a system Error is generated.

I was a stupid BUG!

View solution in original post

7 REPLIES 7

GNU/TOUCHGFX aren't really my thing, but generally here you can establish what the Linker has generated by looking at the .MAP and inspecting the .ELF.

The Linker Script basically establishes available memory, and the order and placement of data within in it.

Come to a determination if it has done its job properly or as expected.

Then focus on the startup.s code and what's actually "crashing" the system. Step one is to have a very effective Hard Fault Handler that outputs diagnostic information so you know why and where the system went off the rails. If it's not that sort of "crash" you'll need to establish in the debugger where exactly it got too, and if it's in some unhelpful while(1) loop of death. If you touch the QSPI space, or the BSP is broken, the system will Hard Fault, watch that the initialization of the QSPI is done early, SystemInit() being the ARM/CMSIS expectation, and prior to use.

External loader are one of my things, and I can build those as a service, and can run an assortment of Micron, Macronix and Winbond parts off H7's. For those you need to establish parts and pins involved.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
MPast.1
Senior II

HI Tesla,

I checked the MAP file to be sure that all resource was present. They was Ok. All of them was on the right place and address.

I have a memory reader to check the memory content.

I just found the problem:

QSPI_EnableMemoryMappedMode();

must be called before MX_TouchGFX_Init(); and not after else a system Error is generated.

I was a stupid BUG!

No problem, also for C++ heavy stuff watch what the constructors get up too.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
PPres
Associate II

Sorry if I use the same topic, but I think to have a similar issue of above.

First of all I did a lot of difficulties with the setting up of the quadspi, because during debug it seems instable, and sometimes the content (on Cubeide memory browser) disappears when pause the debugger. ( so my problem can be related to the quadspi configuration)

If this is the case can You point me to a guide for the correct configuration of the quadspi? ( is a N25Q128A mounted on a custom board )

Anyway, the most of trying the quadspi is correctly mapped, the memory browser show all the data as espected,

I did made a simple project with the Designer (v. 4.16.0), just an image and a text. no animations, no button, no trigger, nothing.

it's im possible to show the content due to memory unaligned trap, every time the library try to load a text from the quadspi.

If I move the text and the fonts to the internal flash all goes well, but it should be possible to put all the external contets into the quadspi as far as I know.

I try differents combination in MPU settings to try to let the quadspi functioning as NON device memory region, but the problem persists.

I'm sure of the quadspi content because I load all content with an external loader via CubeProgrammer ( verifying the upload) , I can read the data and appears correct just after the memory mapped mode setup.

I can show on display the image even if compiled into the FLASH region or into quadspy without the touchgfx library by simply config the image address into the LTDC settings: pLayerCfg.FBStartAdress = &test_image;

But every time I try to put some text into the ptoject the rendering fails and the llibrary stops to call the Model::tick() or fall into an hardfault handler due to unaligned memory access.

If I don't understand wrong, the access to the text area is byte aligned, so how can grant that the quadspi region is readable correctly?.

How can I debug that behaviour?

Are there some guidelines about quadspi configuring and use?

Due to the rtos debug dififcult, can I try to use the touchgfx library on bare metal board without rtos active? What do you think about?

Thanks.

Paolo

With Hard Faults is important to understand the registers and code at the fault so the actual cause can be identified and remediated.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
PPres
Associate II

Yes. I understand​.

The fault panel of C​ubeide te lo me that the fault is an unaligned access.​

Due t​o the fact that if all graphics and text material was on flash the problem doesn't happens, but if I move all the content on quadspi an unaligned access is fired.

The error is always insise the code in charge to loads the text on the main screen.

I did analyzed other projects made on a Disco boards and obviously that doesn't happens.

I'm in stuck since 2 weeks, and at beginning of the project. I'm seriously thinking to use other graphics library.

Today I try to move backwards on the stack to reconstruct the call functions but I already know where the error is fired. And is inside a library function of touchgfx (and obviously there is no source there).

I read about a c​ombination on 7+qspi+mpu issue, can be my case?

Are there good practice to configure the Mpu?

Thanks​

franck23
Senior

Hi PPres,

Here is the guide I used to test the QSPI on an H743:

https://support.touchgfx.com/docs/development/board-bring-up/how-to/06-flash-external-addressable

You said that the QSPI was unstable during debug?

Just a wild guess, but maybe you have a hardware issue or the QSPI clock setting is too high for your custom board?

You could check the QSPI Vcc with a scope to see if there is any drop and also see if the QSPI clock signal is clean.

Good luck.