cancel
Showing results for 
Search instead for 
Did you mean: 

Where can I define the initial value for USE_SD_TRANSCEIVER (needed for SD Card / STM32H743)?

GS1
Senior III

USE_SD_TRANSCEIVER is set to 1U by default when generating code for STM32H743. But I need it to be 0. I have to manually edit the "stm32h7xx_hal_conf.h" file every time after generating code and reset the flag to 0, which is annoying! I checked almost every setup page but I could not find where to set this flag.

I use current version 5.0.1 of STM32CubeMX.

Thank you for any hint!

6 REPLIES 6
Noppe.Jack
Senior

Hi,

If you create a file called ".extSettings" in the same directory of your "xxxxx.ioc" file, you can give CubeMX additional instructions (there is a whole section about it in the user guide, although I wish the documentation was a bit more comprehensive ... lol)

Add something like this in there ....

[Others]
Define = USE_SD_TRANSCEIVER
HALModule = <name of the module, so that library files can be added to your project>

Thank you for the information!

I checked the manual and tried this, but it doesn't work. It seems that the Define items simply do something like this:

#define USE_SD_TRANSCEIVER

but I need to give it a value:

#define USE_SD_TRANSCEIVER 0

So the problem is not yet solved. But thanks anyway, it was worth a try.

Hmmm ... I see what you mean. It would be nice if that stm32h7xx_hal_conf.h file had a couple of USER_CODE sections in it, like the other files generated by CubeMX.

WBOUG
Senior

Hi @GS@S​ 

Following the analysis of your ticket I regret to inform you that CubeMX does not support the parameter USE_SD_TRANSCEIVER is not configurable but you can overcome your problem through the code generated by CubeMX.

On the other hand you said that you have change the USE_SD_TRANSCEIVER in the file stm32h7xx_hal_conf.h and it's the right configuration, just change the line

#define USE_SD_TRANSCEIVER 1U => #define USE_SD_TRANSCEIVER 0U 

and it will work absolutely.

I will always be at your service at all times

Best Regards,

Wael

GS1
Senior III

Hi Wael,

thats correct. I can change the setting to 0U manually. However, this manual change has to be done every time after "Generate code" is pressed.

As we are still on the development side of the board and configurations are not finally selected for all peripherals, "Generate Code" will for sure be necessary in the near future several times. I now have to take care that I don't forget to reset this manual configuration every time I generate code again.

In case Cube would not touch my re-definition, this would be ok, but it automatically generates the define with 1U every time when code is generated. Thats the point.

Best regards

Gaby

Hi @GS@S​ 

With manual configuration you can overcome your problem

Maybe it will be solved in future versions of the CubeMX.

Best Regards,

Wael