cancel
Showing results for 
Search instead for 
Did you mean: 

Debug Issue with STM32H7B3I-DK and TouchGFX 4.24.2 in STM32CubeIDE 1.17.0

mArSat
Visitor


Issue Description


I am experiencing a debugging issue with a project generated using TouchGFX Designer 4.24.2 for STM32H7B3I-DK, running on STM32CubeIDE 1.17.0. When I attempt to start debugging, I get the following error:

 

 

 

Failed to execute MI command:
load C:\TouchGFXProjects\Test01\STM32CubeIDE\Debug\STM32CubeIDE.elf
Error message from debugger back end: Load failed

 

 

 

Tests Performed

  1. Project generated with TouchGFX 4.24: If I generate the project from TouchGFX and try to debug, I get the error mentioned above.
    The firmware loads correctly when flashed (.hex) manually via STM32CubeProgrammer, but the graphics appear corrupted.
  2. Empty STM32CubeIDE Project (No TouchGFX): If I create a new empty project for the STM32H7B3I-DK in STM32CubeIDE 1.17.0, the debugger works without any issues.


Flashing and debugging function properly.

Observations

  1. The issue seems specific to projects generated using TouchGFX 4.24.2
  2. There might be a problem with memory configuration, linker scripts, or how TouchGFX handles the flash.

Questions

  • Has anyone experienced a similar issue with TouchGFX projects?
  • Are there specific settings required in STM32CubeIDE to properly debug a TouchGFX project on STM32H7B3I-DK?
  • Could this be related to flash memory configuration in linker scripts?

 

Any help or suggestions would be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
mArSat
Visitor

# Issue Resolved: Debugging & Graphical Corruption in TouchGFX with STM32H7B3I-DK

I encountered an issue when debugging a TouchGFX project for the **STM32H7B3I-DK** using **STM32CubeIDE 1.17.0** and **TouchGFX Designer 4.24.2**. Initially, when launching the project from **TouchGFX Designer**, the debugger failed to load the `.elf` file, and when flashing the `.hex`, the application would run, but the **graphics were corrupted**.

---

## Solution

### 1. Modify the Linker File (`STM32H7B3LIHXQ_FLASH.ld`)
- I changed the memory sections for:
- `FontFlashSection`
- `TextFlashSection`

- These were originally set to `OSPI`, and I changed them to `FLASH`.
- This ensures that assets are stored in the **internal flash** instead of external **OSPI** memory.

### 2. Update TouchGFX Designer Settings
- Previously, in **Default Image Configuration**, the **Section** and **Extra Section** were set to `ExtFlashSection`.
- I changed both to `IntFlashSection`.

---

## Results
- Debugging now works properly in STM32CubeIDE.
- The graphical corruption issue is completely resolved.
- The application runs as expected on the STM32H7B3I-DK.

---

## Recommendations
If anyone else encounters similar issues, I recommend:
- Checking the **memory mappings** in the linker script.
- Ensuring **TouchGFX assets** are stored in the correct flash memory.

Hope this helps!

View solution in original post

1 REPLY 1
mArSat
Visitor

# Issue Resolved: Debugging & Graphical Corruption in TouchGFX with STM32H7B3I-DK

I encountered an issue when debugging a TouchGFX project for the **STM32H7B3I-DK** using **STM32CubeIDE 1.17.0** and **TouchGFX Designer 4.24.2**. Initially, when launching the project from **TouchGFX Designer**, the debugger failed to load the `.elf` file, and when flashing the `.hex`, the application would run, but the **graphics were corrupted**.

---

## Solution

### 1. Modify the Linker File (`STM32H7B3LIHXQ_FLASH.ld`)
- I changed the memory sections for:
- `FontFlashSection`
- `TextFlashSection`

- These were originally set to `OSPI`, and I changed them to `FLASH`.
- This ensures that assets are stored in the **internal flash** instead of external **OSPI** memory.

### 2. Update TouchGFX Designer Settings
- Previously, in **Default Image Configuration**, the **Section** and **Extra Section** were set to `ExtFlashSection`.
- I changed both to `IntFlashSection`.

---

## Results
- Debugging now works properly in STM32CubeIDE.
- The graphical corruption issue is completely resolved.
- The application runs as expected on the STM32H7B3I-DK.

---

## Recommendations
If anyone else encounters similar issues, I recommend:
- Checking the **memory mappings** in the linker script.
- Ensuring **TouchGFX assets** are stored in the correct flash memory.

Hope this helps!