Skip to main content
Kevin(Dr.Electron)
Associate III
April 22, 2020
Solved

Tutorial for CubeIDE with QuadSPI

  • April 22, 2020
  • 10 replies
  • 4138 views

I found out today that my project was not properly configured. So i did run out of flash memory.

By comparing with a Designer project I found out how to change the FLASH.ld file to use QuadSPI and some other things that were different in the Designer project regarding QuadSPI.

But my program crashes again and again in the function

void touchgfx::Texts::setLanguage(touchgfx::LanguageId id).

Is there something like a tutorial on how to configure TouchGFX + QuadSPI in CubeIDE?

Regards,

Kevin

This topic has been closed for replies.
Best answer by chaaalyy

In this video you can find a cutom board method for setting up tGFX on the f746 disco:

https://www.youtube.com/watch?v=o42r4xXOnbo&t=90s

There´s also another channel available with useful tutorials:

https://www.youtube.com/channel/UCPc2YUw_rpxWJLc4PFwSZag

And never forget to set the external loader, when it comes to flashing / debugging ;) Otherwise, qspi flash isn´t accessable via stlink ...

10 replies

Romain DIELEMAN
ST Employee
April 23, 2020

Could you give more details on your HW settings (i suppose you are using a custom board)? Could you share your flash.ld file to have a look?

Kevin(Dr.Electron)
Associate III
April 23, 2020

Thanks for your help.

I'm using a STM32F7-Discovery.

I uploaded the Flash.ld file as .txt

Tesla DeLorean
Guru
April 23, 2020

Have your Hard Fault Handler output actionable data.

Make sure the QSPI memory is properly initialized before touching it. Perhaps have the code dump some of the content.

Check clocks and content.

Check the .MAP output matches expectations created by the .LD file.

Refine "crashes" to some more specific mode of failure.​

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Kevin(Dr.Electron)
Associate III
April 23, 2020

Hi and thanks for your answear. I only started programming microcontrollers again after I learned the basics in school a few years ago.

So how do i let my Hard Fault Handler output actionable data?

Shouldn't CubeMX initialize the memory? I think i should read some more about QSPI.

.Map seems to be fine.

First my program always crashed on this line in setLanguage()

currentLanguageTypedText = typedTextDatabaseArray[id];

and jumped in the HardFaultHandler.

Now it only breaks on the begining of setLanguage, without a error visible.

Tesla DeLorean
Guru
April 23, 2020

>>Now it only breaks on the beginning of setLanguage, without a error visible.

Breaks how exactly? Hard to guess at this, where is the CPU stuck if you stop it in the debugger? Same place all the time? Same register values?

>>currentLanguageTypedText = typedTextDatabaseArray[id];

Ok, but that provides me with no context. What are the addresses and indexes here?

Look at the disassembly, look at the processor registers. The C code itself is not that instructive.

If the array is in QSPI, dollars to doughnuts you haven't initialized the clocks, pins and interface properly.

>>So how do i let my Hard Fault Handler output actionable data?

Well not with a while(1) loop, try something that unpacks the processor state. Have a debug UART working, or the SWV debug communications channel via PB0 / SWO pin

https://community.st.com/s/question/0D50X0000BxwhEhSQI/my-stm32h743vi-application-runs-to-a-debug-instruction-in-the-startup-code

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Martin KJELDSEN
Principal III
April 24, 2020

Your texts are probably in External Flash. Be sure that you're initializing it, and that it is addressable, before TouchGFX starts and attempts to initialize texts. CubeMX might have jumpled the init order.

MX_QSPI_Init();
MX_TouchGFX_Init();

 /Martin

Kevin(Dr.Electron)
Associate III
April 24, 2020

Init order is right. I tried to copy code from TouchGFX Demo 1. And i don't find a difference. I copied the Flash.ld file, added the user code in the QSPI_Init()

/* USER CODE BEGIN QUADSPI_Init 2 */
 BSP_QSPI_Init();
 
 BSP_QSPI_MemoryMappedMode();
 HAL_NVIC_DisableIRQ(QUADSPI_IRQn);
 
 /* USER CODE END QUADSPI_Init 2 */

and checked clock settings.

chaaalyy
chaaalyyBest answer
Senior II
April 24, 2020

In this video you can find a cutom board method for setting up tGFX on the f746 disco:

https://www.youtube.com/watch?v=o42r4xXOnbo&t=90s

There´s also another channel available with useful tutorials:

https://www.youtube.com/channel/UCPc2YUw_rpxWJLc4PFwSZag

And never forget to set the external loader, when it comes to flashing / debugging ;) Otherwise, qspi flash isn´t accessable via stlink ...

Kevin(Dr.Electron)
Associate III
April 26, 2020

Yeah, I’m stupid. I totally forgot to configure the external loader :)

Thanks to all.