Advanced Search

Search Results (Searched for: raspberry pi 3)

29 Dec 2023 22:03

LitexCNC: firmware and driver for 5A-75B and 5A-75E

Category: Driver Boards

Just released version 1.2.0 to PyPi with support for Raspberry Pi 5!

This release brings furthermore:
  • An updated watchdog module with an enable pin. This enable pin is HIGH as long the watchdog is happy. It will go LOW when the watchdog bites, for example when the communication gets disrupted. This enable pin can be used to control / disable buffers to bring the machine to a safe state. When recompiling a card, modification of the configuration file is required.
  • Several bug-fixes:
    • in the CLI (correct detection of 64-bit RPi);
    • PWM does not generate errors / warning at compilation;
    • pin numbering of HUB75HAT has been corrected (connectors were mirrored);
    • resolved error with GPIO when there are only inputs or outputs defined..
28 Dec 2023 13:33 - 28 Dec 2023 21:18

Patching the MCP23017 kernel driver device tree to work with hal_gpio (RPi)

Category: HAL

tldr: The following procedure should work for any SPI/I2C/... GPIO Expander with an existend linux kernel/gpiod driver that uses a Device Tree configuration.

I'm currently retrofitting a small CNC mill with LinuxCNC on the Raspberry Pi 4.
To get more GPIOs I wanted to use the MCP23017 I2C Port Expander (www.microchip.com/en-us/product/mcp23017).
For testing I use this board: www.adafruit.com/product/4132
I don't expect the GPIOs to be realtime, but I want to use them in a HAL file.

While resaerching I found this thread (but there is no real solution, only some hints): forum.linuxcnc.org/24-hal-components/464...dapt-the-extended-io
I also took a closer look at the hal_gpio driver.

As documented the hal_gpio driver relies on the gpiod package and the names given by gpioinfo. I was lucky because there is a linux kernel driver for the MCP23017:
github.com/torvalds/linux/blob/master/Do...pinctrl-mcp23s08.txt
github.com/torvalds/linux/blob/master/dr...nctrl-mcp23s08_i2c.c

So I added the Device Tree (/boot/broadcom/overlays/mcp23017.dtbo) that was already provided in the firmware folder on the RPi to the config.txt as an overlay and did a reboot.
cnc@raspberrypi:~$ sudo nano /boot/broadcom/config.txt
 - add follwing at the end of the file:
dtoverlay=mcp23017
 - also enable I2C if not alredy enabled:
dtparam=i2c_arm=on

After running gpioinfo the GPIO extender with the pins was shown, but they didn't have a name ('unnamed').
cnc@raspberrypi:~$ gpioinfo
gpiochip0 - 58 lines:
        line   0:     "ID_SDA"       unused   input  active-high
        ...
        line  57: "RGMII_TXD3"       unused   input  active-high
gpiochip1 - 8 lines:
        line   0:      "BT_ON"       unused  output  active-high
        ...
        line   7:    "SD_OC_N"       unused   input  active-high
gpiochip2 - 16 lines:
        line   0:      unnamed       unused   input  active-high
        line   1:      unnamed       unused   input  active-high
        line   2:      unnamed       unused   input  active-high
        line   3:      unnamed       unused   input  active-high
        line   4:      unnamed       unused   input  active-high
        line   5:      unnamed       unused   input  active-high
        line   6:      unnamed       unused   input  active-high
        line   7:      unnamed       unused   input  active-high
        line   8:      unnamed       unused   input  active-high
        line   9:      unnamed       unused   input  active-high
        line  10:      unnamed       unused   input  active-high
        line  11:      unnamed       unused   input  active-high
        line  12:      unnamed       unused   input  active-high
        line  13:      unnamed       unused   input  active-high
        line  14:      unnamed       unused   input  active-high
        line  15:      unnamed       unused   input  active-high

After some resaech and comparison to the Raspberry Pi GPIO device tree I figured out how to set the GPIO names in the device tree:
 - Decompile the .dtbo in the .dts format with dtc:
cnc@raspberrypi:~$ dtc /boot/broadcom/overlays/mcp23017.dtbo -o mcp23017.dts
 - Edit the .dts file:
cnc@raspberrypi:~$ nano mcp23017.dts
    - change the I2C address if necessary (the adafruit board has the address 0x20):
mcp23017_pins@20
mcp@20
reg = <0x20>;
    - add the GPIO names in the mcp@20 section (ypu can choose your own names):
gpio-line-names = "MCP20_A0","MCP20_A1","MCP20_A2","MCP20_A3","MCP20_A4","MCP20_A5","MCP20_A6","MCP20_A7","MCP20_B0","MCP20_B1","MCP20_B2","MCP20_B3","MCP20_B4","MCP20_B5","MCP20_B6","MCP20_B7";
 - Compile the file back and save it to the firmware folder (keep a backup of the original .dtbo file)
cnc@raspberrypi:~$ dtc mcp23017.dts -o mcp23017.dtbo -O dtb
cnc@raspberrypi:~$ sudo mv /boot/broadcom/overlays/mcp23017.dtbo /boot/broadcom/overlays/mcp23017.dtbo.old
cnc@raspberrypi:~$ sudo mv mcp23017.dtbo /boot/broadcom/overlays/mcp23017.dtbo
 - reboot

After applying the patched Device Tree I got names in the gpioionfo output:
cnc@raspberrypi:~$ gpioinfo
gpiochip0 - 58 lines:
        line   0:     "ID_SDA"       unused   input  active-high
    ...
        line  57: "RGMII_TXD3"       unused   input  active-high
gpiochip1 - 8 lines:
        line   0:      "BT_ON"       unused  output  active-high
        ...
        line   7:    "SD_OC_N"       unused   input  active-high
gpiochip2 - 16 lines:
        line   0:   "MCP20_A0"       unused   input  active-high
        line   1:   "MCP20_A1"       unused   input  active-high
        line   2:   "MCP20_A2"       unused   input  active-high
        line   3:   "MCP20_A3"       unused   input  active-high
        line   4:   "MCP20_A4"       unused   input  active-high
        line   5:   "MCP20_A5"       unused   input  active-high
        line   6:   "MCP20_A6"       unused   input  active-high
        line   7:   "MCP20_A7"       unused   input  active-high
        line   8:   "MCP20_B0"       unused   input  active-high
        line   9:   "MCP20_B1"       unused   input  active-high
        line  10:   "MCP20_B2"       unused   input  active-high
        line  11:   "MCP20_B3"       unused   input  active-high
        line  12:   "MCP20_B4"       unused   input  active-high
        line  13:   "MCP20_B5"       unused   input  active-high
        line  14:   "MCP20_B6"       unused   input  active-high
        line  15:   "MCP20_B7"       unused   input  active-high

Then it is possible to use the GPIOs with the hal_gpio driver:
cnc@raspberrypi:~$ halrun
halcmd: loadrt hal_gpio inputs=MCP20_A0,MCP20_A1 outputs=MCP20_B0,MCP20_B1

halcmd: show pin
Component Pins:
Owner   Type  Dir         Value  Name
     4  bit   OUT         FALSE  hal_gpio.MCP20_A0-in
     4  bit   OUT         FALSE  hal_gpio.MCP20_A0-in-not
     4  bit   OUT         FALSE  hal_gpio.MCP20_A1-in
     4  bit   OUT         FALSE  hal_gpio.MCP20_A1-in-not
     4  bit   IN          FALSE  hal_gpio.MCP20_B0-out
     4  bit   IN          FALSE  hal_gpio.MCP20_B1-out
     4  s32   OUT             0  hal_gpio.read.time
     4  s32   OUT             0  hal_gpio.write.time
28 Dec 2023 04:44

MESA 7i97T, unable to ping board, strange lamp behavior

Category: Driver Boards

Thanks guys. Had multiple issues. Using a laboratory power supply the card boots up fine :-) and after much stuffing around have got the raspberry pi able to ping it.

Thanks again to the great community and support here.
27 Dec 2023 08:52

LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)

Category: Computers and Hardware

Thank you for help.
Currently my setup work on bench with serial communication of the box, just small adjustment of baud rate in rio.v and adjusting port in rio.h!
Still lot to do.
 
Hi Zayoo,
nice !
Are you using a Raspberry with Serial on GPIO or an USB-Serial-Adapter ?


 

I'm using FTDI232 USB to serial converter. My setup is running on VirtualBox on desk PC. 

 

 

cool !
i have had no luck with any USB connections (UART2USB/SPI2USB).
everything works so far, but I always get 'joint follow errors' during movements

but I also have the same problem with direct UART connection on the Raspberry (/dev/AMA0)

 
26 Dec 2023 08:05 - 26 Dec 2023 08:43
25 Dec 2023 10:46 - 25 Dec 2023 11:47

LinuxCNC-RIO - RealtimeIO for LinuxCNC based on FPGA (ICE40 / ECP5)

Category: Computers and Hardware

Thank you for help.
Currently my setup work on bench with serial communication of the box, just small adjustment of baud rate in rio.v and adjusting port in rio.h!
Still lot to do.
 
Hi Zayoo,
nice !
Are you using a Raspberry with Serial on GPIO or an USB-Serial-Adapter ?


 

I'm using FTDI232 USB to serial converter. My setup is running on VirtualBox on desk PC. 

 

24 Dec 2023 00:24

Linumeric-LPT V3 - Ethernet to LPT controller for LinuxCNC

Category: Driver Boards

Hey this looks pretty cool. I was just working on my own remora version using the 411, then stumbled on this. Ive been keeping my eye on your other project for a while though. Mine includes a raspberry pi header.

I am very interested to see your firmware and linuxcnc driver.
23 Dec 2023 12:09
Replied by rodw on topic LinuxCNC on Raspberry Pi 5

LinuxCNC on Raspberry Pi 5

Category: Installing LinuxCNC

My interest is being able to build a img that has Linuxcnc preinstalled on the 6.1.x kernel to remain compatibility with Debian 12 to complement the other installers I have built. Eventually, the kernels and patches will align so until then early adopters will have to follow your methods
23 Dec 2023 11:52

LinuxCNC on Raspberry Pi 5

Category: Installing LinuxCNC

None of those are “bleeding edge” if you look at the progression of the mainline kernel, which is well past the 6.1 series.
Quite honestly, after going through the process, as it stands the most usable route for the RPi 5 is a Raspberry OS image with a real time kernel of the appropriate version and Linuxcnc either installed via self built packages, which doesn’t take that long. The other secret is to change from Wayland to X as the compatibility layer is not optimum for UIs that have calls to X libs. This is a must if a user has a preference for a xfce desktop.
Another thing to keep in mind is eventually sysfs will be dropped from RPi kernels as it a depreciated feature. This will mean some changes to user land access to GPIO, not that it will affect Linuxcnc, but it would be something worth tracking. This info comes from the RPi forum, mainly from when questions arise from access regarding The RPi 5, which seems to be a little messy and unclear to a great many users. Libgiod seems to be the recommended way. Whilst it’s neither here nor there, some of these developments would be worth tracking.

On another note, keep safe and I hope that the fire nor floods affect you mate, seems like the last thing you need on your plate.
23 Dec 2023 11:19
Replied by rodw on topic LinuxCNC on Raspberry Pi 5

LinuxCNC on Raspberry Pi 5

Category: Installing LinuxCNC

Cornholio, I have just followed the commits on the raspberry pi kernel git
github.com/raspberrypi/linux/commits/rpi-6.1.y
It is desirable to match the mainline kernel with the preempt-rt kernel
6.1.67 was committed on 11 Dec but it has not been merged into 6.1.y
The next merge ocurred after committing 6.1.68 so there is not a clean match with the 6.1.67 RT patch.
Previoulsy there was 1 for 1 mapping with the kernel versions. The sudden flurry I assume is due to the Pi 5.
The production 6.1.63 kernel would need to use the 6.1.47 patch so quite a gap.

Probably the best commit to clone from would be e41b05a8fc73f95425aceaf15a68fc25da1d1fe5 where 6.1.68 was merged in as that should include the 6.1.67 changes and only be one version away from preempt_rt

When you use kernel source from kernel.org there are ways to match the versions eactly.
23 Dec 2023 04:47

LinuxCNC on Raspberry Pi 5

Category: Installing LinuxCNC

Re:one panel at the top.. not entirely sure what you mean but I think you are right
23 Dec 2023 02:15

LinuxCNC on Raspberry Pi 5

Category: Installing LinuxCNC

Yeah it was a toss up between the pineberry and the one I got. I chose mine because it was cheaper and had a cool design on the back haha, plus the company is a bit older.
23 Dec 2023 01:00 - 23 Dec 2023 01:08

LinuxCNC on Raspberry Pi 5

Category: Installing LinuxCNC

If it's Rod's image can you change the resolution and does it identify the display\monitor? From what I've seen it's stuck at a single resolution and it can't identify the dsiaplay as the RPi4 images can.
Yes, my image uses debian so it won't have the pi specific menu options.. Some settings can be changed using  sudo menuconfig.
But if you could try adding
video=HDMI-A-1:1920x1080M@60D 
to cmdline.txt or equivalent, It would be helpful. If it works, I can add it to the installer.

Its still a pain because the Pi 5 needs to be at the bleeding edge of the raspberry kernel and the PREEMPT_RT is lagging behind that.

 


Latest RPi production kerenl (2023-12-05) is Linux kernel 6.1.63 for the most recent Raspberry OS Image,latest 6.1 series RT is 6.1.67, so it would not seem that the RPi 5 does not need a "bleeding edge" kernel, it's just there is a mismatch between latest RPi production kernel and the latest rt-preempt. If anything the preferred RPi kernel is behind the rt-preempt patch.
www.raspberrypi.com/software/operating-s...spberry-pi-os-64-bit

In actual fact the latest 64 bit image is the same for all models. After running a self (same recipe) made image for the RPi5 and using the official image and installing a RT kernel & linuxcnc, the official image appears to be a more "smoother & integrated" experience for the 5, tho I did change from Wayland to X so I could run a xfce desktop. The pre made images for the 4 are fine.

Although in saying that Rod if you have sources of info to the contrary I'd be quite happy to see it and amend my answer.
22 Dec 2023 22:26 - 22 Dec 2023 22:27

LinuxCNC on Raspberry Pi 5

Category: Installing LinuxCNC

Yeap. I have one of these on the way

shop.pimoroni.com/products/nvme-base?variant=41219587178579

Edit. I find this the most awkward forum when replying to people.
Displaying 796 - 810 out of 944 results.
Time to create page: 0.809 seconds
Powered by Kunena Forum