STM32CubeIde Configuration tool IOC files - Page 1
Forum section: electronics / general

author: luiHS
author_rank: Frequent Contributor
timestamp: December 22, 2021, 02:58:43 pm
content: HiIm working with some of the source code samples available with STM32CubeIde. The thing is, I need to add several new GPIO and a UART port to the project.What I see is that if I create a new project an IOC file is created and in the Configuration Device Tool tab we can access the device configuration in which several tabs are shown that allow a quick and simple configuration (Pinout & Configuration, Clock Configuration, Project Manager and Tools).However, in the ST sample sources, there is no IOC file and I cannot access that type of configuration that would be much more comfortable and simple. Then we would have to write all the source code by hand, if we want to add new ports to the example source.Is there a way to access this kind of setting or create the IOC file in ST sample sources?I am used to working with MCUXpresso for NXP microcontrollers and the wizard to configure the chip is always available in any project, so I don't have to create the source code by hand. I am surprised by these limitations with the STM32CubeIde, as it is also based on Eclipse.Regards

author: DavidAlfa
author_rank: Super Contributor
timestamp: December 22, 2021, 04:34:22 pm
content: GPIO: Click any pin you like, set as input/output. Name it for easier handling, ex. "PIN1".To write it:HAL_GPIO_WritePin(PIN1_GPIO_Port, PIN1_Pin, [RESET/SET]);Also:HAL_GPIO_TogglePin(PIN1_GPIO_Port, PIN1_Pin);To get the value:Value = HAL_GPIO_ReadPin(PIN1_GPIO_Port, PIN1_Pin);UART: Connectivity tab, enable UART0/1/2 whatever you like. Set the baudrate and few things.Then check the HAL_UART functions. (HAL_UART_Transmit, etc).Ensure to have a look at other examples and the HAL manual.Post your code as you progress.

author: luiHS
author_rank: Frequent Contributor
timestamp: December 22, 2021, 05:30:39 pm
content: Quote from: DavidAlfa on December 22, 2021, 04:34:22 pmBut all that source code has to be written by hand, can't I add the IOC file to the project to access the configuration wizard?

author: Jeroen3
author_rank: Super Contributor
timestamp: December 22, 2021, 07:45:48 pm
content: You have to create a new project for it to usecode generation.There is also an option to import an existing IOC file, if you used STMCubeMX before.Then make sure to pick STM32Cube in project type, otherwise you won't get the code generation options.Feel free to ask any questions, since you're probably going to have a knee jerk reaction that you have to follow the rules presented by the IDE and Eclipse about where you put your code next. It's what caused a lot of people on forums to get upset about such tools (code generation and eclipse) being garbage. But if you take the time to learn those rules (and eclipse) it's comfortable to work with and will save you a time.

author: DavidAlfa
author_rank: Super Contributor
timestamp: December 22, 2021, 08:00:06 pm
content: LuiHs, you can't partially import an IOC, it's a complete hardware setup. So it's everything or nothing.If it's only for a few peripherals and pins, manually copying them won't take long, there aren't so many fields.You can't open 2 iocs at the same time inside the IDE, but you can run standalone cubemx in one side and IDE-cubemx in the other, that way it's much easier.You don't need to install cubemx, you can use the IDE's like this (MX version might be different):Code:java -jar c:\ST\STM32CubeIDE_1.7.0\STM32CubeIDE\plugins\com.st.stm32cube.common.mx_6.4.0.202111222105\STM32CubeMX.jarAdd that line to a script to quickly launch it and it'll be straight simple.Actually, it has become a pretty good IDE. Had lots of issues, but it seems that they're finally fixing most of them.Eclipse is being used by a lot chip makers, so in the end its a good idea to learn it.The other day I installed MCUXpresso to compile something someone who couldn't... 99.99% the same, totally straighforward, and I had never used it.No idea why so much hate against Eclipse, it's slower than Notepad, sure... but has tons of extremely useful features that save a lot of time. Code completion, mouse-over hints, references/declarations, real-time code analysis (So you don't need to compile to see the errors) and debugging, all in one...