CubeMx won't generate MX_GPIO_Init() function for my GPIO pins
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-09-04 3:53 PM
When I create a new project in CubeMx 5.3.0 for the STM32H745-DISCO board with or without default peripheral initialization and configure, for example, pins PA8 and PF8 as GPIO_Output, they appear on the list of GPIO pins, but the function MX_GPIO_Init() in main.c generated by CubeMx doesn't have any initialization code for those pins and the corresponding ports. CubeMx generates the correct code for GPIO pin initialization for single-core MCU's, such as the H743, but it seems like it doesn't work for the dual-core MCU's such as H745.
Solved! Go to Solution.
- Labels:
-
GPIO-EXTI
-
STM32CubeMX
-
STM32H7 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-09-05 12:37 AM
​Hello @Community member​ ,
You're working with a dual core MCU so you need to specify in which context you need this pin.
Right click on pin then under "Pin Reserved" Choose one of the 2 Cortex.
Best Regards,
Khouloud.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-09-05 12:37 AM
​Hello @Community member​ ,
You're working with a dual core MCU so you need to specify in which context you need this pin.
Right click on pin then under "Pin Reserved" Choose one of the 2 Cortex.
Best Regards,
Khouloud.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-09-07 12:58 PM
Thank you so much, Khouloud! This worked for me.
This menu (for selecting Cortex-M4 vs Cortex-M7) is really well hidden!
The menu item name "Pin Reservation" doesn't mean much, so none of the engineers on my team were able to figure out how to get to the context assignment menu.
I wish the interface for selecting M4 vs M7 was designed similar to other peripheral selection, on the left-hand side of the window, where we have checkboxes in two columns: One for M4 and another for M7.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-09-02 12:49 PM
OMG - worst interface ever. Glad I found this post to fix my problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-01-31 12:44 PM
Agreed - bad interface - not obvious at all - Also glad to have found this answer.
I started on punch cards, now I'm takin' it to the cloud.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-06-13 5:12 AM
For anyone who also stumbles across this and wonders whether they really need to set each GPIO individually: no, of course not.
You can also change several pins together by:
- switching to the GPIO overview (e.g. A->Z > GPIO or Categories > System Core > GPIO)
- marking the GPIO to be changed in the table Configuration (center column)
- then in the table below (different settings lead to a white field) set the setting for all GPIO via the item Pin Context Assignment
Hope that helps.
/Peter
