In the latest version, I find there is a "pin stacking" choice when configure a pin. But I can't find any description of this function. What's the purpose of this function and how it work?
This appears to allow a pin to be assigned for multple purposes (for example GPIO and I2C). I was excited when I saw this feature as I expected it to generate seperate functions which can be called to simply switch which purpose you wish to use it for. However, at the moment when you select pin stacking and compare the generated code with the same project without pin stacking you can see that those pins gets absolutly nothing generated. Its affectivly the same as not assigning those pins at all.
Hopefully this will be a feature in the near future?!!?
I will raise your feedback to CubeMx team. All your suggestion are welcome.
Many thanks. Its great to see a company actively monitoring their forums for issues and suggestions
I have found a few other issues/bugs. Should I post them in a new topic to report them?
Hello Chris Jameson-Groves ,
You can report your finding issues in the STM32 forum, then ST moderators will take in charge to answer you or raise your feedback/issues internally to the appropriate team.We appreciate your contribution as this will help us to improve our solutions.
The pin stacking function is currently introduced for board design purposes only. There is no effect on the generated code.
It allows board designers to set all the possible pin configurations offer by a board design and that can be achieved through different solder bridge configurations on the board.
It does effect the code generated as any stacked pins get nothing generated. I understand why it does this, but just wanted to point out that the statement "There is no effect on the generated code" is incorrect.
Thanks for your feedback.
I actually found two issues
1/ Code is duplicated (using test.ioc attached)
I used an instance of I2C1 and on one of the pin I stacked other signals.
The following code is generated twice in the main.c and in the hal_msp.c file:
/*Configure GPIO pin : PA9 */
GPIO_InitStruct.Pin = GPIO_PIN_9;
GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Alternate = GPIO_AF4_I2C1;
2/ when a pin gets assigned stacked signals no “GPIO_InitStruct.Alternate = “ gets generated in MX_GPIO_Init (test_stackedpins.ioc)
I guess this is the issue you are talking about, correct?
I guess you would expect MX to generate at least the “GPIO_InitStruct.Alternate =” the AF for the first signal being stacked?
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Alternate = GPIO_AF2_TIM1;/** to generate
Thanks for your feedback,
I will log the issue in our bug tracking system once I get your confirmation.
Retrieving data ...