Forums › Devices › OSD32MP15x › GPIO Device Tree with STM32CubeMX
Hi,
i m working with the OSD32MP15x_MinimalConfig.zip configuration using the STM32MP157C-DK2 board. I would like to mux a new pin as a GPIO with specific pad settings using in the STM32CubeMX. I am reading the next document:
But i am not able to see in the device tree sources any pin configured as a GPIO
I can only see this pin under pinctrl_z: pin-controller:
btreg: bt_reg_on-0 {
pins {
pinmux = <STM32_PINMUX(‘Z’, 6, GPIO)>;
drive-push-pull;
bias-pull-up;
output-high;
slew-rate = <0>;
};
};
But there is no any example under pinctrl: pin-controller node. There may be some designs where we need a pin multiplexed as a GPIO with specific pad settings as the pin above.
The question is can i configure a pin as a GPIO with some specific settings using the STM32CubeMx? Have you checked this? I see in your app note STM32MP1 CubeMX Tutorial for OSD32MP15x that the PC13 looks to be configured as a GPIO for PMIC_WAKEUP but i am not able to see where this pin is configured in the device tree after pressing GENERATE CODE using the OSD32MP15x_MinimalConfig.zip configuration.
Thanks
Aliberal,
You are right, the current version of the cube-MX does not generate a GPIO specific pinctlr node. Instead, the generated device tree files include the https://github.com/STMicroelectronics/linux/blob/v4.19-stm32mp/arch/arm/boot/dts/stm32mp157-pinctrl.dtsi. So, you will have to edit this file to set the pin multiplexing for GPIO.
ST has iterated the tool a couple of times since the release of the MP1 and we noticed that they are adding additional features. We assume the MX tool is still getting worked on to make the generation of the device trees more specific. We will forward this feedback to the ST team.
Best,
Neeraj
Thanks Neeraj
There is no problem to edit manually the device tree. Do you know where ST is setting the PC13 pin that is being used by the PMIC_WAKEUP?
I would like to know if it is possible to configure some pins with specific pad setting in the early boot stages, for example during TF-A booting.
Thanks
Hello aliberal@arroweurope.com,
We apologize for the delay in response. Based on our understanding, PC13 is not initialized in ST’s device tree (stm32mp157-pinctrl.dtsi). The PMIC powers on using Auto Turn-On feature as described under section 5.4.2 of STPMIC1 datasheet (https://www.st.com/resource/en/datasheet/stpmic1.pdf). The Auto Turn-On feature is enabled by default. You could also use PONKEYn to turn-on PMIC. PONKEYn is made available on ST’s DK2 board as button B1.
Yes, you can configure pins in early boot stages. TF-A, U-Boot and Linux Kernel all have separate but identical pin mux and device tree files. This is represented pictorially here: https://wiki.st.com/stm32mpu/index.php/STM32MP15_device_tree
STM32MP1 CubeMX Tutorial for OSD32MP15x (https://octavosystems.com/app_notes/stm32mp1-cubemx-tutorial-for-osd32mp15x/) should help you configure TF-A, U-Boot or Linux Kernel device trees suitably.
FYI, ST recently updated their OpenSTLinux (Starter, Developer and Distribution). It is available at https://wiki.st.com/stm32mpu/index.php/Category:STM32MPU_Embedded_Software_distribution
Octavo Systems LLC all rights reserved
OCTAVO is registered in the U.S. Patent and Trademark Office. OSD, C-SiP, and the Octavo Logo are trademarks of Octavo Systems LLC.
"*" indicates required fields
"*" indicates required fields
"*" indicates required fields
"*" indicates required fields