Getting Started with Remi Pi: FreeRTOS and LVGL Tutorial

Follow+Star Public Account, don’t miss wonderful content
Getting Started with Remi Pi: FreeRTOS and LVGL Tutorial
Source | Mil Electronics
Earlier this year, I shared that the Remi Pi development board was launched!

Today I would like to share a quick start tutorial for the Remi Pi.

Getting Started with Remi Pi: FreeRTOS and LVGL Tutorial

1. System Overview

Getting Started with Remi Pi: FreeRTOS and LVGL Tutorial

The Remi Pi’s myir-image-core system is built on Yocto and includes an LVGL interface, complete hardware drivers, common system tools, debugging tools, etc., including RT-Linux real-time patches and Ethercat master station, supporting application development using Shell, C/C++.

Category

Name

Description

Source Code

Flash-Writer

Flash-Writer 1.06

TF-A

Arm Trusted Firmware 2.6

Bootloader

U-boot 2021.10

Kernel

Linux Kernel 5.10.83

Yocto

Yocto 3.1.20

File System

myir-image-core

Filesystem built with Yocto

Tools

Development Tools

sdk.tar.bz2, e2 studio

Burning Tools

Win32DiskImager

teraterm

Documentation

Remi Pi_Linux Software Development Guide

Includes source code compilation, burning, etc.

Remi Pi FreeRTOS Application Development Notes

Includes environment setup, project creation, etc.

Remi Pi Real-Time System and Ethercat Porting Application Notes

Includes rtlinux, ethercat porting

2. Quick Start

Getting Started with Remi Pi: FreeRTOS and LVGL Tutorial

1.LVGL Display

Retrieve the lvgl.tar.bz2 source package from the 04_Sources directory and extract the source package.

PC:~/renesas/04_Sources$ tar -xvf lvgl.tar.gz

Compile the source package, and copy the lvgl_demo executable file to the development board to run.

PC:~/renesas/04_Sources/lvgl$ source /opt/remi-sdk/environment-setup-aarch64-poky-linuxPC:~/renesas/04_Sources/lvgl$ make

Getting Started with Remi Pi: FreeRTOS and LVGL TutorialMil – Remi Pi’s LVGL display effect

2. RT-Linux Real-Time Patch

Obtain the patch corresponding to the L5.10.83 kernel version from the RT official website, link as follows:

https://cdn.kernel.org/pub/linux/kernel/projects/rt/5.10/older/

Unzip the patch package to your working directory.

PC:~/renesas/04_Sources$ tar -xvf patches-5.10.83-rt58.tar.gz

Navigate to the kernel source directory to apply the patch.

PC:~/renesas/04_Sources/myir-renesas-linux$ for p in `ls -1 ../patches/*.patch`;do patch -p1 < $p;done

Modify the mys_g2lx_defconfig configuration file

PC:~/renesas/04_Sources/myir-renesas-linux$ vi arch/arm64/configs/mys_g2lx_defconfigCONFIG_EXPERT=yCONFIG_ARCH_SUPPORTS_RT=yCONFIG_PREEMPT_RT=y#CONFIG_PREEMPT=y#CONFIG_KVM=y

Compile the kernel source, and update the Image file.

PC:~/renesas/04_Sources/myir-renesas-linux$ source /opt/remi-sdk/environment-setup-aarch64-poky-linuxPC:~/renesas/04_Sources/myir-renesas-linux$ make ARCH=arm64 mys_g2lx_defconfigPC:~/renesas/04_Sources/myir-renesas-linux$ make ARCH=arm64 Image dtbs   -j16

3. IGH Ethercat Master Station

Download the Ethercat source code version 1.5 from the official website, link as follows:

https://gitlab.com/etherlab.org/ethercat/-/tree/stable-1.5?ref_type=heads

Unzip the Ethercat source package to your working directory.

PC:~/renesas/04_Sources$ tar -xvf ethercat-stable-1.5.tar.bz2PC:~/renesas/04_Sources$ cd ethercat-stable-1.5

Load the environment variables.

PC:~/renesas/04_Sources/ethercat-stable-1.5$ source /opt/remi-sdk/environment-setup-aarch64-poky-linux

Generate the configure file.

PC:~/renesas/04_Sources/ethercat-stable-1.5$ ./bootstrap

Configure settings.

PC:~/renesas/04_Sources/ethercat-stable-1.5$ mkdir outputPC:~/renesas/04_Sources/ethercat-stable-1.5$ ./configure --prefix=/home/renesas/04_Sources/ethercat-stable-1.5/output --with-linux-dir=/home/renesas/04_Sources/myir-renesas-linux  --enable-8139too=no  --enable-generic=yes   --host=aarch64-poky-linux

Compile and install.

PC:~/renesas/04_Sources/ethercat-stable-1.5$ makePC:~/renesas/04_Sources/ethercat-stable-1.5$ make modulesPC:~/renesas/04_Sources/ethercat-stable-1.5$ make install

After compiling and installing, the generated ec_generic.ko driver file is located in the devices directory, the ec_master.ko driver file is located in the master directory, and the generated library-related files are located in the output directory.

PC:~/renesas/04_Sources/ethercat-stable-1.5$ ls devices/en_genric.kodevices/ec_generic.koPC:~/renesas/04_Sources/ethercat-stable-1.5$ master/ec_master.kodevices/ec_master.koPC:~/renesas/04_Sources/ethercat-stable-1.5$ ls output/bin etc  include  lib  sbin  share

Copy the related files in the output directory and ec_master.ko to the following directories on the development board:

root@myir-remi-1g:~/output# lsbin etc  include  lib  modules  sbin  shareroot@myir-remi-1g:~/output# cp bin/ethercat /bin/root@myir-remi-1g:~/output# cp etc/ethercat.conf /etc/root@myir-remi-1g:~/output# cp etc/init.d/*  /etc/init.droot@myir-remi-1g:~/output# cp -r etc/sysconfig/ /etc/root@myir-remi-1g:~/output# cp  lib/libethercat.* /lib64/root@myir-remi-1g:~/output# cp -r lib/pkgconfig /lib64/root@myir-remi-1g:~/output# cp modules/ec_master.ko /lib/modules/5.10.83-cip1-rt58-yocto-standard/root@myir-remi-1g:~/output# cp sbin/ethercatctl  /sbin/

Start the Ethercat.

root@myir-remi-1g:~# depmodroot@myir-remi-1g:~# modprobe ec_master main_devices=1E:ED:19:27:1A:B3root@myir-remi-1g:~# /etc/init.d/ethercat startStarting EtherCAT master 1.5.2 done

4. FreeRTOS

First, download the e2 studio tool and set up the environment and obtain the GPIO.zip project package from the 04_Sources directory. After opening the e2 studio tool, click File->Import->General-> Existing Projects into Workspace to import the GPIO project. After importing the project, click Project->Build Project to compile the project. For details, please refer to the “Remi Pi FreeRTOS Application Development Notes”.

If the compilation is successful, a debug directory will be generated, and the generated files should be copied to the SD card for calling the CM33 project in uboot.

GPIO_non_secure_code.binGPIO_non_secure_vector.binGPIO_secure_code.binGPIO_secure_vector.bin

The SD card should be inserted into the SD card slot of the development board, start the board and execute the following commands during the uboot stage to check the contents of the SD card, as follows:

=> switch_sdhi1 sdcardswitch to sdcard=> ls mmc 1:1System Volume Information/64   GPIO_secure_vector.bin16926   GPIO_non_secure_code.bin1984   GPIO_non_secure_vector.bin480   GPIO_secure_code.bin4 file(s), 1 dir(s)

Load the compiled firmware, as follows:

=> dcache off=> mmc dev 1switch to partitions #0, OKmmc1 is current device=> fatload mmc 1:1 0x0001FF80 GPIO_secure_vector.bin64 bytes read in 24 ms (2 KiB/s)=> fatload mmc 1:1 0x42EFF440 GPIO_secure_code.bin480 bytes read in 25 ms (18.6 KiB/s)=> fatload mmc 1:1 0x00010000 GPIO_non_secure_vector.bin1984 bytes read in 26 ms (74.2 KiB/s)=> fatload mmc 1:1 0x40010000 GPIO_non_secure_code.bin16926 bytes read in 29 ms (569.3 KiB/s)=> cm33 start_debug 0x1001FF80 0x00010000

After executing the above commands, you should see the blue light flashing.

Getting Started with Remi Pi: FreeRTOS and LVGL TutorialMil – Remi Pi’s loading effect display

3. Kernel List

Getting Started with Remi Pi: FreeRTOS and LVGL Tutorial

To facilitate users in porting the kernel, the source paths of various kernel driver modules are organized as follows:

Module

Description

Source Path

MMC
EMMC driver
drivers/mmc/host/renesas_sdhi_internal_dmac.c
SD
SD card driver
drivers/mmc/host/renesas_sdhi_internal_dmac.c
QSPI
MTD driver
drivers/memory/renesas-rpc-if.c
SPI
SPI driver
drivers/spi/spidev.c
I2C
I2C driver
drivers/i2c/busses/i2c-riic.c
ADC
ADC driver
drivers/iio/adc/rzg2l_adc.c
E2PROM
24C256C driver
drivers/misc/eeprom/at24.c
USB Host
USB driver
drivers/usb/host/ehci-platform.c
drivers/usb/host/ohci-platform.c
Ethernet
Gigabit network driver
drivers/net/ethernet/renesas/ravb_main.c
USB OTG
USB driver
drivers/phy/renesas/phy-rcar-gen3-usb2.c
RS232/RS485/Uart
Serial port driver
drivers/tty/serial/sh-sci.c
CAN BUS
CAN bus driver
drivers/net/can/rcar/rcar_canfd.c
GPIO KEY
KEY driver
drivers/input/keyboard/gpio_keys.c
WIFI
WIFI driver
drivers/staging/rtl88x2cs/*
RTC
RTC driver
drivers/rtc/rtc-rx8025t.c
GPIO LED
LED driver
drivers/leds/leds-gpio.c
HDMI/LVDS
MIPI to HDMI and LVDS driver
drivers/gpu/drm/bridge/lt8912.c
LCD
LCD driver
drivers/gpu/drm/panel/panel-simple.c
TOUCH
Touchscreen driver
drivers/input/touchscreen/edt-ft5x06.c
ES8388
ES8388 audio driver
sound/soc/codecs/es8328-i2c.c
OV5640
OV5640 camera driver
drivers/media/i2c/ov5640.c

4. Access Links

Getting Started with Remi Pi: FreeRTOS and LVGL Tutorial

Regarding the Remi Pi’s myir-image-core system, users can obtain the image files and source code from the following address:

Download link:http://down.myir-tech.com/RemiPi

Getting Started with Remi Pi: FreeRTOS and LVGL Tutorial

For information about the board, you can visit the following Mil Electronics official website link:

https://www.myir.cn/shows/23/14.html

For more discussions on technical issues regarding Remi Pi, please log in to the official Mil forum:

https://bbs.myir-tech.com/forum-66-1.html

Purchase link:
https://detail.tmall.com/item.htm?id=763219500729&skuId=5425000934998
(Tip: The public account does not support external links, please copy the link to the browser to open)
Mil Electronics released the first MPU ecological board from Renesas – Remi Pi, which sold out 200 sets on the day of launch, gaining favor from many new and old users. To thank everyone for their support, Miladded another 300 sets of Remi Pi activities, at a subsidized price of 198 yuan to give back to everyone, while supplies last!
Furthermore, this time Remi Pi released the myir-image-core system, which is lighter compared to the previously released comprehensive myir-image-full system suitable for HMI scenarios, and is very suitable for various industrial application scenarios, such as the RT-Linux real-time patch and Ethercat master station ported specifically for industrial control scenarios, LVGL ported specifically for lightweight industrial display scenarios, and the FreeRTOS real-time operating system ported for industrial real-time scenarios. The systems supported by Remi Pi will continue to be updated, and next month we will continue to launch Ubuntu and Debian systems for Remi Pi, stay tuned!
Getting Started with Remi Pi: FreeRTOS and LVGL Tutorial
———— END ————
Getting Started with Remi Pi: FreeRTOS and LVGL Tutorial

What is it like to develop a Cortex-M85 microcontroller using Keil?

Getting Started with Remi Pi: FreeRTOS and LVGL Tutorial

MCU High-Precision Rotary Transformer Motor Control Solution

Getting Started with Remi Pi: FreeRTOS and LVGL Tutorial

How to implement effective code protection measures during MCU product testing and operation stages

Leave a Comment

Your email address will not be published. Required fields are marked *