cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use STM32CubeProgrammer to boot from RAM with no media ?

sja
Associate II

We have a STM32MP1 system with no flash media.

How do I push a TF-A/uboot image to DRAM and boot/run from DRAM with

no MMC/flash media ?

4 REPLIES 4
sja
Associate II

Figured this out ... simple two line tsv file:

#Opt   Id   Name   Type   IP   Offset   Binary

-   0x01   fsbl1-boot   Binary   none   0x0   tf-a-stm32mp157c-ya157c-4e512d-trusted.stm32

-   0x03   ssbl-boot   Binary   none   0x0   u-boot-stm32mp157c-ya157c-4e512d-trusted.stm32

But now how do I also push kernel image and dtb over USB so uboot can boot the kernel.

I tried this but programmer gave a syntax error:

#Opt   Id   Name   Type   IP   Offset   Binary

-   0x01   fsbl1-boot   Binary   none   0x0   tf-a-stm32mp157c-ya157c-4e512d-trusted.stm32

-   0x03   ssbl-boot   Binary   none   0x0   u-boot-stm32mp157c-ya157c-4e512d-trusted.stm32

-   0x03   kernel      Binary   none   0xC2000000   uImage

-   0x03   dtb      Binary   none   0xC4000000   stm32mp157c.dtb

PatrickF
ST Employee

Hi,

I fear it is not possible to start Linux directly using CubeProgrammer, which is intended to program Flash.

Once you have taken the uBoot prompt, maybe look and https://wiki.st.com/stm32mpu/wiki/How_to_boot_the_kernel_via_TFTP_from_U-Boot

and https://wiki.st.com/stm32mpu/wiki/USB_overview#How_to_configure_USB_Gadget_through_configfs which might be used to have an Ethernet over USB if needed.

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.
PatrickD
ST Employee

Not possible today but it is planned and coming soon: add a ram0 target.

A other solution it is change the bootcmd to execute a the U-Boot dfu command with ram target when the board is booting from usb and only use STM32CubeProgrammer to load U-boot in DDR, then using dfu-utils to load kernel in DDR.

something like

1/ define dfu ram target with U-Boot variable:

dfu_alt_info=uImage ram ${kernel_addr} 0x2000000;devicetree.dtb ram $[fdt_addr_r} 0x1000000;

2/ update U-boot command

#define STM32MP_BOOTCMD "bootcmd_stm32mp=" \

"echo \"Boot over ${boot_device}${boot_instance}!\";" \

"if test ${boot_device} = serial || test ${boot_device} = usb;" \

- "then stm32prog ${boot_device} ${boot_instance}; " \

+ "then dfu 0 ram 0; bootm ${kernel_addr} ${devicetree_addr};" \

"else " \

"run env_check;" \

"if test ${boot_device} = mmc;" \

"then env set boot_targets \"mmc${boot_instance}\"; fi;" \

"if test ${boot_device} = nand ||" \

 " test ${boot_device} = spi-nand ;" \

"then env set boot_targets ubifs0; fi;" \

"run distro_bootcmd;" \

"fi;\0"

not tested, perhaps need some tuning.

regards

PDELA.1
Associate II

Hi,

with OpenSTLinux V2.0.0, it is now possible to load and execute a Linux kernel in RAM with STM32CubeProgrammer

https://wiki.st.com/stm32mpu/wiki/STM32CubeProgrammer_flashlayout#FlashLayout_file_to_load_and_start_kernel

#Opt Id Name Type IP Offset Binary

- 0x01 fsbl Binary none 0x0 tf-a.stm32

- 0x03 ssbl Binary none 0x0 u-boot.stm32

P 0x10 kernel System ram0 0xC2000000 uImage.bin

P 0x11 dtb FileSytem ram0 0xC4000000 stm32mp157c.dtb

Regards