ConnectCore UL Express - how to quickly get PWM or GPIO high right after system reset?

I’m getting started with the ConnectCore UL Express. The plan is to have it replace a microcontroller in an existing product, and among the many ways I plan on using it, one is to have the PWM1 module control a motor. When the ConnectCore starts up, the PWM1 IO line is low. The existing motor control circuitry is active low, so the motor starts spinning when power is applied. With the microcontroller, it’s pretty straightforward getting the IO line high at startup, but with the whole Linux thing on the ConnectCore, it’s not as obvious to me how to achieve this. I’m looking through the forums and working through the documentation right now, but it would definitely be helpful if someone could provide a summary of steps to get the PWM1 IO line (and in general, any other GPIO line) to be high right after coming out of reset, and hopefully it is not necessary to wait until Linux boots before do so. The motor control is a minor side show to what I am trying to demonstrate, so if I can get through this, then it will be very helpful.

Thanks in advance.

change it in u-boot source code and recompile it. It will get high shortly after power-up or reset. Also depending on your application, you can perhaps add a week pull-up resistor. The pin by default is an input, so CPU does not drive it. And when you need to drive it low, CPU can still do it because the pull-up is weak.

1 Like

Thanks very much for your answer.

Is there a way to read and verify the pin/pad configuration after Linux starts? For now, I have updated the pwm pad configuration in the device tree source, recompiled the .dts to create a new .dtb, and want to verify that the pad configuration has changed per the changes in the .dts. Once I verify I can change the pad configuration this way, and the pad configuration is set right for the application, then I’ll also do so in u-boot, which takes more effort than working with the device tree files.

To use a pull-up resistor, it is necessary to configure the pad for open-drain, and it appears possible to add a weak pull-up resistor in the the imx6ul pin configuration.

Thanks again.

if you can control pin via sysfs as described here:
then it is properly configured as GPIO


While googling for the answer, I also found this article:

In the comments near the bottom of the page is found exactly what I was looking for:

root@ccimx6ulstarter:/# cat /sys/kernel/debug/pinctrl/20e0000.iomuxc/pinconf-pins

pin 70 (MX6UL_PAD_LCD_DATA00): 0xc0f0

pin 78 (MX6UL_PAD_LCD_DATA08): 0x1b020
pin 79 (MX6UL_PAD_LCD_DATA09): 0x1b020