Skip to main content
Visitor II
June 3, 2021
Solved

spi-nand flash layout download failed with CubeMXProgrammer

  • June 3, 2021
  • 1 reply
  • 1563 views

Hi, ST :)

In addition to https://community.st.com/s/question/0D53W00000pUh4gSAC/tfa-and-uboot-custom-compile-fails

Could you plese explain me what is the reason for such error:

dfu_fill_entity_mtd: Memory layout (/0x10/1*122Me) not supported!

while downloading flash content with CubeMXProgrammer.

I've built a core image with bitbake st-image-core command (hope I'm correct here) and got UBI image with size 116Mb (121896960b). I'm expecting it can be fitted to a UBI partition that has size 0x07a00000b = 127926272b. Please refer to nand partition table below. spi-nand flash size is 128Mb.

TF-A and u-boot was manually build during duscussion mentioned with link above.

Here is .tsv file:

#Opt Id Name Type IP Offset Binary

- 0x01 fsbl-boot Binary none 0x0 ./tf-a-stm32mp157a-stm32mp151-dk1-mx-usb.stm32

- 0x03 fip-boot Binary none 0x0 ./fip-stm32mp157a-stm32mp151-dk1-mx-trusted.bin

P 0x04 fsbl Binary(2) spi-nand0 0x000000 ./tf-a-stm32mp157a-stm32mp151-dk1-mx-nand.stm32

P 0x05 fip1 Binary spi-nand0 0x200000 ./fip-stm32mp157a-stm32mp151-dk1-mx-trusted.bin

P 0x06 fip2 Binary spi-nand0 0x400000 ./fip-stm32mp157a-stm32mp151-dk1-mx-trusted.bin

P 0x10 UBI Binary spi-nand0 0x600000 ./st-image-core-openstlinux-weston-stm32mp1-duck_nand_4_256_multivolume.ubi

Here is exact console output:

Here is console full output while CubeMX programming (one more question after log):

-----------------------

NOTICE: CPU: STM32MP157DAB Rev.Z

NOTICE: Model: STMicroelectronics STM32MP157A-DK1 STM32CubeMX board

INFO:  Reset reason (0x15):

INFO:   Power-on Reset (rst_por)

INFO:  PMIC version = 0x21

INFO:  FCONF: Reading TB_FW firmware configuration file from: 0x2ffe3000

INFO:  FCONF: Reading firmware configuration information for: stm32mp_io

INFO:  Using USB

INFO:   Instance 2

INFO:  Boot used partition fsbl1

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

NOTICE: BL2: Built : 13:28:40, Jun 2 2021

INFO:  BL2: Doing platform setup

INFO:  RAM: DDR3-DDR3L 16bits 533000Khz

WARNING: Couldn't find property st,phy-cal in dtb

INFO:  Memory size = 0x20000000 (512 MB)

INFO:  DFU USB START...

INFO:  phase ID :0, Manifestation 0 at c00001dc

INFO:  phase ID :3, Manifestation 3 at c80feb64

INFO:  Send detach request

INFO:  Receive DFU Detach

INFO:  DFU USB STOP...

INFO:  BL2: Loading image id 31

INFO:  Loading image id=31 at address 0x2ffff000

WARNING: Image id=31 size out of bounds

ERROR: BL2: Failed to load image id 31 (-27)

NOTICE: CPU: STM32MP157DAB Rev.Z

NOTICE: Model: STMicroelectronics STM32MP157A-DK1 STM32CubeMX board

INFO:  Reset reason (0x14):

INFO:   Pad Reset from NRST

INFO:  PMIC version = 0x21

INFO:  FCONF: Reading TB_FW firmware configuration file from: 0x2ffe3000

INFO:  FCONF: Reading firmware configuration information for: stm32mp_io

INFO:  Using USB

INFO:   Instance 2

INFO:  Boot used partition fsbl1

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

NOTICE: BL2: Built : 13:28:40, Jun 2 2021

INFO:  BL2: Doing platform setup

INFO:  RAM: DDR3-DDR3L 16bits 533000Khz

WARNING: Couldn't find property st,phy-cal in dtb

INFO:  Memory size = 0x20000000 (512 MB)

INFO:  DFU USB START...

INFO:  phase ID :0, Manifestation 0 at c00001dc

INFO:  phase ID :3, Manifestation 3 at c80f9ea3

INFO:  Send detach request

INFO:  Receive DFU Detach

INFO:  DFU USB STOP...

INFO:  BL2: Loading image id 31

INFO:  Loading image id=31 at address 0x2ffff000

INFO:  Image id=31 loaded: 0x2ffff000 - 0x2ffff226

INFO:  FCONF: Reading FW_CONFIG firmware configuration file from: 0x2ffff000

INFO:  FCONF: Reading firmware configuration information for: dyn_cfg

INFO:  FCONF: Reading firmware configuration information for: stm32mp1_firewall

INFO:  BL2: Loading image id 4

INFO:  Loading image id=4 at address 0x2ffc5000

INFO:  Image id=4 loaded: 0x2ffc5000 - 0x2ffd847c

WARNING: Not a known TEE, use default loading options.

INFO:  BL2: Skip loading image id 21

INFO:  BL2: Skip loading image id 22

INFO:  BL2: Loading image id 23

INFO:  Loading image id=23 at address 0xc0500000

INFO:  Image id=23 loaded: 0xc0500000 - 0xc0512a91

INFO:  BL2: Loading image id 26

INFO:  Loading image id=26 at address 0x2ffc0000

INFO:  Image id=26 loaded: 0x2ffc0000 - 0x2ffc4258

INFO:  BL2: Loading image id 5

INFO:  Loading image id=5 at address 0xc0100000

INFO:  Image id=5 loaded: 0xc0100000 - 0xc01cfa18

NOTICE: BL2: Booting BL32

INFO:  Entry point address = 0x2ffc5000

INFO:  SPSR = 0x1d3

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

NOTICE: SP_MIN: Built : 15:20:23, Jun 2 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 (Jun 02 2021 - 18:21:14 +0300)

CPU: STM32MP157DAB Rev.Z

Model: STMicroelectronics STM32MP157A-DK1 STM32CubeMX board

Board: stm32mp1 in trusted - stm32image 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

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 usb0!

partitions : done

DFU alt info setting: using id 'spi-nand0,0'

using id 'spi-nand0,1'

using id 'spi-nand0,2'

dfu_fill_entity_mtd: Memory layout (/0x10/1*122Me) not supported!

Error: dfu init failed: -1

done

STM32MP> mtdparts

device spi-nand0 <spi-nand0>, # parts = 4

 #: name        size      offset     mask_flags

 0: fsbl        0x00200000   0x00000000   0

 1: ssbl1       0x00200000   0x00200000   0

 2: ssbl2       0x00200000   0x00400000   0

 3: UBI        0x07a00000   0x00600000   0

active partition: spi-nand0,0 - (fsbl) 0x00200000 @ 0x00000000

defaults:

mtdids : spi-nand0=spi-nand0

mtdparts: mtdparts=spi-nand0:2m(fsbl),2m(ssbl1),2m(ssbl2),-(UBI)

-----------------------

BTW, I'm also not able to load 0x04,0x05,0x6 partitions without specifying 0x10 partition with following error:

Boot over usb0!

Error: fip2 (0x6): Bad size for partition 3 (ssbl2) at 0x400000 = 0x7c00000 <> 0x200000 expected

Here is .tsv (last line is commented):

#Opt Id Name Type IP Offset Binary

- 0x01 fsbl-boot Binary none 0x0 ./tf-a-stm32mp157a-stm32mp151-dk1-mx-usb.stm32

- 0x03 fip-boot Binary none 0x0 ./fip-stm32mp157a-stm32mp151-dk1-mx-trusted.bin

P 0x04 fsbl Binary(2) spi-nand0 0x000000 ./tf-a-stm32mp157a-stm32mp151-dk1-mx-nand.stm32

P 0x05 fip1 Binary spi-nand0 0x200000 ./fip-stm32mp157a-stm32mp151-dk1-mx-trusted.bin

P 0x06 fip2 Binary spi-nand0 0x400000 ./fip-stm32mp157a-stm32mp151-dk1-mx-trusted.bin

#P 0x10 UBI Binary spi-nand0 0x600000 ./st-image-core-openstlinux-weston-stm32mp1-duck_nand_4_256_multivolume.ubi

This migh be convinient for TF-A/U-BOOT debugging - no need to wait for download huge images...

Thank you for your patience :)

Looking forward for your reply

    This topic has been closed for replies.
    Best answer by ASkri.1
    Hi, Oliver! No... There was a simple reason I've discovered. mtd partitions in u-boot and in .tsv file were different. tsv file - 2Mb-2Mb-2Mb-UBI u-boot config - 2Mb-4Mb-4Mb-UBI So, this question is considered to be closed. Thank you very much. пн, 7 июн. 2021 г. в 15:40, ST Community :

    1 reply

    Technical Moderator
    June 7, 2021

    Hi @ASkri.1​ ,

    Sorry I'm not expert of nand and mtd but the mention trace

    dfu_fill_entity_mtd: Memory layout (/0x10/1*122Me) not supported!

    looks to be obvious

    Look inside u-boot source "drivers/dfu/dfu_mtd.c"

    if ((!strcmp(st, "part")) || (!strcmp(st, "partubi"))) { 
    ...
    }
    else {
     
    		printf("%s: Memory layout (%s) not supported!\n", __func__, st);
     
    		return -1;
     
    	}

    I understand you provide one parameter as "/0x10/1*122Me" where it expect to find "part" or "partubi"

    Hope this help

    Olivier

    ASkri.1AuthorAnswer
    Visitor II
    June 7, 2021
    Hi, Oliver! No... There was a simple reason I've discovered. mtd partitions in u-boot and in .tsv file were different. tsv file - 2Mb-2Mb-2Mb-UBI u-boot config - 2Mb-4Mb-4Mb-UBI So, this question is considered to be closed. Thank you very much. пн, 7 июн. 2021 г. в 15:40, ST Community :