Skip to main content
RAltm
Senior
April 12, 2021
Solved

Is it possible to use CubeMX constants/parameters within CubeMX itself?

  • April 12, 2021
  • 2 replies
  • 1165 views

Hello,

I wonder if it's possible to use the CubeMX user parameters or generated constants within CubeMX itself.

For example, the FMC configuration allows to calculate the origin and size of a given memory, let's say SDRAM. The LTDC configuration needs the address of the frame buffer(s). Now, it would be great if the FMC values can be used within the LTDC configuration to set the frame buffer to e.g. the beginning of the SDRAM.

If it's not possible to use the values directly, can it be achieved by user constants? For example, defining a user constant in FMC which uses/collects the generated FMC values, and passing the user constant to the LTDC configuration?

This would enable having some kind of automatic configuration between multiple peripherals - you only have to set the corresponding symbols instead of absolute values which might change between projects.

Regards

This topic has been closed for replies.
Best answer by Khouloud ZEMMELI

Hello @RAltm​ ,

Thanks for your post,

Actually, it's possible to create user constants for both FMC and LTDC by assigning for each constant a value (as mentioned in the image below), then they will be generated in your project.

You can manipulate these constants later according to your need in the code, but there's no option in CubeMX that connect user constant to other IPs.

0693W00000ALzj4QAD.png 

Hope my answer helped you :) if your question was answered, please close this topic by choose Select as best, this will help other users find the answer faster.

Thanks for your contribution, Khouloud

2 replies

Khouloud ZEMMELI
Khouloud ZEMMELIBest answer
ST Employee
April 20, 2021

Hello @RAltm​ ,

Thanks for your post,

Actually, it's possible to create user constants for both FMC and LTDC by assigning for each constant a value (as mentioned in the image below), then they will be generated in your project.

You can manipulate these constants later according to your need in the code, but there's no option in CubeMX that connect user constant to other IPs.

0693W00000ALzj4QAD.png 

Hope my answer helped you :) if your question was answered, please close this topic by choose Select as best, this will help other users find the answer faster.

Thanks for your contribution, Khouloud

RAltm
RAltmAuthor
Senior
April 20, 2021

Hello Khouloud,

thank you for explanation. So, it seems it's not possible to even use the configuration values within the constants. Maybe you want to discuss this with the CubeMX team.

Regards