Skip to main content
Associate II
April 12, 2025
Solved

Why does TouchGFX program need to be manually run in Keil ?

  • April 12, 2025
  • 5 replies
  • 1560 views

Hi everyone, after I've configured TouchGFX, the program needs to be manually run in Keil's debug environment to execute. Why is that?

My ICNA3306_DrawBlock data transfer did not use DMA.

 

weixun_0-1744464547350.pngweixun_1-1744464566815.pngweixun_2-1744464581182.pngweixun_3-1744464593753.png

 

Best answer by weixun

I found the problem — the TouchGFX project generated by CubeMX doesn't run when targeting Keil, but it works if it's generated as an STM32CubeIDE project.

5 replies

Andrew Neil
Super User
April 14, 2025

Welcome to the forum.

For best results, please see: How to write your question to maximize your chances to find a solution;

And, in particular: How to insert source code.

 


@weixun wrote:

the program needs to be manually run in Keil's debug environment to execute.


Not sure what you mean by that?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
weixunAuthor
Associate II
April 14, 2025

Hi Andrew Neil, this means 'I need to start a debug session ('Start/Stop Debug Session') and click 'Step' or 'Step Out' to get it running.Sorry, my English isn't very good, so I used a translator.

GaetanGodart
Technical Moderator
April 14, 2025

Hello @weixun ,

 

If you cannot "flash" your program through Keil but you are able to debug it through Keil, try to flash it using STM32CubeProgrammer.

 

Regards,

weixunAuthor
Associate II
April 14, 2025

Hi GaetanGodart, thanks for your reply. I am able to flash the chip using Keil. The problem is that the program doesn't run automatically after flashing. I need to start a debug session ('Start/Stop Debug Session') and click 'Step' or 'Step Out' to get it running. I've observed that after stepping out several times, the ICNA3306_Init function is called, but then the execution gets permanently stuck right here:

if (OSWrappers::isVSyncAvailable())
{
 hal.backPorchExited();
}
Is it that I didn't write my OSWrappers::signalVsync correctly?
weixun_0-1744638126362.pngweixun_1-1744638130091.png

 

Andrew Neil
Super User
April 14, 2025

@weixun wrote:

I am able to flash the chip using Keil. The problem is that the program doesn't run automatically after flashing.


I think you have to configure  that?

Maybe in the Debug settings - configure it to do a download at the start of a session?

Have you got it to work with a simple "Blinky" project?

For questions specifically about the Keil tools, probably best to ask in Keil's own forum:

https://community.arm.com/support-forums/f/keil-forum/

 

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
weixunAuthor
Associate II
April 14, 2025

I have already uploaded the code to https://github.com/weixuna/touchgfx_amoled_

Tesla DeLorean
Guru
April 15, 2025

For custom hardware, I might look at the initial state of the BOOT0 pin, and that the Vector Table is correctly initialized.

Check VCAP capacitances and voltages.

When debugging the debugger may initializes GPIO and clocks to suit it's needs, whereas booting directly will not. Watch also that timings can be a little different with the debugger involved, so if stuck in while() loops identify what's being waited on, or if they exit early. Use volatile variables where appropriate.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
weixunAuthorBest answer
Associate II
April 16, 2025

I found the problem — the TouchGFX project generated by CubeMX doesn't run when targeting Keil, but it works if it's generated as an STM32CubeIDE project.

GaetanGodart
Technical Moderator
April 23, 2025

Hello @weixun ,

 

Are you able to do what you want in the end?

 

The initial problem seemed to be that the code had to be run in debug mode on Keil but it built fine which is odd.

If now it works fine in STM32CubeIDE, maybe the Keil configuration is wrong at some point.

Is it fine if you only use STM32CubeIDE?

 

Regards,

weixunAuthor
Associate II
April 23, 2025

Hello Gaetan Godart,

I am now using CubeIDE to develop my project. I tried to figure out what was wrong with the Keil settings, but I couldn't find the issue, so I decided not to use Keil. Lastly, thank you very much for your response and assistance.