2023-01-27 05:12 AM
Hi!
I am using STM32MP157C-DK2 and i want to start the coprocessor from bootloader (I have readed the wiki page). First, I have done it manually and everithing works fine:
&m4_rproc{
/*Restriction: "memory-region" property is not managed - please to use User-Section if needed*/
mboxes = <&ipcc 0>, <&ipcc 1>, <&ipcc 2>;
mbox-names = "vq0", "vq1", "shutdown";
status = "okay";
/* USER CODE BEGIN m4_rproc */
memory-region = <&retram>, <&mcuram>, <&mcuram2>, <&vdev0vring0>,
<&vdev0vring1>, <&vdev0buffer>, <&mcu_rsc_table>;
interrupt-parent = <&exti>;
interrupts = <68 1>;
wakeup-source;
st,auto-boot = <1>;
/* USER CODE END m4_rproc */
m4_system_resources{
status = "okay";
/* USER CODE BEGIN m4_system_resources */
/* USER CODE END m4_system_resources */
};
};
load mmc 0#bootfs 0xc2000000 core_communication_new_CM4.elf
rproc init
rproc load 0 0xc2000000 2827764
rproc start 0
run bootcmd
With this, I was able to start the coprocessor firmware.
Now, I want to do it automatically: every time the board boots I want the coprocessor firmware to start. I have read on the wiki page and edited the stm32mp15_st_common.h file:
#define CONFIG_EXTRA_ENV_SETTINGS \
STM32MP_MEM_LAYOUT \
STM32MP_BOOTCMD \
STM32MP_PARTS_DEFAULT \
BOOTENV \
"m4fw_name=rproc-m4-fw.elf\0" \
"m4fw_addr=0xc2000000\0" \
"boot_m4fw=rproc init; rproc load 0 0xc2000000 2827764; rproc start 0\0" \
"boot_m4_mmc0=if load mmc 0#bootfs 0xc2000000 core_communication_new_CM4.elf ; then run boot_m4fw; fi;\0" \
"bootcmd=run boot_m4_mmc0; run bootcmd_mmc0\0"
STM32MP_EXTRA \
STM32MP_BOARD_EXTRA_ENV
But now, I do not know how to go on. ¿How can I compile it and get it on the board?
Thanks!
https://wiki.st.com/stm32mpu/wiki/How_to_start_the_coprocessor_from_the_bootloader
2023-01-27 11:57 AM
Hello @JIrao.1 ,
In the wiki link you target, it is also mentioned that you have to recompile U-Boot after your modification.
Please find below 2 links that will help you to do it:
I hope that this information will help you.
Kind regards,
Erwan.
2023-01-31 01:42 AM
Hi @Erwan SZYMANSKI thanks for your reply! :beaming_face_with_smiling_eyes:
I have read and followed the steps of the wiki page (how to cross compile with the distribution package):
I do not know if the ${kernel_addr_r} is not correctly asigned or I have forgotten some step.
Can you help me?
Thanks!
2023-01-31 11:52 PM
Hello @JIrao.1 ,
Did you also check the information provided by this wiki link: https://wiki.st.com/stm32mpu/wiki/Linux_remoteproc_framework_overview#Remote_processor_-27early-27_boot ?
Kind regards,
Erwan.