cancel
Showing results for 
Search instead for 
Did you mean: 

Crashes with IPCC on M4 and A7. How to verify the HW Resources?

Led
Senior

I faced crashes when implementing IPCC on M4 (Hard Fault Crash) and A7 (Kernel Ooops or dead system).

Observations on M4:

- Once I 'solved' the issue by disabling Uart7

- Once I 'solved' it by removing the FreeRTOS (which was configured with CubeMX default values).

I assume to have bad configured HW resources (Memory, Device Tree).

To verify this I have the following questions:

1) How can I integrate the device tree files created by CubeMX to Yocto? Do I need to erase the patch files from meta-st layer to modify the device tree files?

 Details: The instruction on https://wiki.st.com/stm32mpu/wiki/How_to_create_your_own_machine, topic 'Generate device tree' is not clear: the directory 'mx' does not exist. And 'browsing with STM32CubeMX' seems useless to me. Is it meant to create the directory mx and put the Device Tree files inside there? Then bitbake again?

2) How can I verify and modify the memory map of M4 and A7? (as it is done for example in the .icf file of IAR) Is it done through the Device Tree only?

3) Is it possible to say what kind of crash / error I get if Device Tree is not well configured?

4 REPLIES 4
Olivier GALLIEN
ST Employee

Hi @Led​ 

Are you using a custom board or ST board ?

Which ecosystem version are you using ?

Thx,

Olivier

Olivier GALLIEN
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.
Led
Senior

The board is DK2.

CubeIDE V1.3

openstlinux-20-02-19

Library: STM32Cube_FW_MP1_V1.2.0

SDK: Generated with Yocto

But I never worked with 'en.SOURCES-kernel-stm32mp1-openstlinux-20-02-19.tar.xz', as I thought that Yocto will do the job.

Olivier GALLIEN
ST Employee

1) How can I integrate the device tree files created by CubeMX to Yocto? Do I need to erase the patch files from meta-st layer to modify the device tree files?

 Details: The instruction on https://wiki.st.com/stm32mpu/wiki/How_to_create_your_own_machine, topic 'Generate device tree' is not clear: the directory 'mx' does not exist. And 'browsing with STM32CubeMX' seems useless to me. Is it meant to create the directory mx and put the Device Tree files inside there? Then bitbake again?

Agree it's a bit confusing. It means you have to copy the content of generated CubeMX folders CA7/Device Tree into <path of STM32MP1_Distribution_Package>/layers/meta-st/meta-st-stm32mp-addons/mx/

2) How can I verify and modify the memory map of M4 and A7? (as it is done for example in the .icf file of IAR) Is it done through the Device Tree only?

Global Memory map is manage by A7 inside memory DT node. It reserved specific MCU RAM address range for M4 .

M4 can then map code and data inside this allowed reserved memory. ( refer to file .ld )

3) Is it possible to say what kind of crash / error I get if Device Tree is not well configured?

No there is nothing to link an error to Device Tree problem.

For you problem I would no tend to blame DT at first.

Using OpenAMP + FreeRTOS is a bit tricky. Did you experiment the provide example in Firmware package for reference ? ( not generated by CubeMX)

Hope it help,

Olivier

Olivier GALLIEN
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.

Thanks for the answers! In the mean time I also played around with the 'Developer Package'.

On the wiki page 'How_to_cross-compile_with_the_Distribution_Package#Modifying_the_Linux_kernel_device_tree' it is described to modify the file stm32mp157c-dk2.dts for DK2 board. But there is no 'led' entry in the stm32mp157c-dk2.dts file. Actually the stm32mp157a-dk1.dts file has to be modified. That's quiet misleading.

Following up questions:

1a) I use the UART7 for the logging as it was not yet used according CubeMX. But in some *dts(i) files, I just saw the alias 'serial2 = &uart7;'. Is UART7 already used? If yes, how can I understand what peripherals are already used if it's not shown in CubeMX?

1b) Do I have to erase the patch files in meta-st (for example 0030-ARM-stm32mp1-r3-DEVICETREE.patch), that update the device tree which I define myself with CubeMX?

1c) In the file stm32mp157c-dk2-m4-examples.dts, the 'led' is defined as a label and assigned to M4. In CubeMX, how can I assign a GPIO to a processor or configure the 'default-state'? Is it possible? If there is a tutorial for this, just tell me the name of it.

2) ok

3) ok. I will more focus on OpenAMP. I based my code on the OpenAMP_TTY_echo example.