Building Demo for Xilinx R5

Hello,
I am trying to build FreeRtos full demo for cortext r5 and am unable to do so.
There are no project files that I could import into xilinx’s vitis SDK.
How do I build Full_Demo for cortex r5?
Regards
Mark

There is a Vitis demo, albeit for the Cortex-A9, here: FreeRTOS/FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702_Vitis_QEMU at main · FreeRTOS/FreeRTOS · GitHub - are you able to use that as a starting point? Also, I believe Xilinx’s tool create FreeRTOS projects directly.

I get following error when tryin to clone
fatal: …/FreeRTOS/FreeRTOS.git/info/refs not valid: is this a git repository?

That is a subfolder in a git repo. You can’t clone that URL directly, if that is what you are trying to do.

I think you might need to update your git client. See this blog post about git moving away from ‘dumb-http’.

If you are doing this from the command line, then the command you should run is:

git clone --recurse-submodules https://github.com/FreeRTOS/FreeRTOS.git ./FreeRTOS

It will clone the repository and bring in all the submodules consumed by the repository.

Hello
I get following error when trying to use above command
<won’t let me post the full link> not valid: is this a git repository?

I got it cloned and imported all 3 directories into Vitis. But cannot build. Has anyone successfully built for CORTEX R5 MPSoC? If so, can you please share information on how to build?
Thank you

I’ve successfully built in XSDK, but not tried in Vitis. What are the errors you see?

I cant import projects into vitis. I get following error

I tried importing all 3 projects into eclipse, however I get following errors when trying to build libs
:38 **** Build of project RTOSDemo_R5_bsp ****
make -k all
xsdps.c: In function ‘XSdPs_FrameCmd’:
xsdps.c:1272:11: warning: this statement may fall through [-Wimplicit-fallthrough=]
1272 | RetVal |= RESP_R1 | (u32)XSDPS_DAT_PRESENT_SEL_MASK;
xsdps.c:1273:3: note: here
1273 | case ACMD41:
| ^~~~
/opt/xilinx/petalinux/tools/xsct/gnu/armr5/lin/gcc-arm-none-eabi/bin/…/x86_64-oesdk-linux/usr/bin/arm-xilinx-eabi/arm-xilinx-eabi-ar.real: …/…/…/lib/libxil.a: No such file or directory
Makefile:31: recipe for target ‘xsdps_libs’ failed
make[1]: *** [xsdps_libs] Error 1
Makefile:29: recipe for target ‘psu_cortexr5_0/libsrc/sdps_v3_4/src/make.libs’ failed
make[1]: Target ‘libs’ not remade because of errors.
Running Make libs in psu_cortexr5_0/libsrc/cpu_cortexr5_v1_4/src
make: *** [psu_cortexr5_0/libsrc/sdps_v3_4/src/make.libs] Error 2
make -C psu_cortexr5_0/libsrc/cpu_cortexr5_v1_4/src -s libs “SHELL=/bin/sh” “COMPILER=armr5-none-eabi-gcc” “ARCHIVER=armr5-none-eabi-ar” “COMPILER_FLAGS= -O2 -c -mcpu=cortex-r5” “EXTRA_COMPILER_FLAGS=-g -DARMR5 -Wall -Wextra -mfloat-abi=hard -mfpu=vfpv3-d16”
Compiling cpu_cortexr5
Running Make libs in psu_cortexr5_0/libsrc/wdtps_v3_0/src
make -C psu_cortexr5_0/libsrc/wdtps_v3_0/src -s libs “SHELL=/bin/sh” “COMPILER=armr5-none-eabi-gcc” “ARCHIVER=armr5-none-eabi-ar” “COMPILER_FLAGS= -O2 -c -mcpu=cortex-r5” “EXTRA_COMPILER_FLAGS=-g -DARMR5 -Wall -Wextra -mfloat-abi=hard -mfpu=vfpv3-d16”
Compiling wdtps
/opt/xilinx/petalinux/tools/xsct/gnu/armr5/lin/gcc-arm-none-eabi/bin/…/x86_64-oesdk-linux/usr/bin/arm-xilinx-eabi/arm-xilinx-eabi-ar.real: …/…/…/lib/libxil.a: No such file or directory
Makefile:31: recipe for target ‘wdtps_libs’ failed
make[1]: *** [wdtps_libs] Error 1
make[1]: Target ‘libs’ not remade because of errors.
make: *** [psu_cortexr5_0/libsrc/wdtps_v3_0/src/make.libs] Error 2
Makefile:29: recipe for target ‘psu_cortexr5_0/libsrc/wdtps_v3_0/src/make.libs’ failed
Running Make libs in psu_cortexr5_0/libsrc/axipmon_v6_6/src
make -C psu_cortexr5_0/libsrc/axipmon_v6_6/src -s libs “SHELL=/bin/sh” “COMPILER=armr5-none-eabi-gcc” “ARCHIVER=armr5-none-eabi-ar” “COMPILER_FLAGS= -O2 -c -mcpu=cortex-r5” “EXTRA_COMPILER_FLAGS=-g -DARMR5 -Wall -Wextra -mfloat-abi=hard -mfpu=vfpv3-d16”
Compiling axipmon
/opt/xilinx/petalinux/tools/xsct/gnu/armr5/lin/gcc-arm-none-eabi/bin/…/x86_64-oesdk-linux/usr/bin/arm-xilinx-eabi/arm-xilinx-eabi-ar.real: …/…/…/lib/libxil.a: No such file or directory
Makefile:31: recipe for target ‘xaxipmon_libs’ failed
Makefile:29: recipe for target ‘psu_cortexr5_0/libsrc/axipmon_v6_6/src/make.libs’ failed
make[1]: *** [xaxipmon_libs] Error 1
make[1]: Target ‘libs’ not remade because of errors.
Running Make libs in psu_cortexr5_0/libsrc/iicps_v3_6/src
make -C psu_cortexr5_0/libsrc/iicps_v3_6/src -s libs “SHELL=/bin/sh” “COMPILER=armr5-none-eabi-gcc” “ARCHIVER=armr5-none-eabi-ar” “COMPILER_FLAGS= -O2 -c -mcpu=cortex-r5” “EXTRA_COMPILER_FLAGS=-g -DARMR5 -Wall -Wextra -mfloat-abi=hard -mfpu=vfpv3-d16”
make: *** [psu_cortexr5_0/libsrc/axipmon_v6_6/src/make.libs] Error 2
Compiling iicps
/opt/xilinx/petalinux/tools/xsct/gnu/armr5/lin/gcc-arm-none-eabi/bin/…/x86_64-oesdk-linux/usr/bin/arm-xilinx-eabi/arm-xilinx-eabi-ar.real: …/…/…/lib/libxil.a: No such file or directory
Makefile:31: recipe for target ‘xiicps_libs’ failed
make[1]: *** [xiicps_libs] Error 1
make[1]: Target ‘libs’ not remade because of errors.
make: *** [psu_cortexr5_0/libsrc/iicps_v3_6/src/make.libs] Error 2
Makefile:29: recipe for target ‘psu_cortexr5_0/libsrc/iicps_v3_6/src/make.libs’ failed
Running Make libs in psu_cortexr5_0/libsrc/coresightps_dcc_v1_4/src
make -C psu_cortexr5_0/libsrc/coresightps_dcc_v1_4/src -s libs “SHELL=/bin/sh” “COMPILER=armr5-none-eabi-gcc” “ARCHIVER=armr5-none-eabi-ar” “COMPILER_FLAGS= -O2 -c -mcpu=cortex-r5” “EXTRA_COMPILER_FLAGS=-g -DARMR5 -Wall -Wextra -mfloat-abi=hard -mfpu=vfpv3-d16”
Compiling coresightps_dcc
/opt/xilinx/petalinux/tools/xsct/gnu/armr5/lin/gcc-arm-none-eabi/bin/…/x86_64-oesdk-linux/usr/bin/arm-xilinx-eabi/arm-xilinx-eabi-ar.real: …/…/…/lib/libxil.a: No such file or directory
Makefile:31: recipe for target ‘coresightps_dcc_comp_libs’ failed
make[1]: *** [coresightps_dcc_comp_libs] Error 1
make[1]: Target ‘libs’ not remade because of errors.
Makefile:29: recipe for target ‘psu_cortexr5_0/libsrc/coresightps_dcc_v1_4/src/make.libs’ failed
make: *** [psu_cortexr5_0/libsrc/coresightps_dcc_v1_4/src/make.libs] Error 2
Running Make libs in psu_cortexr5_0/libsrc/usbpsu_v1_4/src
make -C psu_cortexr5_0/libsrc/usbpsu_v1_4/src -s libs “SHELL=/bin/sh” “COMPILER=armr5-none-eabi-gcc” “ARCHIVER=armr5-none-eabi-ar” “COMPILER_FLAGS= -O2 -c -mcpu=cortex-r5” “EXTRA_COMPILER_FLAGS=-g -DARMR5 -Wall -Wextra -mfloat-abi=hard -mfpu=vfpv3-d16”
Compiling usbpsu
xusbpsu_hibernation.c: In function ‘XUsbPsu_WakeupIntr’:
xusbpsu_hibernation.c:651:41: warning: implicit conversion from ‘enum ’ to ‘XusbPsuLinkStateChange’ [-Wenum-conversion]
651 | if (XUsbPsu_SetLinkState(InstancePtr, XUSBPSU_LINK_STATE_RECOV)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~
xusbpsu_hibernation.c:667:41: warning: implicit conversion from ‘enum ’ to ‘XusbPsuLinkStateChange’ [-Wenum-conversion]
667 | if (XUsbPsu_SetLinkState(InstancePtr, XUSBPSU_LINK_STATE_RECOV)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from xusbpsu.h:85,
from xusbpsu_hibernation.c:54:
xusbpsu_hw.h:376:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
376 | Xil_Out32((InstancePtr)->ConfigPtr->BaseAddress + (u32)(Offset), (u32)(Data))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xusbpsu_hibernation.c:659:3: note: in expansion of macro ‘XUsbPsu_WriteReg’
659 | XUsbPsu_WriteReg(InstancePtr, XUSBPSU_DCTL, RegVal);
| ^~~~~~~~~~~~~~~~
xusbpsu_hibernation.c:662:2: note: here
662 | case XUSBPSU_LINK_STATE_U3:
| ^~~~
/opt/xilinx/petalinux/tools/xsct/gnu/armr5/lin/gcc-arm-none-eabi/bin/…/x86_64-oesdk-linux/usr/bin/arm-xilinx-eabi/arm-xilinx-eabi-ar.real: …/…/…/lib/libxil.a: No such file or directory
make[1]: *** [xusbps_libs] Error 1
make[1]: Target ‘libs’ not remade because of errors.
Makefile:31: recipe for target ‘xusbps_libs’ failed
make: *** [psu_cortexr5_0/libsrc/usbpsu_v1_4/src/make.libs] Error 2
Makefile:29: recipe for target ‘psu_cortexr5_0/libsrc/usbpsu_v1_4/src/make.libs’ failed
make: Target ‘all’ not remade because of errors.

I download XSDK 2019.1. But I still get following error
/tools/Xilinx/SDK/2019.1/gnu/armr5/lin/gcc-arm-none-eabi/bin/…/lib/gcc/arm-none-eabi/8.2.0/…/…/…/…/arm-none-eabi/bin/ld: cannot find -lxil

I suspect the project didn’t import into Vitis successfully. I was going to try recreating the hardware project and BSP in Visit, then importing just the application, when I noticed the tools still have FreeRTOS support built in. The following is a dialog that is part of the “create a new platform project” wizard access from the Vitis IDE (Eclipse) menu. I selected the board, set the processor to R5 (defaults to A53), then as per this screenshot you can select a standalone project or a FreeRTOS project.

Hello
I did just that, but ran into lot of undefined. I am not sure what all to include and what all source code is needed.

Regards
Marc

Here is what I did to build the project in Vitis:

  1. Create clean workspace.
  2. File->new->platform project, and select the zcu102 board.
  3. Once the platform project is created, let it build. The resultant directory structure is different to that generated by XSDK, so you need to update some paths in the application project in later steps.
  4. Import just the RTOSDemo_R5 project from the FreeRTOS/Demo/CORTEX_R5_UltraScale_MPSoC directory of the FreeRTOS distribution - without copying it into the workspace. Ignore the warning that Vitis won’t manage the project because it wasn’t created in Vitis.
  5. Update the include path (in the build options within the IDE) to the new BSP location - which is ZynqMP_ZCU102_hw_platform\export\ZynqMP_ZCU102_hw_platform\sw\ZynqMP_ZCU102_hw_platform\standalone_domain\bspinclude\include
  6. Try building to find a build error where you need to remove the “const” from the line “extern const XScuGic_Config XScuGic_ConfigTable[];”
  7. Update the library search path (in project options within the IDE) to the new directory structure - you need to add ${workspace_loc:/ZynqMP_ZCU102_hw_platform/psu_cortexr5_0/standalone_domain/bsp/psu_cortexr5_0/lib}

Now the code should build - but I’ve not tried running it.

Thank you for the information

now I get following error
xilinx-workspace/zcu-r5-0-standalone/export/zcu-r5-0-standalone/sw/zcu-r5-0-standalone/standalone_domain/bspinclude/include/xparameters.h:22:10: fatal error: xparameters_ps.h: No such file or directory
22 | #include “xparameters_ps.h”

I try to add more to include path but keep getting unable to locate some header file or another.
Finally go it to build, but using freertos for domain (not standalone), now the binky demo tasks will not start executing

finally tasks started executing, however running full_main() gives following error
Xilinx Zynq MP First Stage Boot Loader
Release 2021.1 Nov 9 2022 - 09:27:23
PMU-FW is not running, certain applications may not be supported.
Pass, status code = 0, tick count = 5000
Error: Reg Test 2, status code = 1572866, tick count = 10000
ASSERT! Line 356 of file …/src/Full_Demo/main_full.c

Actually I had to stub out RegTest1 and RegTest2 and Math checks, since they are failing.

Seem like your issue is resolved now. Let us know if you need anything else. Thanks.