Suggestion for better documentation for Cy_IPC_Pipe_SendMessage

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

cross mob
user_1669321
Level 5
Level 5
100 replies posted 50 replies posted 25 replies posted

Hi,

I think the documentation of Cy_IPC_Pipe_SendMessage should be clearer, specifically for the parameter void * msgPtr.

I thought at first that it can be any type of structure, but by stepping through the code, the first element of the structure is actually a scratchpad provided to the PDL. Even in CE223820, the structure ipc_msg_t defines the fields for that, but no comment clarifies it, so I just ignored this structure when I first tried implementing IPC messages.

Even the Function Usage section of the PDL documentation only seems to "suggest" the uint32 array instead of insisting on the fact that the first element must be a uint32 populated with the fields client, user, intrmask.

For anyone wondering, here's my message structure, which works with the function call scheme used in CE223820:

typedef enum {

     MSG_TYPE_1,

     MSG_TYPE_2

} MsgType;

typedef struct {

     uint32_t scratchpad;

     MsgType type;

     uint8_t* data;

} IpcSharedMsg;

// CM4 code

volatile IpcSharedMsg msg;

ipcMsg.scratchpad = _VAL2FLD(CY_IPC_PIPE_MSG_CLIENT , CY_IPC_EP_CYPIPE_ADDR)

                  | _VAL2FLD(CY_IPC_PIPE_MSG_USR    , 0)

                  | _VAL2FLD(CY_IPC_PIPE_MSG_RELEASE, CY_IPC_CYPIPE_INTR_MASK);

// CM0+ code

volatile IpcSharedMsg msg;

ipcMsg.scratchpad = _VAL2FLD(CY_IPC_PIPE_MSG_CLIENT , CY_IPC_EP_CYPIPE_ADDR)

                  | _VAL2FLD(CY_IPC_PIPE_MSG_USR    , 0)

                  | _VAL2FLD(CY_IPC_PIPE_MSG_RELEASE, CY_IPC_CYPIPE_INTR_MASK);

And then I only change the type and data fields, depending on the message.

Thanks,

Fred

0 Likes
1 Solution
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi user_1669321​,

Thank you for pointing this out to us. I will raise an internal ticket so that our internal teams can evaluate your request and make appropriate changes to the PDL documentation.

As always, thank you for your interest in Cypress, an Infineon Technologies company, products.

Best Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B

View solution in original post

0 Likes
1 Reply
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi user_1669321​,

Thank you for pointing this out to us. I will raise an internal ticket so that our internal teams can evaluate your request and make appropriate changes to the PDL documentation.

As always, thank you for your interest in Cypress, an Infineon Technologies company, products.

Best Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B
0 Likes