2021-05-10 02:41 AM
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
2021-05-10 06:15 AM
See the examples in CubeMX repository:
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.
2021-05-10 08:08 AM
Thank you I solved the problem with the examples.
Could you tell me how to configure the linker to do so ?