cancel
Showing results for 
Search instead for 
Did you mean: 

Using gcc makefile for OpenAMP projects

gianlucarenzi
Associate III

Hello,

I was wondering how hard is to convert the simple OpenAMP_TTY_echo (I have it installing the STM32Cube_FW_MP1_V1.6.0 package from STMicroelectronics' web site) to a Makefile driven project.

I need it so, because the firmware auto building of my BSP (partially based on buildroot, makerootfs and others shell based scritps).

I have a custom board based on the STM32MP151AAA3 and STM32MP151CAA3.

At the moment I am running a vanilla 6.1.55 Linux Kernel on top of Debian 11 Bullseye (11.7) with all needed stuff compiled in as static modules:

CONFIG_REMOTEPROC=y
CONFIG_REMOTEPROC_CDEV=y
CONFIG_STM32_RPROC=y
CONFIG_RPMSG_TTY=y
CONFIG_RPMSG_CHAR=y
CONFIG_RPMSG_CTRL=y
CONFIG_ROMSG_VIRTIO=y
CONFIG_RPMSG_NS=y
CONFIG_STM32_IPCC=y

 In that case Linux, will show any remoteproc stuff under /sys (sysfs).

In my device-tree there is everything (I think) set for CM4 execution code:

	reserved-memory {
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		mcuram2: mcuram2@10000000 {
			compatible = "shared-dma-pool";
			reg = <0x10000000 0x40000>;
			no-map;
		};

		vdev0vring0: vdev0vring0@10040000 {
			compatible = "shared-dma-pool";
			reg = <0x10040000 0x1000>;
			no-map;
		};

		vdev0vring1: vdev0vring1@10041000 {
			compatible = "shared-dma-pool";
			reg = <0x10041000 0x1000>;
			no-map;
		};

		vdev0buffer: vdev0buffer@10042000 {
			compatible = "shared-dma-pool";
			reg = <0x10042000 0x4000>;
			no-map;
		};

		mcuram: mcuram@30000000 {
			compatible = "shared-dma-pool";
			reg = <0x30000000 0x40000>;
			no-map;
		};

		retram: retram@38000000 {
			compatible = "shared-dma-pool";
			reg = <0x38000000 0x10000>;
			no-map;
		};

	};

and for the Cortex M4 resources:

&ipcc {
	status = "okay";
};

&m4_rproc {
	memory-region = <&retram>, <&mcuram>, <&mcuram2>, <&vdev0vring0>,
			<&vdev0vring1>, <&vdev0buffer>;
	mboxes = <&ipcc 0>, <&ipcc 1>, <&ipcc 2>;
	mbox-names = "vq0", "vq1", "shutdown";
	interrupt-parent = <&exti>;
	interrupts = <68 1>;
	status = "okay";

};

I think everything is configured quite good, following every Wiki page from the wiki.st.com website...

I know at the moment the M4 is not going to use any hardware pin or peripheral devices, and all those stuff must be removed from Linux side, and added to the m4_rproc node and subnodes (I suppose), but for now I only need a simple way to compile the code under the Makefile environment and running it via remoteproc in Linux and using two channels via ttyRPMSG drivers.

Please help, because it is quite important as my company is using more than 30k MPUs/year...

Regards

Gianluca Renzi

2 REPLIES 2
Cedric LECOUTRE
ST Employee

Hi @gianlucarenzi 

We will follow-up your questions with priority within ST Online Support . I entered a case there on your behalf, just connect on this URL, https://ols.st.com/, you will see it from your OLS portal (homepage).

Best regards,

Cédric

gianlucarenzi
Associate III

Thank you so much Cedric!

I hope to find as soon as possible a better (quick) way to have the OpenAMP TTY Example in a simple Makefile format. It seems in the STM32CubeIDE there is no way (at least I didn't find any) to export a running project into a Makefile driven project. I know the given example the OpenAMP_TTY requires a custom gcc with a special plugin -fcyclomatic-complexity enabled, and this is not strictly needed, so I suppose I can modify the CFLAGS to meet our criteria as well.

Thank you for now.

Best regards,

Gianluca