cancel
Showing results for 
Search instead for 
Did you mean: 

Custom compiled U-BOOT fail to boot from eMMC with ext4: ** Unrecognized filesystem type **

ASkri.1
Senior

I have custom complied U-BOOT according this wiki page:

https://wiki.st.com/stm32mpu/wiki/How_to_compile_the_device_tree_with_the_Developer_Package#U-boot_-_unpack_and_patch_sources

It was build succesfully to support QSPI flash. Now I want to unify it with eMCC, so wand to use same custom compiled TF-A, U-BOOT for both QSPI and eMMC.

After TF-A and U-BOOT (with FIP) build I have successfully downloaded all of them to target board using standard FlashLayout file but after trying to boot eMMC found following message in console:

Hit any key to stop autoboot: 0

Boot over mmc0!

switch to partitions #0, OK

mmc0(part 0) is current device

** Unrecognized filesystem type **

Accoring to mmc part it has correct PT:

STM32MP> mmc part

Partition Map for MMC device 0 --  Partition Type: EFI

Part  Start LBA    End LBA     Name

    Attributes

    Type GUID

    Partition GUID

 1   0x00000400   0x000023ff   "fip"

    attrs: 0x0000000000000000

    type:  8da63339-0007-60c0-c436-083ac8230908

    guid:  2b0cfe67-d6dd-4c69-a5f4-6aa612222be5

 2   0x00002400   0x000223ff   "boot"

    attrs: 0x0000000000000004

    type:  0fc63daf-8483-4772-8e79-3d69d8477de4

    type:  linux

    guid:  2fca1102-25c7-4251-be14-fa2f44bac9c3

 3   0x00022400   0x0002a3ff   "vendorfs"

    attrs: 0x0000000000000000

    type:  0fc63daf-8483-4772-8e79-3d69d8477de4

    type:  linux

    guid:  c66dbb14-a7b9-4159-a5be-e8a6d390a494

 4   0x0002a400   0x0019f3ff   "rootfs"

    attrs: 0x0000000000000000

    type:  0fc63daf-8483-4772-8e79-3d69d8477de4

    type:  linux

    guid:  e91c4e10-16e6-4c0e-bd0e-77becf4a3582

 5   0x0019f400   0x0072bbff   "userfs"

    attrs: 0x0000000000000000

    type:  0fc63daf-8483-4772-8e79-3d69d8477de4

    type:  linux

    guid:  3310aa04-c53f-4693-aa00-08cf60cbb12d

STM32MP>

I've spent some time and discovered, that ext4 fs is disabled by default and can be enabled with CONFIG_FS_EXT4=1 in command line. I use this command to comile:

make -f ../Makefile.sdk DEVICE_TREE=stm32mp157a-stm32mp151-dk1-mx DEPLOYDIR=$FIP_DEPLOYDIR_ROOT/u-boot FIP_CONFIG="trusted" CONFIG_FS_EXT4=1 FIP_BL32_CONF="tfa," all

But there is error diring compile time:

arm-ostl-linux-gnueabi-ld.bfd: fs/built-in.o:(.data.fstypes+0x50): undefined reference to `ext4fs_probe'

arm-ostl-linux-gnueabi-ld.bfd: fs/built-in.o:(.data.fstypes+0x54): undefined reference to `ext4fs_ls'

arm-ostl-linux-gnueabi-ld.bfd: fs/built-in.o:(.data.fstypes+0x58): undefined reference to `ext4fs_exists'

arm-ostl-linux-gnueabi-ld.bfd: fs/built-in.o:(.data.fstypes+0x5c): undefined reference to `ext4fs_size'

arm-ostl-linux-gnueabi-ld.bfd: fs/built-in.o:(.data.fstypes+0x60): undefined reference to `ext4_read_file'

arm-ostl-linux-gnueabi-ld.bfd: fs/built-in.o:(.data.fstypes+0x64): undefined reference to `ext4_write_file'

arm-ostl-linux-gnueabi-ld.bfd: fs/built-in.o:(.data.fstypes+0x68): undefined reference to `ext4fs_close'

arm-ostl-linux-gnueabi-ld.bfd: fs/built-in.o:(.data.fstypes+0x6c): undefined reference to `ext4fs_uuid'

arm-ostl-linux-gnueabi-ld.bfd: fs/built-in.o:(.data.fstypes+0x84): undefined reference to `ext4fs_create_link'

Could you please give me a way how to enable ext4 support in custome U-BOOT?

I also noticed following things:

  1. We need to issue command make stm32mp15_trusted_defconfig

.config file will be created in u-boot src root

But after issuing make command above there is strange mastake that U-BOOT src root is not clean and reccommendating to run make mrproper that will remove .config created with make stm32mp15_trusted_defconfig:

 Using /home/screep/Distribution-Package/stm32mp1-openstlinux-5.10-dunfell-mp1-21-03-31/sources/arm-ostl-linux-gnueabi/u-boot-stm32mp-2020.10.r1-r0/u-boot-stm32mp-2020.10.r1 as source for U-Boot

 /home/screep/Distribution-Package/stm32mp1-openstlinux-5.10-dunfell-mp1-21-03-31/sources/arm-ostl-linux-gnueabi/u-boot-stm32mp-2020.10.r1-r0/u-boot-stm32mp-2020.10.r1 is not clean, please run 'make mrproper'

 in the '/home/screep/Distribution-Package/stm32mp1-openstlinux-5.10-dunfell-mp1-21-03-31/sources/arm-ostl-linux-gnueabi/u-boot-stm32mp-2020.10.r1-r0/u-boot-stm32mp-2020.10.r1' directory.

If I remove CONFIG_FS_EXT4=1 option and rum make mrproper u-boot builds succesfully.

Could you please give a hint to me how to correctly enable ext4 fs in custom u-boot?

Thank you in advance

Looking forward for your reply

  1. than

1 ACCEPTED SOLUTION

Accepted Solutions
ASkri.1
Senior

Finally found right solution here:

https://community.st.com/s/question/0D53W00000HzFR0/i-found-the-env-problem-when-emmc-started

Temporary added env partition to FlashLayout with default evn addredd defined in uboot config.

Here is explanation abount uboot env:

https://wiki.st.com/stm32mpu/wiki/U-Boot_overview#U-Boot_environment_variables

It stored in the end of ssbl partition. How do deal with FIP based images? Should I rename 'ssbl' to 'fip' here:

u-boot,mmc-env-partition = "ssbl";

Anyway currently problem is fully solved and I've god board booted again :)

Thank you in advance

Looking forward for your reply

View solution in original post

4 REPLIES 4
ASkri.1
Senior

There is update, seems u-boot's etx4 is ok, I can read content of some partitions:

STM32MP> ext4ls mmc 0:0 /

** Unrecognized filesystem type **

STM32MP> ext4ls mmc 0:1 /

** Unrecognized filesystem type **

STM32MP> ext4ls mmc 0:2 /

** Unrecognized filesystem type **

STM32MP> ext4ls mmc 0:3 /

<DIR>    1024 .

<DIR>    1024 ..

<DIR>   12288 lost+found

<DIR>    1024 etc

<DIR>    1024 usr

<DIR>    1024 var

STM32MP> ext4ls mmc 0:4 /

<DIR>    1024 .

<DIR>    1024 ..

<DIR>   12288 lost+found

<DIR>    2048 bin

<DIR>    1024 boot

<DIR>    1024 dev

<DIR>    1024 etc

<DIR>    1024 home

<DIR>    2048 lib

<DIR>    1024 media

<DIR>    1024 mnt

<DIR>    1024 proc

<DIR>    1024 run

<DIR>    2048 sbin

<DIR>    1024 sys

<DIR>    1024 tmp

<DIR>    1024 usr

<DIR>    1024 var

STM32MP> ext4ls mmc 0:5 /

<DIR>    1024 .

<DIR>    1024 ..

<DIR>   12288 lost+found

<DIR>    1024 Cube-M4-examples

<DIR>    1024 Linux-A7-examples

<DIR>    1024 demo

<DIR>    1024 weston-start-at-startup

STM32MP> ext4ls mmc 0:6 /

** Invalid partition 6 **

STM32MP>

May be boot partition set wrong. But board still can't be booted...

Still need help :)

Thank you in advance

Looking forward for your reply

ASkri.1
Senior

And more information. After target programming with CubeMXProgrammer, but before reboot bootfs partition is ok:

STM32MP> ext4ls mmc 0:0 /

** Unrecognized filesystem type **

STM32MP> ext4ls mmc 0:1 /

** Unrecognized filesystem type **

STM32MP> ext4ls mmc 0:2 /

<DIR>    1024 .

<DIR>    1024 ..

<DIR>   12288 lost+found

      3639 boot.scr.uimg

<DIR>    1024 mmc0_extlinux

<DIR>    1024 mmc1_extlinux

<DIR>    1024 nand0_extlinux

      54866 stm32mp157a-stm32mp151-dk1-mx.dtb

     7457152 uImage

STM32MP>

After first reboot it look damaged:

STM32MP> ext4ls mmc 0:2 /

** Unrecognized filesystem type **

STM32MP>

Here is log after first reboot:

NOTICE: SP_MIN: v2.4-r1.0(debug):

NOTICE: SP_MIN: Built : 07:47:48, Sep 21 2021

INFO:  ARM GICv2 driver initialized

INFO:  Set calibration timer to 60 sec

INFO:  ETZPC: UART1 (3) could be non secure

INFO:  ETZPC: SPI6 (4) could be non secure

INFO:  ETZPC: CRYP1 (9) could be non secure

INFO:  ETZPC: I2C6 (12) could be non secure

INFO:  SP_MIN: Initializing runtime services

INFO:  SP_MIN: Preparing exit to normal world

U-Boot 2020.10-stm32mp-r1 (Sep 21 2021 - 12:00:11 +0300)

CPU: STM32MP157DAB Rev.Z

Model: STMicroelectronics STM32MP157A-DK1 STM32CubeMX board

Board: stm32mp1 in trusted mode (st,stm32mp157a-stm32mp151-dk1-mx)

DRAM: 512 MiB

Clocks:

- MPU : 800 MHz

- MCU : 208.878 MHz

- AXI : 266.500 MHz

- PER : 24 MHz

- DDR : 533 MHz

WDT:  Started with servicing (32s timeout)

NAND: 0 MiB

MMC:  STM32 SD/MMC: 0

Loading Environment from MMC... *** Warning - bad CRC, using default environment

In:  serial

Out:  serial

Err:  serial

invalid MAC address in OTP 00:00:00:00:00:00

stm32 vrefbuf timed out: -110

adc@0: can't enable vdd-supply!adc_measurement: single shot failed for adc@0[18]!

Net:

Error: ethernet@5800a000 address not set.

No ethernet found.

Hit any key to stop autoboot: 0

Boot over mmc0!

Saving Environment to MMC... Writing to redundant MMC(0)... OK

switch to partitions #0, OK

mmc0(part 0) is current device

Scanning mmc 0:2...

Found U-Boot script /boot.scr.uimg

3639 bytes read in 19 ms (186.5 KiB/s)

## Executing script at c4100000

Executing SCRIPT on target=mmc0

Saving Environment to MMC... Writing to MMC(0)... OK

switch to partitions #0, OK

mmc0(part 0) is current device

** Unrecognized filesystem type **

SCRIPT FAILED... /mmc0_extlinux/extlinux.conf not found !

Saving Environment to MMC... Writing to redundant MMC(0)... OK

SCRIPT FAILED: continuing...

** Unrecognized filesystem type **

** Unrecognized filesystem type **

** Unrecognized filesystem type **

** Unrecognized filesystem type **

** Unrecognized filesystem type **

** Unrecognized filesystem type **

** Unrecognized filesystem type **

** Unrecognized filesystem type **

STM32MP> STM32MP> ext4ls mmc 0:0 /

Unknown command 'STM32MP>' - try 'help'

STM32MP> ** Unrecognized fSTM32MP> ext4ls mmc 0:1 /

Unknown command '**' - try 'help'

STM32MP> ** Unrecognized filesystem type *DIR>    1024 .

Unknown command '**' - try 'help'

STM32MP> <DIR>    1024 ..

Unknown command '<DIR>' - try 'help'

STM32MP> <DIR>   12288 lost+found

Unknown command '<DIR>' - try 'help'

STM32MP> <DIR>    1024 mmc0_extlinux

Unknown command '<DIR>' - try 'help'

STM32MP> <DIR>   1024 nand0_extlinux

Unknown command '<DIR>' - try 'help'

STM32MP>      54866 s

Unknown command '54866' - try 'help'

STM32MP>     7457152 uImage

Unknown command '7457152' - try 'help'

STM32MP> STM32MP>

Unknown command 'STM32MP>' - try 'help'

STM32MP> ext4ls mmc 0:2 /

** Unrecognized filesystem type **

STM32MP> ext4ls mmc 0:2 /

** Unrecognized filesystem type **

STM32MP> ext4ls mmc 0:3 /

<DIR>    1024 .

<DIR>    1024 ..

<DIR>   12288 lost+found

<DIR>    1024 etc

<DIR>    1024 usr

<DIR>    1024 var

STM32MP> ext4ls mmc 0:2 /

** Unrecognized filesystem type **

STM32MP>

ASkri.1
Senior

Finally found right solution here:

https://community.st.com/s/question/0D53W00000HzFR0/i-found-the-env-problem-when-emmc-started

Temporary added env partition to FlashLayout with default evn addredd defined in uboot config.

Here is explanation abount uboot env:

https://wiki.st.com/stm32mpu/wiki/U-Boot_overview#U-Boot_environment_variables

It stored in the end of ssbl partition. How do deal with FIP based images? Should I rename 'ssbl' to 'fip' here:

u-boot,mmc-env-partition = "ssbl";

Anyway currently problem is fully solved and I've god board booted again :)

Thank you in advance

Looking forward for your reply

Hi @ASkri.1​ ,

I confirm an small error in https://wiki.st.com/stm32mpu/wiki/U-Boot_overview#U-Boot_environment_variables

From DV3.0 delivery and default configuration with FIP you should have :

u-boot,mmc-env-partition = "fip";

Olivier

Olivier GALLIEN
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.