cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP15 ECO 5.0.0 unable to generate FIP bin files due to TF-A / Optee build tool issues

debugging
Lead

After building the TF-A from ECU 5.0.0 download (not the git). found the FIP folder and bin files. Deleted the FIP folder (export FIP_DEPLOYDIR_ROOT=$PWD/../../FIP_artifacts 

After running $ make -f $PWD/../Makefile.sdk all again the FIP folder and files are not generated anymore.Also tried make clean but no resolve.

Deleted the tf-a folder, restarted everything again (untar the tar etc...and followed all from the readme again ) but still not FIP folder or  files are generated, even the build does report the files were generate (see below output)

# for some reason this does not create the FIP folder and files  after the 1st time run ! it also delets the FIP_artifacts /arm... folder if run for a 2nd time ! this is the same with optee. Why is this designed this way ? the solution might be never ever run this:

$ make -f $PWD/../Makefile.sdk all

# for some reason this creates the FIP folder and output files but does not create default binaries

$ make -f $PWD/../Makefile.sdk DEPLOYDIR=$FIP_DEPLOYDIR_ROOT/arm-trusted-firmware all

How to regenerate FIP bin files to flash ?????

fiptool-stm32mp config:
optee:
bl32 config value: optee
devicetree config: stm32mp157c-ed1 stm32mp157f-ed1 stm32mp157a-ev1 stm32mp157c-ev1 stm32mp157d-ev1 stm32mp157f-ev1 stm32mp135f-dk stm32mp157a-dk1 stm32mp157d-dk1 stm32mp157c-dk2 stm32mp157f-dk2

Switch configuration:
FIP_BL31_ENABLE :

Output folders:
FIP_DEPLOYDIR_ROOT : /media/user/H3D2P1/Tools/STM32MP1/STM_ECO_5.0.0/Developer-Package/linux/stm32mp1-openstlinux-6.1-yocto-mickledore-mp1-v23.06.21/sources/arm-ostl-linux-gnueabi/tf-a-stm32mp-v2.8.6-stm32mp-r1-r0/tf-a-stm32mp-v2.8.6-stm32mp-r1/../../FIP_artifacts
FIP_DEPLOYDIR_FIP : /media/user/H3D2P1/Tools/STM32MP1/STM_ECO_5.0.0/Developer-Package/linux/stm32mp1-openstlinux-6.1-yocto-mickledore-mp1-v23.06.21/sources/arm-ostl-linux-gnueabi/tf-a-stm32mp-v2.8.6-stm32mp-r1-r0/tf-a-stm32mp-v2.8.6-stm32mp-r1/../../FIP_artifacts/fip
FIP_DEPLOYDIR_TFA : /media/user/H3D2P1/Tools/STM32MP1/STM_ECO_5.0.0/Developer-Package/linux/stm32mp1-openstlinux-6.1-yocto-mickledore-mp1-v23.06.21/sources/arm-ostl-linux-gnueabi/tf-a-stm32mp-v2.8.6-stm32mp-r1-r0/tf-a-stm32mp-v2.8.6-stm32mp-r1/../deploy/bl32
FIP_DEPLOYDIR_BL31 : /media/user/H3D2P1/Tools/STM32MP1/STM_ECO_5.0.0/Developer-Package/linux/stm32mp1-openstlinux-6.1-yocto-mickledore-mp1-v23.06.21/sources/arm-ostl-linux-gnueabi/tf-a-stm32mp-v2.8.6-stm32mp-r1-r0/tf-a-stm32mp-v2.8.6-stm32mp-r1/../deploy/bl31
FIP_DEPLOYDIR_FWCONF: /media/user/H3D2P1/Tools/STM32MP1/STM_ECO_5.0.0/Developer-Package/linux/stm32mp1-openstlinux-6.1-yocto-mickledore-mp1-v23.06.21/sources/arm-ostl-linux-gnueabi/tf-a-stm32mp-v2.8.6-stm32mp-r1-r0/tf-a-stm32mp-v2.8.6-stm32mp-r1/../deploy/fwconfig
FIP_DEPLOYDIR_OPTEE : /media/user/H3D2P1/Tools/STM32MP1/STM_ECO_5.0.0/Developer-Package/linux/stm32mp1-openstlinux-6.1-yocto-mickledore-mp1-v23.06.21/sources/arm-ostl-linux-gnueabi/tf-a-stm32mp-v2.8.6-stm32mp-r1-r0/tf-a-stm32mp-v2.8.6-stm32mp-r1/../../FIP_artifacts/optee
FIP_DEPLOYDIR_UBOOT : /media/user/H3D2P1/Tools/STM32MP1/STM_ECO_5.0.0/Developer-Package/linux/stm32mp1-openstlinux-6.1-yocto-mickledore-mp1-v23.06.21/sources/arm-ostl-linux-gnueabi/tf-a-stm32mp-v2.8.6-stm32mp-r1-r0/tf-a-stm32mp-v2.8.6-stm32mp-r1/../../FIP_artifacts/u-boot

 

1 ACCEPTED SOLUTION

Accepted Solutions

@debugging ,
You are right, that is why I asked if uboot file was already present in your artifact folder.

I think there was a misunderstanding concerning this folder so I will try to explain a little bit more how does it work, and I hope it will answer all your question in one.

Our BSP is composed by TF-A, UBOOT, OPTEE and Linux Kernel. We will keep the kernel out of this scope because it is not embedded in the FIP.

The Makefile.sdk with the all rule, both compile TF-A (this step is always good from your side) but also create the final FIP that will be deployed on the target.
But here, you are building only TF-A, so the new binaries that you you generate are only relative to TF-A ! It means that to compose your final FIP, you also need the U-Boot and OP-TEE binary files. But as you only compile TF-A, it will be impossible for the Makefile.sdk to invent U-boot and OP-TEE binaries, that is why we provide the FIP_artifacts folder. This is to provide you the other binaries that compose your FIP, and that are not generated by yourself.
If you erase these binaries, your FIP will be incomplete and ends with an error as you could have seen before in your case.

So, in a context of a custom board, how to process ?
In fact, in a custom board, you often have to update each element of the BSP.  So you will compile TF-A, U-boot, OP-TEE, and then create a new FIP (you can see it like a box) where you will put inside each binary needed and waited by the BSP.

If you want to take the default binaries provided by ST, you can find it in the Starter Package we deliver each release (in the Flash tarball (see this article)).

I hope you have now a better view of how the FIP works, and why you faced your issue before.

Kind regards,
Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

24 REPLIES 24
Erwan SZYMANSKI
ST Employee

Hello @debugging ,
Thank you for your feedback. I do not face the same trouble with executing make -f $PWD/../Makefile.sdk all command. Can you please attach the output logs when you start from scratch and execute this command ?
I well see the fip folder with binaries inside from my side with following the README file.

Kind regards,
Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

At 1st run the bin files are created but next runs there are not. When you delete FIP folder with the bins and run the command again do you see the FIP binaries ?

 

@debugging,
I deleted everything to be sure to start from scratch and please see the different steps I make below:

- unzip the TF-A tarball
- Go inside the folder and apply the patch delivered in the tarball (explanation in README file)
    (for p in `ls -1 ../*.patch`; do patch -p1 < $p; done)
- export FIP_DEPLOYDIR_ROOT=$PWD/../../FIP_artifacts
- make -f $PWD/../Makefile.sdk all

Now with doing this, no error during compilation, and outputs are:
- all binaries in ../deploy folder
- all fip binaries in ../../FIP_artifacts/fip folder

Can you cross check these steps from your side ?
Kind regards,
Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

I did repeat this at least 10 times from scratch. As stated above, the build output these messages but the files are actually not there, Have you looked into the the folders and files BIN files really are there ? I will try it again.

The  README.HOW_TO.txt states: The generated FIP images are available in <FIP_DEPLOYDIR_ROOT>/fip

I just repeated the same as you described. Attached the whole tree after the build. no fip folder. I only saw this fip folder the first time running the script. after that the folder was gone.

 

 

 

@debugging ,
I think you are showing me the tree one level too low. FIP artifact that contains fip is one folder upper no ? In FIP_artifacts folder

Rgs,
Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

this is the folder one level above the tree.

debugging_0-1693318989019.png

no FIP folder.

as stated above, when using make -f $PWD/../Makefile.sdk DEPLOYDIR=$FIP_DEPLOYDIR_ROOT/arm-trusted-firmware all, it creates a FIP folder as below with contents attached. no FIP binaries.

debugging_1-1693319686475.png

 

@debugging ,
Just to be sure about something, can you try to make the commands with everything on Linux PC folders directly instead of copying in  a /media/... folder ?

On linux, you sometimes need sudo rights to copy things inside, and I want to be sure that your command is not failing silently to copy your fip binaries because of that.

Kind regards,
Erwan.

 

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

I just tested to move my FIP_artifacts folder with removing fip folder inside, on a USB drive on my laptop, then change my export command with export FIP_DEPLOYDIR_ROOT=/media/<user>/path_to_FIP_artifacts 

The fip folder is well created also in this case with the make -f $PWD/../Makefile.sdk all command on my USB drive ...

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

If it still not work from your side, please do a make clean, then recompile with make -f $PWD/../Makefile.sdk all and give me the complete logs in attachment.

Rgs,
Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.