Set gpio pin high when Zero turns on and low when turned off

it is possible? via overlays=* parameter? how?

1 Like

Hi. I know that some pins are high by default. So you need just set it to low on system startup.

#export pin
echo 490 > /sys/class/gpio/export
#turnoff the pin
echo 0 /sys/class/gpio/gpio490/value

The systemd should be used for that. Just write a simple service with trigger on system startup

Mr. T REX XP, could you go in details and explain how to write that service? I suppose it will be either a bash scrip or a C file, right? It calso be done for I2C, PWM and SPI, right?

Hi,
I have connected my Raxda Zero to my custom circuit (which was based on RPI). The point is that I have connected a digital Output (Pin 16) to the PowerKey pin of a LTE modem. If this pin goes from low volt level to high volt level, the modem will switch on or reset. When Radxa Zero starts, it puts pin 16 to high volt level by default.
How can I tell Radxa that keep this pin low at boot?

I have try to use a script to put this pin low at boot, however this script takes a long time to run and the pulse to the modem it is practically instantaneous when Radxa gets 5V. I have tried crontab, /etc/init.d and systemd.service.

Someone knows how to define the GPIO state at boot?

This is defined in the SoC. You can switch to a different pin or use additional circuit to invert the signal level.

understood. Thanks