UPGRADE YOUR BROWSER
We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!
03-24-2017 10:34 AM
So, I'm getting used to Petalinux, and understand how to patch things like the linux kernel and u-boot.
However, I also need to customzie the FSBL build. For example, I want to add some more debug messages, turn on debug logging (which depends on a #define), and also do a debug build.
On the first two items, I had hoped that it would be a similar process as with the kernel and u-boot...i.e. make code changes in the git clone, create the patches, make changes to the appropriate bbappend file, yada yada.
However, I can't seem to do this with the fsbl, as unless I'm missing something, it doesn't use a local git repository. It appears to fetch the files...but not in a way that allows patching.
How do I 1) patch the source code to my liking and 2) Actually build in debug mode?
I know I could always create an FSBL in the Xilinx SDK, shuttle it over to my images directory, and petalinx-image against it...but it seems like petalinux should allow me to do as I describe. If I'm going to use petalinux, I'd prefer to use it for everything.
In fact as far as building in debug mode, I'm not sure exactly how to do that for Linux or u-boot. Is this possible within petalinux? If so, how?
Thanks,
Dave
03-26-2017 08:43 AM
Please check whether any of the below Answer Record is useful for you
https://www.xilinx.com/support/answers/66853.html
https://www.xilinx.com/support/answers/68057.html
03-28-2017 08:15 AM
Ummmm....I'm not sure these are pointing to what you intended.
The first one seems to point to nowhere, as I end up at the support home page. The second are the release notes for petalinux 2016.3.
Is that what you meant to do? Am I missing something?
Dave
03-29-2017 02:43 AM
I have the exact same issue with the inconsistency.
You can use the "older" method: Creating a New Zynq FSBL.
And modify the source there and build.
Then add it to your boot image using:
petalinux-package --boot --u-boot --fsbl directory/to/fsbl.elf
You'd probably need to add the FSBL as an "application" to allow it to compile with the rest of the project - a bit of of a manual process. Hope it helps.
03-29-2017 03:35 AM
09-21-2017 05:20 AM
Hi
If your Petalinux equal or later than 2017.1, the following solution should work for you
Working with a user space Yocto layer-How to patch FSBL in v2017.1 PetaLinux Project
I have worked with this solution on Petalinux 2017.2
Regards,
Sherman
11-15-2017 05:27 AM - edited 11-15-2017 05:27 AM
thanks @sherman_hsu, that's a great tip!
I'm just wondering how to create such a patch file.
Let's say I want to enable the debug info output of the FSBL on the COM port. In SDK, this could be done as follows :
Now if I understand you correctly, this can be somehow done from Petalinux too, using some patch file.
Now I'm wondering how to create such patch file?
Also, can the actual FSBL source be seen somewhere in a petalinux project? Like in the build folder?
11-15-2017 10:28 AM
I haven't worked with the FSBL very much in the Yocto builds but you can find the source after building in the build dir, something like this:
build/tmp/work/zcu102_zynqmpnapa-poky-linux/fsbl/2017.2+gitAUTOINC+122565ec40-r0/git/lib/sw_apps/zynq_fsbl/src
and it gets the source from, https://github.com/Xilinx/embeddedsw.git. the rule is in meta-xilinx-tools/recipes-bsp/fsbl
The other way I used to do it was generate the build using the hdf and the hsi tool. I'm not really sure where this source came from but once it was generated I could just manually modify it and build it with make. It's probably better to figure out the Yocto method at this point.
jeff
11-16-2017 08:40 PM
Hi @ronnywebers,
Refer http://www.wiki.xilinx.com/PetaLinux+Yocto+Tips I have added some steps to enable the debugs in FSBL and PMUFW.
Also here the steps to create the git patch.
$ git clone https://github.xilinx.com/embeddedsw/embeddedsw.git $ git checkout tags/xilinx-v2017.2 $ git branch myembsw_2017.2 $ git checkout myembsw_2017.2 $ vim lib/sw_apps/zynqmp_pmufw/src/xpfw_mod_em.c //Modify the source $ git add lib/sw_apps/zynqmp_pmufw/src/xpfw_mod_em.c $ git commit -s $ git format-patch -1
03-03-2018 01:49 AM
I must be stupid, but I still don't get it. Just like the people above I want the FSBL to be more verbose. I cannot believe I have to create a patch file for that. A simple -DFSBL_DEBUG compiler flag should be enough. So using petalinux 2017.4 I tried:
$ mkdir -p <plnx-proj-root>/project-spec/meta-user/recipes-bsp/fsbl
I don't think I need a files dir, but if I do, please explain.
$ vim <plnx-proj-root>/project-spec/meta-user/recipes-bsp/fsbl/fsbl_%.bbappend
#Enable appropriate FSBL debug flags YAML_COMPILER_FLAGS_append = " -DFSBL_DEBUG"
Why would this fail? It builds alright, but I get no verbose output.
03-09-2018 07:56 PM - edited 03-11-2018 01:58 PM
Hi @vanmierlo,
After you enable the debug flags run this following commands. Refer http://www.wiki.xilinx.com/PetaLinux+Yocto+Tips
$ petalinux-build -x mrproper $ rm -rf <plnx-proj-root>/components/plnx_workspace $ petalinux-build
03-10-2018 12:40 PM
03-16-2018 06:20 AM
Well, I had tried that and it seemed not to work. That was why I was asking here in the first place.
But now I see that it does work. I'm beginning to think that maybe the FSBL was writing to one of my other UARTs which are implemented in the PL.
Thanks for sticking with me.
06-08-2019 06:49 AM
Just for enabling debug messages below procedure worked for me:
mkdir -p <plnx-proj-root>/project-spec/meta-user/recipes-bsp/fsbl nano <plnx-proj-root>/project-spec/meta-user/recipes-bsp/fsbl/fsbl_%.bbappend
Then Add the following to the file:
#Enable appropriate FSBL debug flags YAML_COMPILER_FLAGS_append = " -DFSBL_DEBUG"
Now, do the following to build the new FSBL.
petalinux-build -x mrproper rm -rf <plnx-proj-root>/components/plnx_workspace petalinux-buildNow you can find the newly compiled fsbl in your images/linux directory. Now use the following command to make the BOOT.BIN file.
petalinux-package --boot --fsbl images/linux/zynq_fsbl.elf --fpga images/linux/<fpga>.bit --u-boot
10-11-2019 11:22 AM
Hi @stephenm @sandeepg @wicky_waka ,
The debug flag as below is not working for me.
#Enable appropriate FSBL debug flags YAML_COMPILER_FLAGS_append = " -DFSBL_DEBUG"
I looked at http://www.wiki.xilinx.com/PetaLinux+Yocto+Tips, but did not find a similar flag. I am assuming the flag has been modified to:
#Add debug for FSBL XSCTH_BUILD_DEBUG = "1"
Is this correct?
10-15-2019 11:21 AM
Hi @maju42
There is not such flags called -DFSBL_DEBUG you need to fill this content with appropriate flags such as
#Add debug for FSBL XSCTH_BUILD_DEBUG = "1"YAML_COMPILER_FLAGS_append =
" -DXPS_BOARD_ZCU102 -DFSBL_PROT_BYPASS_EXCLUDE"
For more details refer https://github.com/Xilinx/embeddedsw/blob/master/lib/sw_apps/zynqmp_fsbl/src/xfsbl_config.h
Make sure you checkout the right release version in above link.
10-16-2019 02:16 AM
@sandeepg wrote:
There is not such flags called -DFSBL_DEBUG
This is wrong as general as it is written here. This is exactly the right flag for Zynq.
But for ZynqMP things could be different.