TI中文支持网
TI专业的中文技术问题搜集分享网站

TMS320F28379D: IPC API调用

Part Number:TMS320F28379DOther Parts Discussed in Thread:C2000WARE

c2000的驱动库中

1.请问这个API函数在调用之前是不是还要对IPC_Instance进行地址映射,库函数中没有找到这个操作?2.为什么IPC_TOTAL_NUM的值是0?3.如何使用这个API,在使用这个API之前需要哪些步骤?

Susan Yang:

user6574429 说:2.为什么IPC_TOTAL_NUM的值是0?

它的值是4,而不是0

user6574429 说:1.请问这个API函数在调用之前是不是还要对IPC_Instance进行地址映射,库函数中没有找到这个操作?

//*****************************************************************************
//
//! Sends a command to the Remote core
//!
//! \param ipcType is the enum corresponding to the IPC instance used
//! \param flags is the IPC flag mask for the flags to be set
//! \param addrCorrEnable is the flag used to determine whether or not to
//!convert the addr parameter to remote core's address space
//! \param command is the 32-bit command value
//! \param addr is the 32-bit address to be sent as part of command
//! \param data is the 32-bit data to be sent as part of command
//!
//! Allows the caller to send a command to the remote core. A command consists
//! of a unique command value, a 32-bit address and a 32-bit data. The function
//! also sends the designated flags to the remote core.
//! There may be differences in the address spaces of Local and Remote core.
//! For example in case of F2838X device, the address spaces of C28x core and
//! CM core are different. In case the \e addr refers to an address in the IPC
//! MSG RAM, \e addrCorrEnable param may be used to correct the address mismatch
//!
//! The \e flags parameter can be any of the IPC flag values: \b IPC_FLAG0 -
//! \b IPC_FLAG31.
//! The \e addrCorrEnable parameter can take values IPC_ADDR_CORRECTION_ENABLE
//! (converts the address to remote core's address space) or
//! IPC_ADDR_CORRECTION_DISABLE(does not modify the addr parmeter)
//!
//! The application shall use the function IPC_getResponse to read the response
//! sent by the remote core.
//!
//! \note The application is expected to wait until the the response is
//! received before sending another command.
//!
//! \note \e addrCorrEnable parameter must be kept same on the sending and
//! receiving cores
//!
//! \return Returns \b true if the command is sent properly and \b false if
//! the designated flags were busy and hence command was not sent.
//
//*****************************************************************************
extern bool
IPC_sendCommand(IPC_Type_t ipcType, uint32_t flags, bool addrCorrEnable,uint32_t command, uint32_t addr, uint32_t data);

不需要的。您直接调用该API即可

具体使用,您可以看一下

https://software-dl.ti.com/C2000/docs/C2000_Multicore_Development_User_Guide/examples.html#exercise-2-ipc-example 

,

user6574429:

Susan Yang 说:https://software-dl.ti.com/C2000/docs/C2000_Multicore_Development_User_Guide/examples.html#exercise-2-ipc-example 

里的参数

IPC_CPU1_L_CPU2_R是多少?

Susan Yang 说:它的值是4,而不是0

 枚举类型值默认是0的嘛,为什么是4?,如果是4的话,那么4代表的是有4个IPC实例吗?但是28379d不是只有一个IPC模块吗?

,

Susan Yang:

user6574429 说:枚举类型值默认是0的嘛,为什么是4?

typedef enum
{IPC_CPU1_L_CPU2_R,//!< CPU1 - Local core, CPU2 - Remote coreIPC_CPU1_L_CM_R,//!< CPU1 - Local core, CM- Remote coreIPC_CPU2_L_CPU1_R,//!< CPU2 - Local core, CPU1 - Remote coreIPC_CPU2_L_CM_R,//!< CPU2 - Local core, CM- Remote coreIPC_TOTAL_NUM
}IPC_Type_t;

4代表上面的4个选项

,

user6574429:

Susan Yang 说:它的值是4,而不是0

 这是ipc.h中定义的

,

user6574429:

多谢您的回复,应该是我的库中的定义少了前面的几个值

,

Susan Yang:

抱歉,之前看了28388的驱动库。在2837xD下是只有

typedef enum{ IPC_TOTAL_NUM}IPC_Type_t;

确实是0,应该是库函数内没有写

IPC_CPU1_L_CPU2_R, //!< CPU1 – Local core, CPU2 – Remote core IPC_CPU2_L_CPU1_R, //!< CPU2 – Local core, CPU1 – Remote core

,

user6574429:

我照您说的调用这个函数,但是还是 不正确,IPC_Instance的地址核IPC的基地址不一样

,

Susan Yang:

您可以看一下

https://software-dl.ti.com/C2000/docs/C2000_Multicore_Development_User_Guide/ipc_communication.html# 

您现在是哪种情况?

,

user6574429:

第一种

,

user6574429:

我把IPC_CPU1_L_CPU2_R, IPC_CPU2_L_CPU1_R加进去以后还是不正确

,

user6574429:

您好,有没有相关的例程啊?

,

Susan Yang:

https://software-dl.ti.com/C2000/docs/C2000_Multicore_Development_User_Guide/examples.html#exercise-2-ipc-example 

您可以查看C2000ware 

C2000Ware_3_04_00_00\driverlib\f2837xd\examples\dual\ipc

以及

C2000Ware_3_04_00_00\driverlib\f2838x\examples\c28x_dual\ipc

,

user6574429:

里面没有调用这个函数啊

,

user6574429:

只是单纯的翻转gpio啊

,

user6574429:

您能帮忙测试一下这个函数能正常使用吗?

,

Susan Yang:

那您看一下28388的例程ipc_ex1_basic_c28x

C2000Ware_3_04_00_00\driverlib\f2838x\examples\c28x_dual\ipc

,

user6574429:

但是28379d和2838x的IPC_Type_t不一样的嘛

,

user6574429:

设置IPCSET都设置不了,感觉地址映射不对

,

Susan Yang:

抱歉,之前漏掉了您的回复。请问您现在问题解决了吗?

赞(0)
未经允许不得转载:TI中文支持网 » TMS320F28379D: IPC API调用
分享到: 更多 (0)

© 2024 TI中文支持网   网站地图 鲁ICP备2022002796号-1