Skip to main content
Visitor II
August 9, 2021
Question

Hi,i am a beginner in MPU development. I have created cortex-M4 firmware project using stm32cubeide , but how can i start my firmware at the time of bootup?

  • August 9, 2021
  • 2 replies
  • 4425 views

i have read the article, https://wiki.st.com/stm32mpu/wiki/How_to_start_the_coprocessor_from_the_bootloader#Starting_the_coprocessor_firmware

where will i find this in my device tree

#define CONFIG_EXTRA_ENV_SETTINGS \

"stdin=serial\0" \

"stdout=serial\0" \

"stderr=serial\0" \

...

BOOTENV \

"m4fw_name=rproc-m4-fw.elf\0" \

"m4fw_addr=${kernel_addr_r}\0" \

"boot_m4fw=rproc init; rproc load 0 ${m4fw_addr} ${filesize}; rproc start 0\0" \

"boot_m4_mmc0=if ext4load mmc 0:4 ${m4fw_addr} ${m4fw_name} ; then run boot_m4fw; fi;\0"

"bootcmd=run boot_m4_mmc0; run bootcmd_mmc0\0"

    This topic has been closed for replies.

    2 replies

    ST Employee
    August 13, 2021

    Hi,

    You should add these line

    "m4fw_name=rproc-m4-fw.elf\0" \

    "m4fw_addr=${kernel_addr_r}\0" \

    "boot_m4fw=rproc init; rproc load 0 ${m4fw_addr} ${filesize}; rproc start 0\0" \

    "boot_m4_mmc0=if ext4load mmc 0:4 ${m4fw_addr} ${m4fw_name} ; then run boot_m4fw; fi;\0"

    "bootcmd=run boot_m4_mmc0; run bootcmd_mmc0\0"

    into <U-boot source code>/include/configs/stm32mp1.h, then re-compile/flash U-boot, bot the device tree.

    AGupt.8Author
    Visitor II
    August 13, 2021

    #define CONFIG_EXTRA_ENV_SETTINGS \

       "kernel_addr_r=0xc2000000\0" \

       "fdt_addr_r=0xc4000000\0" \

       "scriptaddr=0xc4100000\0" \

       "pxefile_addr_r=0xc4200000\0" \

       "splashimage=0xc4300000\0" \

       "ramdisk_addr_r=0xc4400000\0" \

       "altbootcmd=run bootcmd\0" \

       "env_check=if env info -p -d -q; then env save; fi\0" \

       STM32MP_BOOTCMD \

       BOOTENV \

           "m4fw_name=rproc-m4-fw_CM4.elf\0" \

           "m4fw_addr=${kernel_addr_r}\0" \

       "boot_m4fw=rproc init; rproc load 0 ${m4fw_addr} ${filesize}; rproc start 0\0" \

           "boot_m4_mmc0=if ext4load mmc 0:4 ${m4fw_addr} ${m4fw_name} ; then run boot_m4fw; fi;\0"

           "bootcmd=run boot_m4_mmc0; run bootcmd_mmc0\0"

    i copied this in u-boot/include/configs/stm32mp1.h and tried compiling, but i am getting the below error

    include/configs/stm32mp1.h:165:9: error: expected identifier or ‘(’ before string constant

     165 |        "bootcmd=run boot_m4_mmc0; run bootcmd_mmc0\0"

         |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    scripts/Makefile.build:155: recipe for target 'lib/asm-offsets.s' failed

    make[1]: *** [lib/asm-offsets.s] Error 1

    Makefile:1837: recipe for target 'prepare0' failed

    make: *** [prepare0] Error 2

    ST Employee
    August 16, 2021

    There should be one "\" ate the end of ​

     "boot_m4_mmc0=if ext4load mmc 0:4 ${m4fw_addr} ${m4fw_name} ; then run boot_m4fw; fi;\0" \

    AGupt.8Author
    Visitor II
    August 13, 2021

    a