Table of Contents |
---|
Official RZG2L/UL Cortex-M33 Multi-OS Package
The firmware that runs on the CM33 requires the following tools for development. These tools can be hosted on a PC running Windows or Linux.
Renesas e2studio IDE supports application development and debugging for the Cortex-CM33
Please review the RZG2L Getting Started Guide. This document includes information about setting up the IDE for RZG2L/CM33 Development, loading, and running Cortex-CM33 Applications.
NOTE: For Windows user the compiler and Segger J-Link are installed as part of the installation. See Getting Started with Flexible Software Package Document.
NOTE: For Linux users the compiler and J-Link need to be installed separately as directed in the Getting Started with Flexible Software Package Document.
The Cortex-M33 supports the the Reness FSP ( Flexible Software Package ).The documents and FSP package can be found here. For Linux Users, follow the instruction in section 2.2 in the Getting Started with Flexible Software Package Document to install the FSP on the IDE.
RZV2L
RZG2L/UL
1) Download the FSP Package Archive (see above)
2) Extract the FSP to the e2studio installation directory. (i.e. /home/<user>/.local/share/renesas/e2studio)
3) The Extracted file should look like this
renesas
└── e2_studio
├── eclipse
├── fsp_documentation
├── internal
│ ├── devassist
│ └── projectgen
│ ├── ra
│ │ └── packs
│ └── rz_fsp
│ ├── rzg
│ └── rzv
set {int} 0x4102080C=0x1001FF80
set {int} 0x41020810=0x00010000
When e2studio attempts to connect to the target, it tries to run InitTarget() using the Cortex-A55. This small code gets loaded in the internal SRAM. If for whatever reason (e.g. security) the access to the internal SRAM is blocked, then the connect attempt fails:
Starting target connection
GDB action 'connect to target', has failed with error code, 0xffffffff
force_kill_gdb()
Disconnected from the Target Debugger.
and you may get the following message in the detailed log:
Connecting to target via JTAG
InitTarget() start
ERROR: Clocks could not be enabled.
ERROR: Cortex-M33 could not be enabled / released from reset.
InitTarget() end - Took 209ms
Connect failed. Resetting via Reset pin and trying again.
InitTarget() start
ERROR: Clocks could not be enabled.
ERROR: Cortex-M33 could not be enabled / released from reset.
InitTarget() end - Took 210ms
Cannot connect to target.
If, instead, the DDR is not configured yet or the access is blocked for whatever reason (again for example due to the security settings), then the connection succeeds but the Cortex-M33 code loading fails:
Target connection status - OK
Target connection status - OK
Starting download
GDB action 'write binary data', has failed with error report, Failed to write to memory
Disconnected from the Target Debugger.
This section describes how to add the Cortex-M33 Multi-OS Package to the yocto build. This package will add a command to uboot to start the CM33 processor and add the OpenAMP Multi Processor Communication Software to the Linux BSP.
The Open Asymmetric Multi-Processing (OpenAMP) is a framework providing the software components needed to enable the development of software applications for Asymmetric Multiprocessing (AMP) systems. This allows communications between Cortex M33 and Cortex-A cores.
The Multi-OS Package assume that only the BSP, Video Codec, and GPU are installed. By adding the Multi-OS package, it will overwrite the RZV2L BSP meta-rz_features layer.conf file. This will remove the DRP and/or ISP package configuration. Follow the steps below to add the MultiOS without removing the DRP and/or ISP packages
Expand | ||
---|---|---|
| ||
### Extract the BSP Linux package
..
### Copy/Move the 'RZV2L Codec Library v1.0.1' Zip file (RTK0EF0045Z15001ZJ-v1.0.1_EN.zip) under the BSP directory.
..
### Copy/Move the 'RZV2L ARM Mali-GPU Library v1.4' Zip file (RTK0EF0045Z13001ZJ-v1.4_EN.zip) under the BSP directory.
..
### Setup the RZV2L MultiOS CM33 under the BSP, Codex and GPU directory.
### Install the and boot commands OpenAMP library
unzip $SRC_DIR/r01an6238ej0110-rzv2l-cm33-multi-os-pkg.zip
tar -zxvf r01an6238ej0110-rzv2l-cm33-multi-os-pkg/meta-rz-features.tar.gz
### Extract the 'DRP-AI Driver Support' package file (meta-rz-features.tar.gz) under the rzv2l_drpai-driver directory.
..
### Copy/Move the ISP Support archive file ( r11an0561ej<version>-rzv2l-isp-sp.zip )
..
### Reinsert the MultiOS recipe into the meta-rz-features/conf/layers.conf
cd $WORK_DIR
sed -i '/demos.inc/a include ${LAYERDIR}/include/openamp/openamp.inc' ./meta-rz-features/conf/layer.conf
cd $WORK_DIR
source poky/oe-init-build-env
cp ../meta-renesas/docs/template/conf/smarc-rzv2l/*.conf ./conf/
### Build
bitbake core-image-weston |
Verification
If the Cortex-M33 Multi-OS was correctly added the meta-rz-features/conf/layers.conf file show include the following lines located neat the top of the file.
include ${LAYERDIR}/include/demos/demos.inc
include ${LAYERDIR}/include/openamp/openamp.inc
Full file
Expand | ||
---|---|---|
| ||
include ${LAYERDIR}/include/graphic/feature.inc include ${LAYERDIR}/include/codec/plugin.inc include ${LAYERDIR}/include/demos/demos.inc include ${LAYERDIR}/include/openamp/openamp.inc LAYERDEPENDS_rz-features = "rzg2" BBPATH .= ":${LAYERDIR}" BBFILE_COLLECTIONS += "rz-features" BBFILE_PATTERN_rz-features := "^${LAYERDIR}/"
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ ${LAYERDIR}/recipes-*/*.bb \
${LAYERDIR}/recipes-*/*.bbappend \
${LAYERDIR}/recipes-*/*/*.bbappend" |
The FreeRTOS Configuration files are generated by the FSP Smart Configurator. Component Settings can only be viewed in the Stack Configuration Window. The FreeRTOS Component Configurations are in the MainTask ( or any Task ) properties. To access this properties do the following.
1) Make sure you have a properties window open Menu Window -> Show View -> Properties
2) Open the configuration.xml file using the default editor. This will open the Smart Configurator.
3) In the Smart Configurator Open the Stack Tab.
Select Stack Tab
Image Modified
4) In the Stack Configuration Window Select the Main Task ( actually any task will work )
Image ModifiedProject Stack Configuration Outline
5) The properties window should show the following
Image ModifiedTask Stack Properties
6) Expand the General Settings. This is the FreeRTOS settings. Modification to these settings effect all tasks.
Image Modified
General FreeRTOS Configurations
These demos are created when a new eclipse project is created. The procedure to create the demos is well documented in the Getting Started with Flexible Software Package. The main difference between these two projects is the Minimal Project includes the minimal FSP Driver components to run the OS or Baremetal project. The Blinky adds GPIO and tImer components to blink the leds.
Compiler errors:
Image ModifiedRenesas Toolchain Management
Make sure that you are using the correct GNU GCC Compiler version. The compiler used for the RZ is not the same as the RA. Refer to Development Environment section of this page to make sure the correct compiler is installed.
Image Modified
Check the correct Board:
When creating a project be sure to select the EVK board in the Device and Tools Selection Dialog. Once the EVK is selected the Device will automatically be selected. This is important of the Blink Demo.
This demo is included in the Multi-OS Package Yocto Package. Download this package from the Official Cortex-M33 Multi-OS website listed General Information. This demo requires that the Multi-OS Package was included in the Yocto BSP Build. See Yocto Build Getting Started.
Step 1) Import the project
Step 2) Compile the project. If there are compiler errors check the FAQ for the Blinky and Minimal Demos.
Step 3) The following are the generated binaries
Step 4) Boot the RZ board but press key when prompted so we are in the bootloader
Step 5) Enter the following commands. These command expect the binaries are on partition 1 (mmc 1:N N=1).
dcache off
mmc dev 1
fatload mmc 1:1 0x0001FF80 rzv2l_cm33_rpmsg_demo_secure_vector.bin
fatload mmc 1:1 0x42EFF440 rzv2l_cm33_rpmsg_demo_secure_code.bin
fatload mmc 1:1 0x00010000 rzv2l_cm33_rpmsg_demo_non_secure_vector.bin
fatload mmc 1:1 0x40010000 rzv2l_cm33_rpmsg_demo_non_secure_code.bin
cm33 start_debug 0x1001FF80 0x00010000
dcache on
This is the expected output. NOTE Except for the filenames, the RZG will be the same.
=> dcache off
=> mmc dev 1
=> fatload mmc 1:1 0x0001FF80 rzv2l_cm33_rpmsg_demo_secure_vector.bin
64 bytes read in 11 ms (4.9 KiB/s)
=> fatload mmc 1:1 0x42EFF440 rzv2l_cm33_rpmsg_demo_secure_code.bin
400 bytes read in 11 ms (35.2 KiB/s)
=> fatload mmc 1:1 0x00010000 rzv2l_cm33_rpmsg_demo_non_secure_vector.bin
1984 bytes read in 12 ms (161.1 KiB/s)
=> fatload mmc 1:1 0x40010000 rzv2l_cm33_rpmsg_demo_non_secure_code.bin
42352 bytes read in 17 ms (2.4 MiB/s)
=> cm33 start_debug 0x1001FF80 0x00010000
=> dcache on
Step5 ) Enter the boot commad
The OpenAMP Cortex-A Application Yocto recipe is built and added to the RZ Linux file system as part of the Yocto build.
To compile the project with SDK see FAQ below.
Just call the following binary
./rpmsg_sample_client 0
Expected output
root@smarc-rzv2l:~# ./rpmsg_sample_client 0
Successfully probed IPI device
metal: info: metal_uio_dev_open: No IRQ for device 42f00000.rsctbl.
Successfully open uio device: 42f00000.rsctbl.
Successfully added memory device 42f00000.rsctbl.
metal: info: metal_uio_dev_open: No IRQ for device 43000000.vring-ctl0.
Successfully open uio device: 43000000.vring-ctl0.
Successfully added memory device 43000000.vring-ctl0.
metal: info: metal_uio_dev_open: No IRQ for device 43200000.vring-shm0.
Successfully open uio device: 43200000.vring-shm0.
Successfully added memory device 43200000.vring-shm0.
metal: info: metal_uio_dev_open: No IRQ for device 42f01000.mhu-shm.
Successfully open uio device: 42f01000.mhu-shm.
Successfully added memory device 42f01000.mhu-shm.
Initialize remoteproc successfully.
creating remoteproc virtio
initializing rpmsg shared buffer pool
initializing rpmsg vdev
1 - Send data to remote core, retrieve the echo and validate its integrity ..
Remote proc init.
RPMSG endpoint has created.
RPMSG service has created.
sending payload number 0 of size 17
echo test: sent : 17
received payload number 0 of size 17
sending payload number 1 of size 18
echo test: sent : 18
received payload number 1 of size 18
sending payload number 2 of size 19
.
.
requirements
The Yocto SDK is required to compile this application. Refer to the RZV and RZG page on how to build the SDK.
Step 1) The Application is located in the following directory. Open terminal in this directory
<yocto buidl directory>/meta-rz-features/recipes-example/rpmsg-sample/rpmsg- sample-0.1/
Step 2) Initialize the Yocto SDK
Step 3) run make
Step 4) When the compilation is complete the binary rpmsg_sample_client is generated. Transfer this to your board.
The message channel defined in the FSP must be the same as the message channel used on the linux side. Below is the method for setting the channels.
On the e2studio Open the FSP Smart Configurator to set the processor channel on the MHU component. TheMHU (Message Handle Unit) is the hardware IP used by OpenAM middleware to send messages. See image.
Image Modified
Open the CM33 OpenAMP Project rz<g/v/>2l_cm33_rpmsg_demo FSP Smart Configuration to set the OpenAMP Processor. This setting must match the chnnel selected on the Linux side.
On Linx Side the first command argument must match the setting on the CM33. The first argument in the command below sets the channel to 0
./rpmsg_sample_client 0
Table of Contents |
---|