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
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:



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()




On CM4 this callback function gets called



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

If I have the following code in the callback function:



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:



And this code in the main loop of CM4:



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 Replies