Not able to get outputs on GPIO of Raspberry5

More
1 year 5 months ago #329112 by AndyCNC
Hi,
I'm a bit desperate. I want to replace my very old pc based linuxcnc with the actual version running on a raspberry pi 5.
I've been trying to get signals to the pin header for a day now.
First of all: Is there a tutorial for raspberry configuration? I found nothing except the general docu and then went from one error message to another.
What I did is:
1. Started Stepconf wizard
2. Replaced parallel port Pins with hal_gpioxxx, see attached hal file

Attachment not found


When I start this Setup following error occurs:  

Attachment not found



This was my try to set the PINs:
Code:
halcmd: loadrt hal_gpio inputs=PIN3,PIN5,PIN7 outputs=PIN5,PIN6,PIN9,PIN10,PIN11,PIN17,PIN22,PIN27 Note: Using POSIX realtime The GPIO line PIN3 can not be found hal_gpio: rtapi_app_main: Operation not permitted (-1) <stdin>:12: waitpid failed /usr/bin/rtapi_app hal_gpio <stdin>:12: /usr/bin/rtapi_app exited without becoming ready <stdin>:12: insmod for hal_gpio failed, returned -1 halcmd: Note: Using POSIX realtime

Would be nice if onyone could show my where I'm wrong.

Andy

 

Please Log in to join the conversation.

More
1 year 5 months ago #329113 by andypugh
Have you run the "gpioinfo" command? That will list the available pins. If it doesn't work that may mean that you don't have gpiod installed.

Is your user account a member of the "dialout" group?

forums.raspberrypi.com/viewtopic.php?t=225274

Please Log in to join the conversation.

More
1 year 5 months ago #329124 by AndyCNC
Thanks for your fast reply.
That's the output of "gpioinfo", looks ok for me:
Code:
[color=#55ff55][b]cnc@fraese[/b][/color]:[color=#5555ff][b]~[/b][/color]$ gpioinfo gpiochip0 - 54 lines: line 0: "ID_SDA" unused input active-high line 1: "ID_SCL" unused input active-high line 2: "GPIO2" unused input active-high line 3: "GPIO3" unused input active-high line 4: "GPIO4" unused input active-high line 5: "GPIO5" unused input active-high line 6: "GPIO6" unused input active-high line 7: "GPIO7" "spi0 CS1" output active-low [used] line 8: "GPIO8" "spi0 CS0" output active-low [used] line 9: "GPIO9" unused input active-high line 10: "GPIO10" unused input active-high line 11: "GPIO11" unused input active-high line 12: "GPIO12" unused input active-high line 13: "GPIO13" unused input active-high line 14: "GPIO14" unused input active-high line 15: "GPIO15" unused input active-high line 16: "GPIO16" unused input active-high line 17: "GPIO17" unused input active-high line 18: "GPIO18" unused input active-high line 19: "GPIO19" unused input active-high line 20: "GPIO20" unused input active-high line 21: "GPIO21" unused input active-high line 22: "GPIO22" unused input active-high line 23: "GPIO23" unused input active-high line 24: "GPIO24" unused input active-high line 25: "GPIO25" unused input active-high line 26: "GPIO26" unused input active-high line 27: "GPIO27" unused input active-high line 28: "PCIE_RP1_WAKE" unused input active-high line 29: "FAN_TACH" unused input active-high line 30: "HOST_SDA" unused input active-high line 31: "HOST_SCL" unused input active-high line 32: "ETH_RST_N" "phy-reset" output active-low [used] line 33: "-" unused input active-high line 34: "CD0_IO0_MICCLK" "cam0_reg" output active-high [used] line 35: "CD0_IO0_MICDAT0" unused input active-high line 36: "RP1_PCIE_CLKREQ_N" unused input active-high line 37: "-" unused input active-high line 38: "CD0_SDA" unused input active-high line 39: "CD0_SCL" unused input active-high line 40: "CD1_SDA" unused input active-high line 41: "CD1_SCL" unused input active-high line 42: "USB_VBUS_EN" unused output active-high line 43: "USB_OC_N" unused input active-high line 44: "RP1_STAT_LED" "PWR" output active-low [used] line 45: "FAN_PWM" unused output active-high line 46: "CD1_IO0_MICCLK" "cam1_reg" output active-high [used] line 47: "2712_WAKE" unused input active-high line 48: "CD1_IO1_MICDAT1" unused input active-high line 49: "EN_MAX_USB_CUR" unused output active-high line 50: "-" unused input active-high line 51: "-" unused input active-high line 52: "-" unused input active-high line 53: "-" unused input active-high gpiochip10 - 32 lines: line 0: "-" unused input active-high line 1: "2712_BOOT_CS_N" "spi10 CS0" output active-low [used] line 2: "2712_BOOT_MISO" unused input active-high line 3: "2712_BOOT_MOSI" unused input active-high line 4: "2712_BOOT_SCLK" unused input active-high line 5: "-" unused input active-high line 6: "-" unused input active-high line 7: "-" unused input active-high line 8: "-" unused input active-high line 9: "-" unused input active-high line 10: "-" unused input active-high line 11: "-" unused input active-high line 12: "-" unused input active-high line 13: "-" unused input active-high line 14: "PCIE_SDA" unused input active-high line 15: "PCIE_SCL" unused input active-high line 16: "-" unused input active-high line 17: "-" unused input active-high line 18: "-" unused input active-high line 19: "-" unused input active-high line 20: "PWR_GPIO" "pwr_button" input active-low [used] line 21: "2712_G21_FS" unused input active-high line 22: "-" unused input active-high line 23: "-" unused input active-high line 24: "BT_RTS" unused input active-high line 25: "BT_CTS" unused input active-high line 26: "BT_TXD" unused input active-high line 27: "BT_RXD" unused input active-high line 28: "WL_ON" "wl_on_reg" output active-high [used] line 29: "BT_ON" "shutdown" output active-high [used] line 30: "WIFI_SDIO_CLK" unused input active-high line 31: "WIFI_SDIO_CMD" unused input active-high gpiochip11 - 15 lines: line 0: "RP1_SDA" unused input active-high line 1: "RP1_SCL" unused input active-high line 2: "RP1_RUN" "RP1 RUN pin" output active-high [used] line 3: "SD_IOVDD_SEL" "vdd-sd-io" output active-high [used] line 4: "SD_PWR_ON" "sd_vcc_reg" output active-high [used] line 5: "SD_CDET_N" "cd" input active-low [used] line 6: "SD_FLG_N" unused input active-high line 7: "-" unused input active-high line 8: "2712_WAKE" unused input active-high line 9: "2712_STAT_LED" "ACT" output active-low [used] line 10: "-" unused input active-high line 11: "-" unused input active-high line 12: "PMIC_INT" unused input active-high line 13: "UART_TX_FS" unused input active-high line 14: "UART_RX_FS" unused input active-high gpiochip12 - 6 lines: line 0: "HDMI0_SCL" unused input active-high line 1: "HDMI0_SDA" unused input active-high line 2: "HDMI1_SCL" unused input active-high line 3: "HDMI1_SDA" unused input active-high line 4: "PMIC_SCL" unused input active-high line 5: "PMIC_SDA" unused input active-high gpiochip13 - 4 lines: line 0: "WIFI_SDIO_D0" unused input active-high line 1: "WIFI_SDIO_D1" unused input active-high line 2: "WIFI_SDIO_D2" unused input active-high line 3: "WIFI_SDIO_D3" unused input active-high

And group "dialout" seems to fit also:
Code:
[color=#55ff55][b]cnc@fraese[/b][/color]:[color=#5555ff][b]~[/b][/color]$ groups cnc cnc : cnc tty disk dialout sudo audio video plugdev users input render netdev i2c bluetooth gpio spi [color=#55ff55][b]cnc@fraese[/b][/color]:[color=#5555ff][b]~[/b][/color]$

Please Log in to join the conversation.

More
1 year 5 months ago #329134 by unknown
forum.linuxcnc.org/38-general-linuxcnc-q...official-images-only

Index to major thread, there's a section regarding your query with an example for a simple 3 axis machine that works.

Please Log in to join the conversation.

More
1 year 5 months ago #329139 by unknown
Link to manpage
linuxcnc.org/docs/devel/html/drivers/hal_gpio.html

First hint is here:
The GPIO line PIN3 can not be found.

PIN3 isn't a name of a pin, pins are named as per man page.

Please Log in to join the conversation.

More
1 year 5 months ago #329145 by AndyCNC
Thanks. When I use the naming in the linked config instead of the naming from docu it works!
I can see dir and step signals now on the correct pins.
One last problem before I can test with the machine. I use an enable signal for the stepper driver. I see it on the pin, but inverted. Is there a possibility to invert output pins at raspberry pi 5 or should I better do it in hardware?

Please Log in to join the conversation.

Time to create page: 0.083 seconds
Powered by Kunena Forum