Skip to main content
Associate
October 31, 2025
Question

MX vs IDE possible conflicts using HAL

  • October 31, 2025
  • 2 replies
  • 320 views

When using MX to generate the ioc-file and then importing it to CubeIDE, it is tricky to make it work.

Such as trying to make a pin an output pin. In this case on the STM32H563 where I want to use PE2 (on pin 1) and PE3 (on pin2) as output pins. when generated it is not possible to change the output of these port pins. Why is that a problem when the compilation is ok and the debuger does not protest?

Is there any specific setup that has to be done manually? Iried that but then the compiler objected.

How make such a simple action work in such a complicated environment?

 

 

2 replies

Andrew Neil
Super User
October 31, 2025

Welcome to the forum.

Please see How to write your question to maximize your chances to find a solution for best results.

 

You haven't said what versions of IDE & MX you're using, or on what Host platform.

Also what Target board, and the full STM32 part number.

 


@zachariasfct wrote:

I want to use PE2 (on pin 1) and PE3 (on pin2) as output pins. when generated it is not possible to change the output of these port pins.


I'm not sure what you mean here?

Do you mean when you do this:

HAL_GPIO_WritePin( GPIOE, GPIO_Pin_2, GPIO_PIN_SET ); // PE2 high

HAL_GPIO_WritePin( GPIOE, GPIO_Pin_2, GPIO_PIN_RESET ); // PE2 low

You don't see the physical output level changing state?

 

Please post a minimum but complete project which illustrates this. Include the .ioc file.

You can attach a zip file, or see How to insert source code for how to put C code into a post (as above)

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Associate
October 31, 2025

Please see the following files if you find errors that I've missed.

Rgds

zacharias

 

Andrew Neil
Super User
October 31, 2025

You still haven't clearly stated what problem(s) you are seeing.

You still haven't said what versions of IDE & MX you're using, or on what Host platform.

Also what Target board, and the full STM32 part number.

 

Again, you can attach your project as a zip file, or see How to insert source code for how to put C code into a post (as above) - not as a .docx !

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
TDK
Super User
October 31, 2025

You click the pins you want to make output to select them as output. I don't know how they could possibly make it any easier. Why can't you change them?

"If you feel a post has answered your question, please click ""Accept as Solution""."