2021-01-11 06:04 AM
In my CubeIDE 1.5.1 project I have proprietary custom defined symbols that deleted every time I generate the code from IOC.
How can I protect them from being removed?
Solved! Go to Solution.
2021-01-11 10:37 AM
MBEDTLS_CONFIG_FILE="mbedtls_config.h" is device configuration tool (aka. STM32CubeMX) reserved. Such symbol is introduce by tool if selecting MBEDTLS middleware.
Such is reserved because required if such middleware set and has to be removed if unset.
Hopefully if doing custom setup out of device configuration tool you have a way to force it being preseved. See https://www.st.com/resource/en/user_manual/dm00104712-stm32cubemx-for-stm32-configuration-and-initialization-c-code-generation-stmicroelectronics.pdf
You have to add a .extSettings file at your project root.
Content of such file is in your case:
[Others]
Define = MBEDTLS_CONFIG_FILE:"mbedtls_config.h"
Please note ':' char is not a typo ... you will see such is set to '=' if build settings on the fly
2021-01-11 09:51 AM
Works for me.
Please could you share which symbol you're adding (one being removed by code update process). Some are device configuration tool reserved ... maybe part of.
2021-01-11 10:08 AM
The strange thing is that it not happened every time I generate and when it happened it effect only this define:
MBEDTLS_CONFIG_FILE="mbedtls_config.h"
While there is at lease another define that is also custom, so from this list:
USE_HAL_DRIVER
STM32H743xx
DEBUG
MBEDTLS_CONFIG_FILE="mbedtls_config.h"
CONFIG_MEDTLS_USE_MEMORY
I left with this after generating:
USE_HAL_DRIVER
STM32H743xx
DEBUG
CONFIG_MEDTLS_USE_MEMORY
2021-01-11 10:37 AM
MBEDTLS_CONFIG_FILE="mbedtls_config.h" is device configuration tool (aka. STM32CubeMX) reserved. Such symbol is introduce by tool if selecting MBEDTLS middleware.
Such is reserved because required if such middleware set and has to be removed if unset.
Hopefully if doing custom setup out of device configuration tool you have a way to force it being preseved. See https://www.st.com/resource/en/user_manual/dm00104712-stm32cubemx-for-stm32-configuration-and-initialization-c-code-generation-stmicroelectronics.pdf
You have to add a .extSettings file at your project root.
Content of such file is in your case:
[Others]
Define = MBEDTLS_CONFIG_FILE:"mbedtls_config.h"
Please note ':' char is not a typo ... you will see such is set to '=' if build settings on the fly
2021-01-11 12:35 PM
Thank you! Very helpful to me