Raspberry Pi 4

More
7 years 2 months ago #141371 by svanteg
Replied by svanteg on topic Raspberry Pi 4
Hi all, just wanted to let you know that I have the Mesa 7i90HD working (first results - just the card itself) on SPI on RPI4.

Following the instructions posted here I got PREEMPT RT 4.19.59 running. I started with buster lite and had a "dtoverlay=vc4-fkms-v3d" in /boot/config.txt that I had to comment out to get HDMI output on this kernel.

I flashed the 7i90 with an SPI bitfile on a PC over EPP. Then connected it to the first SPI (SPI0 CE0) as described elsewhere on this site.

I had to modify spi_common_rpspi.h:
Code:
diff --git a/src/hal/drivers/mesa-hostmot2/spi_common_rpspi.h b/src/hal/drivers/mesa-hostmot2/spi_common_rpspi.h index 56fe93eb8..58b30fbbd 100644 --- a/src/hal/drivers/mesa-hostmot2/spi_common_rpspi.h +++ b/src/hal/drivers/mesa-hostmot2/spi_common_rpspi.h @@ -45,6 +45,7 @@ #define BCM2835_AUX_END (BCM2835_AUX_BASE + sizeof(bcm2835_aux_t)) #define BCM2709_OFFSET 0x1F000000 // For RPI 2 and 3 +#define BCM2711_OFFSET 0xDE000000 // For RPI 4 #if !defined(__I) && !defined(__O) && !defined(__IO) #ifdef __cplusplus

...and hm2_rpspi.c:
Code:
diff --git a/src/hal/drivers/mesa-hostmot2/hm2_rpspi.c b/src/hal/drivers/mesa-hostmot2/hm2_rpspi.c index 116d6ca69..e70657d07 100644 --- a/src/hal/drivers/mesa-hostmot2/hm2_rpspi.c +++ b/src/hal/drivers/mesa-hostmot2/hm2_rpspi.c @@ -102,7 +102,8 @@ typedef struct hm2_rpspi_struct { typedef enum { RPI_UNSUPPORTED, RPI_1, // Version 1 - RPI_2 // Version 2 and 3 + RPI_2, // Version 2 and 3 + RPI_4 } platform_t; static uint32_t *peripheralmem = (uint32_t *)MAP_FAILED; // mmap'ed peripheral memory @@ -909,6 +910,9 @@ static int peripheral_map(void) case RPI_2: // for RPI 3 too membase += BCM2709_OFFSET; break; + case RPI_4: + membase += BCM2711_OFFSET; + break; default: rtapi_print_msg(RPSPI_ERR, "hm2_rpspi: Platform not supported\n"); return -1; @@ -1137,6 +1141,9 @@ static platform_t check_platform(void) case 2: //bcm2837 rv = RPI_2; // peripheral base is same on pi2/3 break; + case 3: + rv = RPI_4; + break; default: break; }

...as RPI4 has yet another iobase than RPI 2 & 3. Don't know if BCM2711 makes sense as a label, I just picked it from the kernel defconfig prefix.

Hopefully this saves someone else some time to get going with this combination.

Again, just first results I have only tested running the default gcode in Axis without anything like stepper drivers connected using the 7i90 template ini/hal. Seems stable at 20.834 MHz using 150mm clip on test wires. No realtime excursions reported.


/svante

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago #141374 by PCW
Replied by PCW on topic Raspberry Pi 4
Thanks for posting that
Its nice that the RPI4s SPI hardware is compatible with the
RPI3's and only needs a different base address.

Have you tried mesaflash on the RPI4? I does work on the RPI3 though the
syntax is not obvious...

github.com/jethornton/mesaflash has some added SPI help text and
support for about 6 new boards including the RPI3/4 compatible 7C80/7C81

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago #141398 by Hakan
Replied by Hakan on topic Raspberry Pi 4

Bari wrote: If you have the time, please post your output from "glxinfo".

Thank you.


Here is the output from my pi

File Attachment:

File Name: glx.txt
File Size:69.38 KB
The following user(s) said Thank You: Bari

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago #141399 by Bari
Replied by Bari on topic Raspberry Pi 4
Just got a Rpi 4 up and running today.

Thanks!

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago - 7 years 2 months ago #141405 by wicki
Replied by wicki on topic Raspberry Pi 4
> If you haven't done so already, bring down the wlan0 interface. It might help.

A good hint!
I have done it and now I can do go down to a period of 140.000 in linCNC with
display via vnc.

Inside a "hal-only"-environment, it's possible to drive a stepper with 10kHz
with a step/dir-signal. But I think the timing quallity of the signal will be poor.

lets see ;-)

10kHz stepper signal - not as bad as expected. But some deviations in timing....
The above spikes are the durations of the "low" and "high" parts oth the squarewave.
not even so bad.... but if I zoom it:


erste.de/timing-tests.PI4.html
Last edit: 7 years 2 months ago by wicki.
The following user(s) said Thank You: joekline9

Please Log in or Create an account to join the conversation.

More
7 years 2 months ago #141409 by andypugh
Replied by andypugh on topic Raspberry Pi 4
I have been experimenting at the LinuxCNC meetup in Stuttgart with the Pi4.
We converted a C1 lathe to CNC and I have been using the Pi4 Buster / preempt image here:
www.linuxcnc.org/dists/buster/2.8-uspace/

Using a Mesa 7i96 ethernet-connected breakout

I works well, but has some stability issues. This might be due to thermal issues with the Pi, we have no heat-sink or fan.
The following user(s) said Thank You: joekline9

Please Log in or Create an account to join the conversation.

Time to create page: 0.852 seconds
Powered by Kunena Forum