---
title: "PiCAT Xenomai 3 for Raspberry pi 4"
url: "https://maker.wiznet.io/bruno/projects/PiCAT-Xenomai-3-for-Raspberry-pi-4/"
markdown_url: "https://maker.wiznet.io/bruno/projects/PiCAT-Xenomai-3-for-Raspberry-pi-4/md"
type: "UCC: User Created Content"
author: "bruno"
author_url: "https://maker.wiznet.io/bruno/"
original_author: "bruno"
original_url: "http://www.simplerobot.net/2020/06/picat-xenomai-3-for-raspberry-pi-4.html"
published: "2021-06-08"
language: "en"
likes: 0
views: 795
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# PiCAT Xenomai 3 for Raspberry pi 4

> PiCAT Xenomai 3 for Raspberry pi 4

Original author: bruno (source: http://www.simplerobot.net/2020/06/picat-xenomai-3-for-raspberry-pi-4.html)

## Article

## Prepare Xenomai 3 kernel

See full instruction at?<http://www.simplerobot.net/2019/12/xenomai-3-for-raspberry-pi-4.html>

## EtherCAT master

Get source code and example

```
git clone -b rpi4-xenomai-3 git://github.com/thanhtamh/soem-w5500-rpi.git
cd soem-w5500-rpi
chmod +x *.sh
./build.sh
```

And test

```
cd test/slaveInfo/
sudo ./slaveinfo wiz -map
```

## Important notes

EtherCAT Master has been updated to SOEM 1.4.0. A full list of new features can be found at SOEM document link:?<https://openethercatsociety.github.io/doc/soem/>

**Note on SPI speed**: The SPI bit rate is divided from GPU core frequency. For previous Raspberry pi revisions (0,1,2,3) the default core frequency is 250 Mhz. Therefore a divider of 16 will provide the spi speed of 15.625 Mhz.

```
wiznet_hw_config(16, 0, 0); //15.625 Mhz on previous rpi versions
```

With Raspberry pi 4, default? core frequency is 500 Mhz, with the same divider value, spi speed is 2 times faster, e.i.?a divider of 16 will provide the spi speed of 31.25 Mhz.

```
wiznet_hw_config(16, 0, 0); //31.25 Mhz on rpi4
```

GPU core frequency is a dynamic quantity, it can vary depending on system load, in order to prevent spi speed change during operation we can simply fix?GPU core frequency by setting in /boot/config.txt file: *core_freq_min=500* *core_freq=500*

Posted?16th June 2020?by?[Ho Tam](http://www.blogger.com/profile/05435403419305595109)

---

Source: https://maker.wiznet.io/bruno/projects/PiCAT-Xenomai-3-for-Raspberry-pi-4/
