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.
您好、专家:
变量不能在28377D CPU2工程的 C 文件中更改、C 文件不是 main.c、它是"UARTprinter.c"、定义为 UINT16的变量"ReceivedChar"、当接收到一个字符时、它将被 分配 给 ReceivedChar 、 但我只能看到 ReceivedChar 在被分配到接收的字符之后仍然是默认值。
原因是什么?
BR/阿尔文
main.c 中的变量工作正常。
您好!
您可以附加 main.c 和 UARTprinter.c 文件吗? 问题是否仅与 UARTprinter.c 中的这个变量有关(即来自 UARTprinter.c 的其他变量和函数的行为是否符合预期?
谢谢。
阿纳维
您好!
感谢您的答复、我已经解决了这个问题。 我认为无法更改所有变量、因为它们位于 CPU2无写入访问权限的全局 RAM 中。 配置内存设置可以解决此问题。 这会将 RAMGSx 的写入权限分配给 CPU2
MemCfgRegs.GSxMSEL.bit.MSEL_GS10 = 1;
BR/阿尔文