Skip to content

System GPIOs#

This section belongs both, to the base system and the programming interface.

General#

The C7 smart camera supports several external interfaces, which are controlled via GPIO. Albeit the external interfaces are represented as GPIO towards the Linux system, the external connection is already bound to a specific use case and a specific signal direction. Please refer to section hardware_inputs_outputs for further details on the hardware.

Commands / Libraries#

The system GPIO are supported by the gpiod system library and utilities.

## gpiod needs root privileges
sudo bash

## list all system GPIOs
gpioinfo

## list only named system GPIOs
gpioinfo | grep -v unnamed

## get information about a specific GPIO 
## e.g. blue front LED
gpiofind LED_OUT_0

## get current value of GPIO
gpioget $(gpiofind LED_OUT_0)

## set new value to GPIO 
## blue front LED should shine blue
## blocking call, until CTRL-C is hit
gpioset -m signal $(gpiofind LED_OUT_0)=1

There is a (deprecated) way of accessing system GPIOs through the sysfs virtual filesystem. We discourage the usage of this approach, but still document it for the sake of completeness. Please refer to table gpio_table below for the correct sysfs numbers to export and use.

## access /sys GPIO folder
sudo bash
cd /sys/class/gpio

## enable a GPIO control, e.g. LED_1 
## e.g. blue front LED
echo -n 65 > export 

## access GPIO state folder
cd gpio65

## check direction of GPIO 
## should print "out"
more direction

## set GPIO direction to output pin 
## -> must strictly match the intended use of the GPIO
echo -n out > direction

## read current value
more value

## set GPIO to high 
## front LED should shine blue
echo -n 1 > value

## set GPIO to low 
## front LED should go out
echo -n 0 > value

Available GPIOs#

The system hardware interfaces are controlled via NVIDIA® Jetson SoM through GPIOs from the Linux kernel. They can be controlled by command line or programmatically. For details on how to access the command-line, please refer to sections getting_shell_access and yocto.

The following table summarizes all addressable system GPIO:

GPIO Name Direction Name in gpiod Line / sysfs number Reference
SIGNAL 0 OUT SIGNAL_OUT_0 232 hardware/signal_out
SIGNAL 1 OUT SIGNAL_OUT_1 15 hardware/signal_out
SIGNAL 2 OUT SIGNAL_OUT_2 14 hardware/signal_out
SIGNAL 3 OUT SIGNAL_OUT_3 12 hardware/signal_out
FLASH OUT FLASH_OUT_0 13 hardware/flash_out
TRIG 0 IN TRIGGER_IN_0 16 hardware/trigger_in
TRIG 1 IN TRIGGER_IN_1 17 hardware/trigger_in
SPS DATA OUT DATA_OUT_0 18 hardware/sps_out
SPS RESULT OUT DATA_OUT_1 19 hardware/sps_out
SPS READY OUT DATA_OUT_2 168 hardware/sps_out
LED 0 / blue OUT LED_OUT_0 65
LED 1 / white OUT LED_OUT_1 63
SYSTEM RESET OUT SYS_RESET 202 os/system_reset
FACTORY RESET IN FACTORY_RESET_BTN 38 os/system_reset
USB3 OVERCURRENT IN USB3_OVERCURRENT_FAULT 64 os/overcurrent_protection
EFUSE 0 FLAG IN EFUSE_0_FAULT 76 os/overcurrent_protection
EFUSE 1 FLAG IN EFUSE_1_FAULT 79 os/overcurrent_protection
EFUSE 0 RESET OUT EFUSE_0_RESET 78 os/overcurrent_protection
EFUSE 1 RESET OUT EFUSE_1_RESET 77 os/overcurrent_protection

System and factory reset#

Two special purpose GPIO are the system reset and factory reset GPIO.

SYSTEM RESET

The system reset GPIO directly connects to the 5V power supply of the NVIDIA® Jetson SoM. If the GPIO is activated, the 5V power supply of the system is cut and the Jetson will power off instantaneously, also cutting the power of all utility devices, e.g. the camera chip, the SSD, USB devices etc. This GPIO is used during power-cycling (rebooting) the C7 smart camera through a system service. Also, it can be used for e.g. watchdog scenarios, where the whole system shall be reset to an defined initial state.

FACTORY RESET

This is an input, only indicating that the factory reset button is pressed by a user. The device will react on this signal while booting, if the factory reset button is held down, see section firmware_reset.

Over-current protection#

The device includes some over-current protection fuses for the external devices. The Vcc connections of the external interfaces are routed over the respective e-fuse. Several device connectors are sharing the same e-fuse:

EFUSE 0

Connected external interfaces: SIGNAL, SENSOR (trigger & light barrier), RS232

EFUSE 1

Connected external interfaces: LIGHT (light & flash)

The e-fuses have two GPIO connections each, one acting as flag (raised if the e-fuse is triggered and the power-supply is cut) and one acting as controller for resetting the e-fuse (and re-connecting the external consumer).

Danger

The e-fuse reset functionality should not be used in a auto-reset manner through software. If the e-fuse is activated, a technician should inspect the external device as well as all connectors before manually resetting the e-fuse state, e.g. via user interface.