This guide is based on the Work in progress document I am sharing on the M5Stack Facebook communities in both English and Japanese.
Introduction
The CM4 Stack Development is the latest of the controller line to be released but unlike regular M5Stack controllers, The CM4 Stack is not based on and ESP32 microcontroller but is built around the CM4 Module from Raspberry Pi Foundation.
Unlike the RP CM4, the CM4 Stack come prebuilt needing only a monitor, Keyboard and mouse in order to get started.
CM4 Stack Development Kit Features
From the back of the packaging, the features are as follows:
- CM4104032 module with the following features:
- Quad Core Cortex A72 @1.5GHz,
- 4GB Ram,
- 32 GB eMMC,
- 2.4GHz/5GHz WIFI and BLE,
- 2.0” IPS Colour LCD 240 X 320 pixel resolution,
- Capacitive multi-Touch,
- ATECC608B Crypto Chip,
- 2W Speaker.
- The CM4 Stack has the following connectors on the outside:
- 1 X Gigabit Ethernet,
- 2 X USB 3.2 (Type A)
- 1 X USB 2.0 OTG (type C)
- 1X HDMI Display,
- 2 X grove Ports (I2C and UART)
Power is provided via the included DC 12 V 3A adapter or via the USBC port using a 5V 3A adapter.
Power supply
The CM4 Stack can be powered through the barrel jack with a 12V @ 3Ah supply of through the USBC OTG port with a 5V @3Ah supply.
Storage
As mentioned above, the CM4 Stack has a 32GB eMMC chip soldered to the board and no SD Card slot meaning that in order to upgrade the storage you will need to use and external USB drive.
Opening the Packaging
When you receive your CM4 Stack development kit and open the box you will find the following items inside:
- The CM4 Stack Development Kit,
- 12V Power supply,
- Double sided information card,
- Pack of spare mounting fixings.
Exploring the Outside
When you Open the CM4 Stacks box, the first thing you will see is the 240X320px (2.0”) screen and on the bottom of the screen is a little red circle that is a dedicated touch zone for operating the the OS menu when a screen and keyboard is connected.
On the bottom you will find the Gigabit Ethernet port along with the 12V DC power jack which uses a plug with a 5.5mm OD 2.1mm ID jack.
On the left hand side you will find the Boot select switch and 2X USB A 3.2 ports.
On the top you will find the full sized HDMI outport for connecting external HDMI monitors and screens.
And on the right hand side you will find the USB C OTG, HY2.0 4P I2C Grove and HY2.0 4P UART Grove port
Underneath you will find the connectors for wall mounting or Din rail mounting and you will also see the extractor fan used to cool the CM4 module from over heating.
Connecting the Hardware
In order to get started all we need is to connect a Key board and mouse into the USB ports and an HDMI monitor into the HDMI port on the top of the CM4Stack development kit.
First Power Up
When you first power up the CM4 Stack Development kit you will presented with the introduction page.
All you need to do is have a read and then press the “Next” button to move on to the first of the configuration screens:
Here you set you Country of use, operating language, time zone and keyboard language. Once you have these set up to your needs, click the “Next” button to move on to the Username and Password configuration screen.
Make sure you fill these in and use a secure proper password and not a password that is likely to appear in any of the Top Passwords list available online as there have already been reports of hacked Raspberry Pi’s used to Robohack other online connected devices. Do not attempt to bypass the password boot system as logging in without a password will also put you CM4 Stack Development Kit at risk of hacking.
Once you have filled in the unique username and password, you can press the “Next” button to continue.
The next screen will ask you to change the default screen size to match the currently detected monitor size.
Press next to move on to the WIFI setup screen which shows that the WIFI version of the CM4 is actually installed and not an added option.
Once the Scan has completed, select your network, insert the password and click “Next” to continue.
The OS will attempt to look for updates and when complete will ask you to restart and then you will arrive in the Normal Raspbian desktop.
There is a problem with the updates in that there is a driver that gets ignored and stops the fan and the status display for being shown on the onboard screen. As a walk around for these issues, it has been found that commenting out (add ing # symbol to the line beginning), of two lines in rc.local fixes these issues (see screen grab for the lines.)
Clock Demo.
In the documents for the CM4 Stack is an example code which shows a very nice QT based clock on the built in screen
If you follow the instructions for installing the program, you will encounter an error. The error is due to packages that didn’t get installed.
The instructions for installing the example is as follows:
sudo apt update
sudo apt install qtbase5-dev qt5-qmake qtbase5-dev-tools qml
sudo apt install build-essential cmake
git clone https://github.com/Forairaaaaa/CM4Stack_QtDemo.git
cd CM4Stack_QtDemo
mkdir build && cd build
cmake .. && make
However when you run the last command you get an error about files not found. This turns out to be an issue with the dependences and you need to run:
sudo apt-get install qtdeclarative5-dev
Before running
cmake .. && make
To get the example to compile.
Once the example has finished compiling, to can run the code with:
./cm4QtDemo
Which will run it on the desktop but to make it appear on the screen of the CM4Stack you need to run:
export QT_QPA_PLATFORM=linuxfb:fb=/dev/fb$(cat /proc/fb | grep fb_st7789v | awk '{print $1}')
./cm4QtDemo
And you will see the clock running based on the current system time as shown in the photo on the left.
Comments