cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
davidsummers
Contributor
Contributor
235 Views
Registered: ‎05-18-2015

Zynq MPSOC FSBL fails to build with error cp: cannot create regular file Invalid argument

I am having issues very similar to this post  Zynq FSBL fails to build   by @jeffrey.johnson 

@marcb asked me to create a new thread for my issue, so here it is.

 

I am using Vitis 2020.2, Windows 10, target is a Zynq US+ MPSOC, target processor psu_cortexa53_0.  My software application uses freertos and lwip.

 

 Each time I try to build my platform/bsp I get the "cp: cannot create regular file ...  Invalid argument" error.  The error is for a different file each time.   If I build the platform multiple times, it will eventually build successfully.  The error always occurs while building the FSBL.  The error only seems to occur when I include the lwip library.   I can create an build the freertos hello world app just fine, but I get errors when I create and build the freertos lwip echo server app.

The error always points to a file needed by lwip, and always occurs during build of the FSBL. My FSBL does not use lwip, and I have not modified the FSBL source code from the auto generated FSBL.

If I use the GUI "New Application Project" wizard to create a freertos lwip echo server application, then it compiles correctly without error as long as I do not modify any BSP settings.  If I change any BSP settings that require the platform to go "out of date" then I get the "cp: cannot create regular file ...  Invalid argument" error when I try to build the platform/bsp.

If I use TCL commands to create my platform, the error occurs right away even if I make no changes to the BSP.

The issue occurs with my own custom XSA file, and also occurs with the built in ZCU102 board file that comes with Vitis.

The issue goes away if I move my Vitis workspace to a USB flash drive mapped as "D:\"

The error occurs if I target the A53 or the R5 processor.

If my Vitis workspace is anywhere on the C: drive, this error occurs.  I have tried it in multiple folder locations.

 

The following TCL commands recreate the issue every time on my laptop:

platform create -name ADL_FPGA_TE0802_bd_wrapper_2 -hw zcu102 -arch {64-bit} -proc {psu_cortexa53_0} 

domain create -name {freertos10_xilinx_psu_cortexa53_2} -display-name {freertos10_xilinx_psu_cortexa53_2} -os {freertos10_xilinx} -proc {psu_cortexr5_0} -runtime {cpp} -support-app {freertos_lwip_echo_server}
platform generate 

app create -name zynq_te0802_2 -platform ADL_FPGA_TE0802_bd_wrapper_2 -domain freertos10_xilinx_psu_cortexa53_2 -template {FreeRTOS Hello World}
app build -name zynq_te0802_2

 

 @marcb These commands were cut and pasted from your reply to the other thread.  I only changed the -hw argument to the zcu102 instead of passing the XSA in as a parameter.   These commands cause the error on my laptop.  (The mix of "A53" and "R5" nomenclature is from marcb's version of the script, no mine.  My original script targeted the A53, but the error occurs for either processor)

 

This was my original script from the other thread:

platform create -name ADL_FPGA_TE0802_bd_wrapper -hw zcu102 -arch {64-bit} -fsbl-target {psu_cortexa53_0} 
domain create -name {freertos10_xilinx_psu_cortexa53_0} -display-name {freertos10_xilinx_psu_cortexa53_0} -os {freertos10_xilinx} -proc {psu_cortexa53_0} -runtime {cpp} -arch {64-bit} -support-app {freertos_lwip_echo_server}
platform generate 
app create -name zynq_te0802 -platform ADL_FPGA_TE0802_bd_wrapper -domain freertos10_xilinx_psu_cortexa53_0 -template {FreeRTOS Hello World}
app build -name zynq_te0802

The same TCL script builds correctly on another laptop that I tested (also Widows 10, Vitis 2020.2, folder C:\test1 )  On this other laptop I can also change BSP settings and rebuild without errors. ie: Vitis works as expected on another computer with the same corporate image (same anti-virus, same Windows updates, etc)  

 

The same TCL script builds correctly on my drive (USB flash drive)

I removed and re-installed Vitis, but the issue still remains.

The work-around for the issue is to build the platform over and over again until the build passes.  This usually requires between 4 and 6 tries and must be repeated if I modify any BSP settings.

I suspect that this issue is only occurring on a small number of user computers and might be a conflict with some other software application installed. 

@marcb I am not attaching my XSA file since it is not necessary to reproduce the issue.  The built in ZCU102 platform works to cause the issue.  

 

Here is an example error message.   Each time I build, the file name that fails is different.

"Running Make include in psu_cortexr5_0/libsrc/uartps_v3_10/src"

make -C psu_cortexr5_0/libsrc/ttcps_v3_12/src -s include  "SHELL=CMD" "COMPILER=armr5-none-eabi-gcc" "ASSEMBLER=armr5-none-eabi
-as" "ARCHIVER=armr5-none-eabi-ar" "COMPILER_FLAGS=  -O2 -c -mcpu=cortex-r5" "EXTRA_COMPILER_FLAGS=-g -DARMR5 -Wall -Wextra -mf
loat-abi=hard -mfpu=vfpv3-d16"

cp: cannot create regular file `../../../include/lwip/prot/nd6.h': Invalid argument

make -C psu_cortexr5_0/libsrc/uartps_v3_10/src -s include  "SHELL=CMD" "COMPILER=armr5-none-eabi-gcc" "ASSEMBLER=armr5-none-eab
i-as" "ARCHIVER=armr5-none-eabi-ar" "COMPILER_FLAGS=  -O2 -c -mcpu=cortex-r5" "EXTRA_COMPILER_FLAGS=-g -DARMR5 -Wall -Wextra -m
float-abi=hard -mfpu=vfpv3-d16"

make[2]: *** [Makefile:43: liblwip4_includes] Error 1

make[1]: *** [Makefile:42: psu_cortexr5_0/libsrc/lwip211_v1_3/src/make.include] Error 2
make[1]: *** Waiting for unfinished jobs....

make: *** [Makefile:19: all] Error 2

Failed to build  the bsp sources for domain - freertos10_xilinx_psu_cortexa53_2

Failed to generate the platform.
Reason: Failed to build  the bsp sources for domain - freertos10_xilinx_psu_cortexa53_2

xsct% 

 

 

 

 

 

0 Kudos
2 Replies
marcb
Moderator
Moderator
201 Views
Registered: ‎05-08-2012

Hi @davidsummers 

I tried reproducing the issue, this time with installation zcu102 XSA, and with the updated commands above, but still was able to compile successfully. After reviewing older issues, I see that these types of errors can happen when read and write permissions are not available within either the workspace (and any remote sources), and the Vitis installation directory. I can only reproduce by setting the platform directory as read-only. Can you check the permissions under the platform path in question under ../../../include? Also, is there any software installed that could be affecting the file permissions?

---------------------------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
---------------------------------------------------------------------------------------------
0 Kudos
davidsummers
Contributor
Contributor
140 Views
Registered: ‎05-18-2015

Today my project is building without errors.  Very strange.  I did not change anything that I am aware of.

Permissions sort of makes sense, but it seems strange to me that the error seems to be a "soft error" in that if I try building enough times it eventually passes.  If Vitis die not have permissions to write to that folder, then it seems like it would always fail.

 

I do not see anything strange in regards to the permissions in the destination folder for the lwip source, but then again I am not getting the error today.

 

0 Kudos