Announcements

Help us improve the Power & Sensing Selection Guide. Share feedback

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
SepehrZ
Level 2
Level 2
25 sign-ins First like received First solution authored

Issue with using user pipe on PSoC 6

 

I already have the pipe set up and the endpoints registered according to CE223820 example code.

On CM0+ I call this function every 32ms:

SepehrZ_0-1655242073856.png

 

CM4_IPC_CALLBACK_ENCODE_AUDIO is 2, which corresponds to the index of the callback function that I am calling on CM4.

Here is the definition for pT_ipcSendToCm4()

SepehrZ_1-1655242073864.png

 

 

On CM4 this callback function gets called

SepehrZ_2-1655242073865.png

 

I have a global int named i which is initialized to 0.

If I have the following code in the callback function:

SepehrZ_3-1655242073871.png

 

I see the light on the device flashing blue and green, which is as expected, since i is incremented every time we send a message from CM0+.

However, if I have this code in the callback function:

SepehrZ_4-1655242073873.png

 

And this code in the main loop of CM4:

SepehrZ_5-1655242073881.png

 

The light on the device stays green and does not change, as if i is not being changed at all. I tested changing different global variables inside an ipc pipe callback function. I observed that the changes to the variable are reflected in the callback function but nowhere else within the scope of CM4.

Why is this happening? Is there something different about the IPC pipe interrupt from other interrupts? How is the memory being handles in this case?

 

 

UPDATE: I worked around this issue by declaring all of the memory on CM0 and passing pointers to CM4. So all the memory that M4 uses are statically declared on M0.

0 Likes
0 Replies