Author Topic: STM32CubeIde Configuration tool IOC files  (Read 7698 times)

0 Members and 1 Guest are viewing this topic.

Offline luiHSTopic starter

  • Frequent Contributor
  • **
  • Posts: 602
  • Country: es
STM32CubeIde Configuration tool IOC files
« on: December 22, 2021, 02:58:43 pm »
Hi

Im 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

« Last Edit: December 22, 2021, 03:02:09 pm by luiHS »
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6207
  • Country: es
Re: STM32CubeIde Configuration tool IOC files
« Reply #1 on: December 22, 2021, 04:34:22 pm »
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.
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 
The following users thanked this post: luiHS

Offline luiHSTopic starter

  • Frequent Contributor
  • **
  • Posts: 602
  • Country: es
Re: STM32CubeIde Configuration tool IOC files
« Reply #2 on: December 22, 2021, 05:30:39 pm »
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.

But 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?
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4149
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: STM32CubeIde Configuration tool IOC files
« Reply #3 on: December 22, 2021, 07:45:48 pm »
You have to create a new project for it to use code 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.
« Last Edit: December 22, 2021, 07:53:08 pm by Jeroen3 »
 
The following users thanked this post: luiHS

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6207
  • Country: es
Re: STM32CubeIde Configuration tool IOC files
« Reply #4 on: December 22, 2021, 08:00:06 pm »
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: [Select]
java -jar c:\ST\STM32CubeIDE_1.7.0\STM32CubeIDE\plugins\com.st.stm32cube.common.mx_6.4.0.202111222105\STM32CubeMX.jar
Add 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...
« Last Edit: December 22, 2021, 08:17:25 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 
The following users thanked this post: luiHS


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf