2017-09-13 03:35 AM
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?
#pin-stacking2017-11-21 02:13 AM
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?!!?
2017-11-21 04:45 AM
Hello,
I will raise your feedback to CubeMx team. All your suggestion are welcome.
Best Regards
Imen
2017-11-21 06:19 AM
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?
2017-11-21 07:17 AM
Hello
Jameson_Groves.Chris
, You can report your finding issues in the STM32 forum, then ST moderators will take in charge to answer you or raiseyour feedback/issues internally to the appropriate team. We appreciate your contribution as this will help us to improve our solutions.Best Regards,
Imen.
2017-11-27 02:58 AM
Hello,
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.
Best regards/
2017-11-27 04:22 AM
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.
2017-11-29 01:01 AM
Hello Chris,
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;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
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?
/*Configure GPIO pin : PA9 */
GPIO_InitStruct.Pin = GPIO_PIN_9;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Alternate = GPIO_AF2_TIM1;/** to generate
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
Thanks for your feedback,
I will log the issue in our bug tracking system once I get your confirmation.
________________ Attachments : test.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyBv&d=%2Fa%2F0X0000000b5R%2FkXNhG6kdiBRdo8lrAdToTTehLq1RPmrSsDIONFSfhFk&asPdf=falsetest_stackedpins.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HxkL&d=%2Fa%2F0X0000000b5Q%2F5DhL_rSz5rZ7Tr_aU6gGGcswuRNGvF.3yvtXOAFaeyQ&asPdf=false