cancel
Showing results for 
Search instead for 
Did you mean: 

How to Integrate Cortex-M4 firmware into linux distribution

Maksh.1
Associate III

Hi, i am trying to build linux image along with cortex-m4 firmware which developed using STM32CubeIDE,

so for that i have copied a Stm32CubeIDE project under folder DistributionPackage/openstlinux-5.10-dunfell-mp1-21-03-31/layers/sources/m4projects-stm32mp1/Projects/STM32MP157C-DK2/Examples/TIM/project/project1/STM32CubeIDE/

Added the project path in /DistributionPackage/openstlinux-5.10-dunfell-mp1-21-03-31/layers/meta-st/meta-st-stm32mp/recipes-extended/m4projects/ m4projects-stm32mp1.bb

iam getting error as

 arm-none-eabi-gcc: error: /home/akshay/project/stm32/DistributionPackage/openstlinux-5.10-dunfell-mp1-21-03-31/build-openstlinuxweston-stm32mp1/tmp-glibc/work/stm32mp1-ostl-linux-gnueabi/m4projects-stm32mp1/1.4.0-r0/build/STM32MP157C-DK2/Examples/TIM/Project/JCIProject1/out/Debug//home/akshay/project/stm32/DistributionPackage/openstlinux-5.10-dunfell-mp1-21-03-31/layers/sources/m4projects-stm32mp1/Projects/STM32MP157C-DK2/Examples/TIM/Project/Project1/STM32CubeIDE/Common.o: No such file or directory

FYI : The file structure of example projects is different form the STM32CubeIDE project

3 REPLIES 3
bimorqt
Associate III

Any update on this? I am struggling to find documentation on the preferred way to adjust the STM32CubeIDE directory structure to match the m4projects one and succesfully compile custom m4 firmware within Yocto Distribution Package.

I managed to successfully compile a project by manipulating the .cproject files and by inhibiting the item node about the Common.o part, but the generated binary elf file is different from the one compiled with the IDE and is not working on the target.

Help on this would be much appreciated!

Hello @bimorqt​ ,

I have never done that so my help is very light, but I found this page on the wiki, that explains the structure of the M4 project and how it is integrated in the Distribution Package:

https://wiki.st.com/stm32mpu/wiki/STM32CubeMP1_Package#Distribution_Package_for_STM32CubeMP1

I hope it will help you,

Best Regards,

Kevin

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.

Hello @Kevin HUBER​, thanks for the prompt answer.

Sadly, I already had a look at that section and was not too helpful, since it lacks the technical details which are preventing me from a successful cross-compilation.

I am adding more details to better frame my needs:

My objective is having a custom layer containing a custom bitbake recipe, let's call it m4projects-custom, which depends on m4projects.inc provided by recipes-extended/m4projects in the layer meta-st-stm32mp.

This m4projects-custom recipe shall be able to:

  • fetch and install the STM32CubeMP1 repository, containing the necessary HAL and OpenAMP drivers
  • fetch my remote repository containing the custom m4 source code developed within the STM32CubeIDE, which was configured with my custom SDK
  • unpack my custom code within the STM32CubeMP1 repository

What I am currently doing is to unpack my custom source code inside a new machine directory, defined under "Projects" of the STM32CubeMP1 reposiroty. Sadly, it seems that .project files (generated by the STM32CubeIDE and included in my custom repository) need to be aligned again to match the directory structure of the STM32CubeMP1 repository; could you please confirm that there is no simpler approach to achieve what I need? I see there is a Template folder in the STM32CubeMP1 repository, maybe I can use that as a starting point and enrich it with my custom m4 code?

Thanks in advance