This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] TMS320F28388D:在基于 EtherCAT 通信的代码中的闪存操作期间 CM 和 CPU1之间的 IPC 通信方法

Guru**** 2220740 points
Other Parts Discussed in Thread: C2000WARE
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1461096/tms320f28388d-ipc-communication-method-between-cm-and-cpu1-during-flash-operations-in-ethercat-communication-based-code

器件型号:TMS320F28388D
Thread 中讨论的其他器件:C2000WARE

工具与软件:

你(们)好

在开发 EtherCAT 通信代码时发生问题。

该系统基于双核架构、在 CPU1和 Cortex-M4之间建立了 IPC 通信。

但是、在闪存运行期间、会观察到 IPC 通信出现间歇性中断。

根据当前的分析、发现出现问题是因为 sendCommand传递函数 whileCortex-M4文件的主例程中的循环停止运行、导致通信中断。

您能否对该问题的可能原因提供任何见解?

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void CM_init(void)
{
//
// Disable the watchdog
//
SysCtl_disableWatchdog();
#ifdef _FLASH
//
// Copy time critical code and flash setup code to RAM. This includes the
// following functions: InitFlash();
//
// The RamfuncsLoadStart, RamfuncsLoadSize, and RamfuncsRunStart symbols
// are created by the linker. Refer to the device .cmd file.
//
memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);
//
// Claim the Flash Pump Semaphore before initializing Flash
//
Flash_claimPumpSemaphore(FLASH_CM_WRAPPER);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#else
HW_Init();
#endif
MainInit();
bRunApplication = TRUE;
do
{
GPIO_setPortPins(GPIO_PORT_C, GPIO_GPCSET_GPIO93);
IPC_Write(IPC_CM_L_CPU1_R, IPC_FLAG2, IPC_CMD_READ_MEM1, 6);
GPIO_clearPortPins(GPIO_PORT_C, GPIO_GPCCLEAR_GPIO93);
MainLoop();
DEVICE_DELAY_US((uint32_t)(5.));
BackTicker++;
} while (bRunApplication == TRUE);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

上述两个代码是为 Cortex-M4编写的。

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void main(void)
{
//
// Disable the watchdog
//
SysCtl_disableWatchdog();
#ifdef _FLASH
//
// Copy time critical code and flash setup code to RAM. This includes the
// following functions: Flash_initModule();
//
// The RamfuncsLoadStart, RamfuncsLoadSize, and RamfuncsRunStart symbols
// are created by the linker. Refer to the device .cmd file.
//
memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);
//
// Claim the Flash Pump Semaphore before initializing Flash
//
Flash_claimPumpSemaphore(FLASH_CPU1_WRAPPER);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

上述代码是为 CPU1编写的。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Hi Dongjin,

    您是否有机会在 C2000Ware 中运行 CM IPC 基本示例? (c2000ware\driverlib\f2838x\examples\c28x_cm\ipc)

    您能否确保以正确的方式编写完 CM 代码。 您还可以参考闪烁示例来了解如何更好地配置 CM 内核。  

    此致、

    Ozino

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Ozino

    我已经根据示例文件建立了 IPC 通信。

    如示例文件中所示、该实现构建在使用中断和标志进行 IPC 通信的基础上。

    此外、我已经在基于 RAM 的执行中验证了正确操作。

    然而、当从闪存运行时、IPC 寄存器的激活会在运行期间间歇性停止。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您开始利用哪个示例? C2000Ware 中提供的 RAM 或闪存示例? 您能否尝试一下是否可以使用基于闪存的示例并在其基础上添加您的代码。

    另外、我不知道在 CM 代码中调用您的 send 命令的确切位置。

    此致、

    Ozino

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    我是根据编写代码的 f2838x_cm_echoback_solution f2838x_cpu1_allocat_ecat_to_cm 示例。

    我还将配置更改为 闪存[有效] General >> Configuration (常规>>配置) 添加了一些闪存函数、以确保正常运行。

    谢谢。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    IPC 寄存器问题是否易于重现还是随机问题? 您是否知道在对代码进行了什么修改后问题才开始发生? 最好是逐步添加代码、直到确定哪一行代码是导致错误的罪魁祸首。 如果您能缩小范围、请告知我们。

    此致、

    Ozino