cancel
Showing results for 
Search instead for 
Did you mean: 

Using HSEM of STM32H7 ( sharing data )

Toxicobull
Associate II

Hi,

I am working in project in which I use an STM32H745, So am trying to share data between the two CPUs.

first I create structure in the two CPU like this :

I used the same memory address

struct shared_data
{
	uint8_t drdyM4;
	float32_t data_to_M7[6][1024];
	float32_t data_from_M7[1024];
};
 
volatile struct shared_data * const data_ptr = (struct shared_data *)0x38001000;

This is working fine . I can share data.

Now I want to use HSEM to protect reading and writing process.

I have two question please :

1- How to use the HSEM ? is it what I should use for the interrupt between the two CPUs ?

2- Is my structure is protected from other code writing ( code can write on the same memory address) ?

Thank you

2 REPLIES 2
TDK
Guru

See the examples in CubeMX repository:

https://github.com/STMicroelectronics/STM32CubeH7/tree/ccb11556044540590ca6e45056e6b65cdca2deb2/Projects/STM32H747I-DISCO/Examples/HSEM

Your structure is not protected, but it doesn't need to be. You'll need to ensure the linker doesn't put other data there. This is part of the linker script.

If you feel a post has answered your question, please click "Accept as Solution".

Thank you I solved the problem with the examples.

Could you tell me how to configure the linker to do so ?