2023-12-07 02:10 AM
Hello everyone,
I'm currently involved in a project and I'm aiming to analyze the peripheral initialization parameters of a specific target by examining the .ioc file. I parsing through the ioc file like a text file. While the .ioc file contains details of the modified parameters, it doesn't include the default values. Given that these values are updated within the STMCUBEMX UI, I suspect that there might be a file within the installation directory that stores this information. Could someone kindly direct me to the specific file that contains these default values?
Thank you.
2024-01-05 05:56 AM
Hello. ST unfortunately does not share details about the inner working of our tools, such as this information.
2024-01-05 11:07 AM
@ADani this is very easy. Start a new project in Cube for your board. When it prompts to initialize all pins to defaults, answer yes. Save. Now you have .ioc with all defaults.
2024-01-06 01:36 AM
@Pavel A.What you say is true but I don't think it is the idea in that case, as the poster does not talk about board...
@ADaniI understand you want to get all default values of parameters (then, of hardware registers) even those which are not configured, right ? I already needed that information in the past for in-depth debugging and it is neither complicated nor secret ! It only takes a few minutes to understand how to find out.
Let's take an example : imagine the MCU used is STM32F401CCF6TR, then you have to search in the install directory: ~/STM32CubeMX/db/mcu for the file STM32F401CCFx.xml (note that the "x" is used as a wildcard).
Then imagine you want default values of ADC peripheral, then you have to search in this file for the line <IP InstanceName="ADC1" Name="ADC" Version="aditf2_v1_1_Cube">
Now you know the version, search for a filename containing this version in sub-directory ~/STM32CubeMX/db/mcu/IP: you get the file ADC-aditf2_v1_1_Cube_Modes.xml
What you search for is all in this file: each parameter value has a DefaultValue field set to the litteral name which is visible in the configuration UI. All you need to do then is to convert it to numeric value thanks to Programming Manual and/or Datasheet.