# Building Demo for Xilinx R5

**URL:** <https://forums.freertos.org/t/building-demo-for-xilinx-r5/16119>\
**Category:** Libraries\
**Created:** [November 4, 2022, 5:05pm UTC](https://forums.freertos.org/t/building-demo-for-xilinx-r5/16119 "2022-11-04T17:05:55Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcjem](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@marcjem](https://forums.freertos.org/u/marcjem)\
**Post date:** [November 4, 2022, 5:05pm UTC](https://forums.freertos.org/t/building-demo-for-xilinx-r5/16119/1 "2022-11-04T17:05:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [November 4, 2022, 5:22pm UTC](https://forums.freertos.org/t/building-demo-for-xilinx-r5/16119/2 "2022-11-04T17:22:26Z")

</div>

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](https://github.com/FreeRTOS/FreeRTOS/tree/main/FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702_Vitis_QEMU) - are you able to use that as a starting point? Also, I believe Xilinx’s tool create FreeRTOS projects directly.

---

<div class="post-metadata">

**Author:** ![marcjem](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@marcjem](https://forums.freertos.org/u/marcjem)\
**Post date:** [November 4, 2022, 5:54pm UTC](https://forums.freertos.org/t/building-demo-for-xilinx-r5/16119/3 "2022-11-04T17:54:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [November 4, 2022, 7:21pm UTC](https://forums.freertos.org/t/building-demo-for-xilinx-r5/16119/4 "2022-11-04T19:21:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kanherea](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/kanherea/32/4106_2.png) [@kanherea](https://forums.freertos.org/u/kanherea)\
**Post date:** [November 4, 2022, 7:22pm UTC](https://forums.freertos.org/t/building-demo-for-xilinx-r5/16119/5 "2022-11-04T19:22:35Z")

</div>

I think you might need to update your git client. See [this blog post](https://github.blog/2011-03-09-git-dumb-http-transport-to-be-turned-off-in-90-days/) about git moving away from ‘dumb-http’.

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![marcjem](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@marcjem](https://forums.freertos.org/u/marcjem)\
**Post date:** [November 5, 2022, 12:59pm UTC](https://forums.freertos.org/t/building-demo-for-xilinx-r5/16119/6 "2022-11-05T12:59:24Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![marcjem](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@marcjem](https://forums.freertos.org/u/marcjem)\
**Post date:** [November 5, 2022, 1:52pm UTC](https://forums.freertos.org/t/building-demo-for-xilinx-r5/16119/7 "2022-11-05T13:52:42Z")

</div>

> [@kanherea](#):
>
> `git clone --recurse-submodules https://github.com/FreeRTOS/FreeRTOS.git ./FreeRTOS`

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

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [November 5, 2022, 5:15pm UTC](https://forums.freertos.org/t/building-demo-for-xilinx-r5/16119/8 "2022-11-05T17:15:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![marcjem](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@marcjem](https://forums.freertos.org/u/marcjem)\
**Post date:** [November 7, 2022, 3:18pm UTC](https://forums.freertos.org/t/building-demo-for-xilinx-r5/16119/9 "2022-11-07T15:18:38Z")

</div>

I cant import projects into vitis. I get following error

---

<div class="post-metadata">

**Author:** ![marcjem](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@marcjem](https://forums.freertos.org/u/marcjem)\
**Post date:** [November 7, 2022, 3:53pm UTC](https://forums.freertos.org/t/building-demo-for-xilinx-r5/16119/10 "2022-11-07T15:53:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![marcjem](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@marcjem](https://forums.freertos.org/u/marcjem)\
**Post date:** [November 8, 2022, 2:57pm UTC](https://forums.freertos.org/t/building-demo-for-xilinx-r5/16119/11 "2022-11-08T14:57:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [November 8, 2022, 9:54pm UTC](https://forums.freertos.org/t/building-demo-for-xilinx-r5/16119/12 "2022-11-08T21:54:41Z")

</div>

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.

 ![image](https://d2v6vdsk2p900z.cloudfront.net/original/2X/5/58f662ae5d893952ebe13925574f30387ffc52dd.png)

---

<div class="post-metadata">

**Author:** ![marcjem](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@marcjem](https://forums.freertos.org/u/marcjem)\
**Post date:** [November 8, 2022, 10:43pm UTC](https://forums.freertos.org/t/building-demo-for-xilinx-r5/16119/13 "2022-11-08T22:43:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [November 8, 2022, 11:17pm UTC](https://forums.freertos.org/t/building-demo-for-xilinx-r5/16119/14 "2022-11-08T23:17:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![marcjem](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@marcjem](https://forums.freertos.org/u/marcjem)\
**Post date:** [November 9, 2022, 6:52am UTC](https://forums.freertos.org/t/building-demo-for-xilinx-r5/16119/15 "2022-11-09T06:52:12Z")

</div>

Thank you for the information

---

<div class="post-metadata">

**Author:** ![marcjem](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@marcjem](https://forums.freertos.org/u/marcjem)\
**Post date:** [November 9, 2022, 9:14am UTC](https://forums.freertos.org/t/building-demo-for-xilinx-r5/16119/16 "2022-11-09T09:14:36Z")

</div>

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”

---

<div class="post-metadata">

**Author:** ![marcjem](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@marcjem](https://forums.freertos.org/u/marcjem)\
**Post date:** [November 9, 2022, 9:30am UTC](https://forums.freertos.org/t/building-demo-for-xilinx-r5/16119/17 "2022-11-09T09:30:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![marcjem](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@marcjem](https://forums.freertos.org/u/marcjem)\
**Post date:** [November 9, 2022, 9:57am UTC](https://forums.freertos.org/t/building-demo-for-xilinx-r5/16119/18 "2022-11-09T09:57:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![marcjem](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@marcjem](https://forums.freertos.org/u/marcjem)\
**Post date:** [November 9, 2022, 2:25pm UTC](https://forums.freertos.org/t/building-demo-for-xilinx-r5/16119/19 "2022-11-09T14:25:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![aggarg](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/aggarg/32/4245_2.png) [@aggarg](https://forums.freertos.org/u/aggarg)\
**Post date:** [November 13, 2022, 9:28am UTC](https://forums.freertos.org/t/building-demo-for-xilinx-r5/16119/20 "2022-11-13T09:28:20Z")

</div>

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

[Next page](https://forums.freertos.org/t/building-demo-for-xilinx-r5/16119.md?page=2)
