- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
would like to have an very simple example how to share variables between CM0 and CM4 cores.
variable "a" should be used in cm0p.c and cm4.c
I have already read about IPC, but dont understand yet how it works.
It is a lot of code in examples, i am confused
There is no project to upload, because i have just started an new schematic with 1 LED from cy8ckit-062 kit.
I want toggle varible a i cm0p.c and act in cm4.c.
Can please anyone help?
Thanks and best regards
Alex
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi info_1585471,
I checked your code. The issue is that your variables have been assigned different memory locations in each of the cores.
(.map file in results)
cmoplus:
.mysection 0x08020000 0x4
*(.mysection)
.mysection 0x08020000 0x4 .\CortexM0p\ARM_GCC_541\Debug\main_cm0p.o
0x08020000 Blue_On
0x08020001 Red_On
0x08020002 SW2_button
0x08020003 Green_On
CM4:
.mysection 0x08020000 0x4
*(.mysection)
.mysection 0x08020000 0x4 .\CortexM4\ARM_GCC_541\Debug\main_cm4.o
0x08020000 SW2_button
0x08020001 Blue_On
0x08020002 Red_On
0x08020003 Green_On
You can force contiguous memory locations by putting all these into a structure or you may have to define separate sections in your linker file for each variable.
I have added the modified project where I have defined a structure for all the variables and your code worked as expected
volatile struct
{
uint8 Green_On ;
uint8 Red_On;
uint8 Blue_On ;
uint8 SW2_button;
}check CY_SECTION(".mysection");
Bragadeesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Alex,
Please check this link, it will be helpful:
https://www.cypress.com/documentation/code-examples/ce216795-psoc-6-mcu-dual-core-basics
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Ankita,
i have allready seen the reply from Mark, and his example from here Re: How to set up shared memory between CM4 and CM0p
works.
But if i modify it a little bit, it doesnt work anymore.
I have attached my really simple project.
It is running on psoc6 wifi-bt kit.
I am really confused, why it is not running well, would be glad if somebody can check it.
Thanks very much.
Best regards
Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are two code examples that use the IPC low level driver to implement high level abstraction concepts - Pipes and Semaphore. They are way simpler.
https://www.cypress.com/documentation/code-examples/ce223820-psoc-6-mcu-ipc-pipes
https://www.cypress.com/documentation/code-examples/ce223549-psoc-6-mcu-ipc-semaphore
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi info_1585471,
I checked your code. The issue is that your variables have been assigned different memory locations in each of the cores.
(.map file in results)
cmoplus:
.mysection 0x08020000 0x4
*(.mysection)
.mysection 0x08020000 0x4 .\CortexM0p\ARM_GCC_541\Debug\main_cm0p.o
0x08020000 Blue_On
0x08020001 Red_On
0x08020002 SW2_button
0x08020003 Green_On
CM4:
.mysection 0x08020000 0x4
*(.mysection)
.mysection 0x08020000 0x4 .\CortexM4\ARM_GCC_541\Debug\main_cm4.o
0x08020000 SW2_button
0x08020001 Blue_On
0x08020002 Red_On
0x08020003 Green_On
You can force contiguous memory locations by putting all these into a structure or you may have to define separate sections in your linker file for each variable.
I have added the modified project where I have defined a structure for all the variables and your code worked as expected
volatile struct
{
uint8 Green_On ;
uint8 Red_On;
uint8 Blue_On ;
uint8 SW2_button;
}check CY_SECTION(".mysection");
Bragadeesh