cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U5: Build error with TouchGFX: jpeg_utils.h: No such file or directory

clemens
Associate II

Hello,

we previously used the STM32U5G9J-DK2 discovery kit with FreeRTOS and TouchGFX (with hardware-accelerated Vector Font Rendering, etc) successfully.

Now we are trying to bring up a custom STM32U5G7VJ based board. We first created the ioc File with CubeMX, configured all the pins and later on enabled FreeRTOS and TouchGFX middlewares. As far as possible, the settings from the discovery board were replicated (except we now use RGB888 instead of RGB565 and a few different LTDC and OCTOSPI settings)

After opening the project template in the TouchGFX editor, a hello world screen was added.

However, when building in STM32CubeIDE, the following error occurs in TouchGFX/target/generated/HardwareMJPEGDecoder.cpp: fatal error: jpeg_utils.h: No such file or directory

When I compared the HardwareMJPEGDecoder.cpp file between the discovery kit project and our own, I noticed it's different: The one from the discovery kit is around 5 KB larger and it has no #include <jpeg_utils.h> line.

Any ideas why this file is generated differently, even though the CubeMX configurations match (except for the details above) ?

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
JohanAstrup
ST Employee

Hello @clemens, sorry for the late reply.

jpeg_utils.h with hardware decoded video is only used for STM32F7. Unfortunately, we currently only check if the subfamily contains "F7" in TouchGFX Generator, which causes the mistakenly include for STM32U5F7 as well.
We will fix this bug in the next TouchGFX release, but since we just released version 4.25.0, the next release is not imminent.

In the meantime, there is the following workaround:

  1. Navigate to where your STM32CubeMX packs are installed. This is usually at C:\Users\YOUR_USER\STM32Cube\Repository\Packs\STMicroelectronics\X-CUBE-TOUCHGFX\.
  2. Open the folder corresponding to the TouchGFX version you are using.
  3. Open the STM32CubeMX\templates folder.
  4. Perform a search-and-replace operation where you replace all occurrences of [#if mcuSubFamily.contains("F7")] with [#if mcuSubFamily.contains("STM32F7")].
  5. This replacement should be made in the following files:
    - TouchGFXGeneratedHAL_cpp.ftl
    - TouchGFXGeneratedHAL_hpp.ftl
    - STM32DMA_cpp.ft1
    - STM32DMA_hpp.ftl
    - HardwareMJPEGDecoder_cpp.ftl
    - HardwareMJPEGDecoder_hpp.ftl

I have attached a modified STM32CubeMX folder that includes the bug fix. You should replace C:\Users\YOUR_USER\STM32Cube\Repository\Packs\STMicroelectronics\X-CUBE-TOUCHGFX\4.25.0\STM32CubeMX with this. However, this fix is only for TouchGFX 4.25. If you are using a different TouchGFX version, you will need to implement the bug fix yourself.
Please let me know if you encounter any issues with this workaround. If necessary, I can implement the bug fix for other versions as well.

Best regards,
Johan

View solution in original post

2 REPLIES 2
clemens
Associate II

I got a litte bit more information:

If I set the Video Encoding Type from Hardware to Disabled in the TouchGFX parameters in CubeMX and regenerate the project, it compiles successfully.

However, as we plan to use MJPEG encoded videos in our project, this is not a viable solution..

 

Diffing the working discovery board project with our new project shows the following differences:

FreeRTOS 10.4.6 -> 10.6.2

TouchGFX 4.24.0 -> 4.24.2

JPEG_RGB_FORMAT JPEG_RGB565 -> JPEG_RGB888

 

I don't understand why the include to the non-existing jpeg_utils.h is added for our new project and not for the discovery board.

JohanAstrup
ST Employee

Hello @clemens, sorry for the late reply.

jpeg_utils.h with hardware decoded video is only used for STM32F7. Unfortunately, we currently only check if the subfamily contains "F7" in TouchGFX Generator, which causes the mistakenly include for STM32U5F7 as well.
We will fix this bug in the next TouchGFX release, but since we just released version 4.25.0, the next release is not imminent.

In the meantime, there is the following workaround:

  1. Navigate to where your STM32CubeMX packs are installed. This is usually at C:\Users\YOUR_USER\STM32Cube\Repository\Packs\STMicroelectronics\X-CUBE-TOUCHGFX\.
  2. Open the folder corresponding to the TouchGFX version you are using.
  3. Open the STM32CubeMX\templates folder.
  4. Perform a search-and-replace operation where you replace all occurrences of [#if mcuSubFamily.contains("F7")] with [#if mcuSubFamily.contains("STM32F7")].
  5. This replacement should be made in the following files:
    - TouchGFXGeneratedHAL_cpp.ftl
    - TouchGFXGeneratedHAL_hpp.ftl
    - STM32DMA_cpp.ft1
    - STM32DMA_hpp.ftl
    - HardwareMJPEGDecoder_cpp.ftl
    - HardwareMJPEGDecoder_hpp.ftl

I have attached a modified STM32CubeMX folder that includes the bug fix. You should replace C:\Users\YOUR_USER\STM32Cube\Repository\Packs\STMicroelectronics\X-CUBE-TOUCHGFX\4.25.0\STM32CubeMX with this. However, this fix is only for TouchGFX 4.25. If you are using a different TouchGFX version, you will need to implement the bug fix yourself.
Please let me know if you encounter any issues with this workaround. If necessary, I can implement the bug fix for other versions as well.

Best regards,
Johan