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.
大家早上好!
错误描述:
在 msp430-gcc-support-files-1.212.zip 存档中、includes/msp430fr5994.h 中 缺少__MSP430_has_FRAM__ define、但显然应该已经设置。
说明:
在 driverlib/MSP430FR5xx_6xx/framctl.c 中、所有函数都在后面进行保护
#ifdef __MSP430_has_FRAM__
MSP430FR5994显然符合支持 FRAM 的产品的条件、该产品需要来自 framctl.c 的这些函数、但在其标头内缺少_MSP430_has_FRAM_、因此在编译期间由于#ifdef 无法访问这些函数。
刚刚仔细查看并运行了以下命令:
grep '__MSP430_HAS_FRAM__' include/*430fr*.h | cut -d ':'-f1 | sort -u >/tmp/have_it
LS -1 include/*430fr*。h >/tmp/all_of_them_fram_devices
diff -u /tmp/all_of_them_fram_devices /tmp/have_it | grep "^-"
似乎有很多器件在其名称中包含430FR (这意味着它们内部具有 FRAM)、并且没有定义_ MSP430_has_FRAM_宏。 您可能需要对此进行研究。 如果您手头没有运行命令的 Linux 计算机、请在下面列出该列表。
可能的修复:
将__MSP430_has _FRAM__定义为属于提供 FRAM 功能的器件的标头或
删除 driverlib/MSP430FR5xx_6xx/framctl.c 中的'ifdef _MSP430_HAS_FRAM____'防护、因为整个 FR5xx_6xx 系列都应该具有 FRAM
包括/ msp430fr2000.h
包括/ msp430fr2100.h
包括/ msp430fr2110.h
包括/ msp430fr2111.h
包括/ msp430fr2153.h
包括/ msp430fr2155.h
包括/ msp430fr2310.h
包括/ msp430fr2311.h
包括/ msp430fr2353.h
包括/ msp430fr2355.h
包括/ msp430fr2422.h
包括/ msp430fr2475.h
包括/ msp430fr2476.h
包括/ msp430fr2512.h
包括/ msp430fr2522.h
包括/ msp430fr2672.h
包括/ msp430fr2673.h
包括/ msp430fr2675.h
包括/ msp430fr2676.h
包括/ msp430fr5041.h
包括/ msp430fr5043.h
包括/ msp430fr50431.h
包括/ msp430fr5720.h
包括/ msp430fr5721.h
包括/ msp430fr5722.h
包括/ msp430fr5723.h
包括/ msp430fr5724.h
包括/ msp430fr5725.h
包括/ msp430fr5726.h
包括/ msp430fr5727.h
包括/ msp430fr5728.h
包括/ msp430fr5729.h
包括/ msp430fr5730.h
包括/ msp430fr5731.h
包括/ msp430fr5732.h
包括/ msp430fr5733.h
包括/ msp430fr5734.h
包括/ msp430fr5735.h
包括/ msp430fr5736.h
包括/ msp430fr5737.h
包括/ msp430fr5738.h
包括/ msp430fr5739.h
包括/ msp430fr57xxgeneric.h
包括/ msp430fr5962.h
包括/ msp430fr5964.h
包括/ msp430fr5992.h
包括/ msp430fr5994.h
包括/ msp430fr59941.h
包括/ msp430fr6005.h
包括/ msp430fr6007.h
包括/ msp430fr6035.h
包括/ msp430fr6037.h
包括/ msp430fr60371.h
包括/ msp430fr6041.h
包括/ msp430fr6043.h
包括/ msp430fr60431.h
包括/ msp430fr6045.h
包括/ msp430fr6047.h
包括/ msp430fr60471.h
包括/ rf430frl152h.h
包括/ rf430frl152h_rom.h
包括/ rf430frl153h.h
包括/ rf430frl153h_rom.h
包括/ rf430frl154h.h
包括/ rf430frl154h_rom.h
由于我的库是针对 msp430fr2355目标编译的、因此我稍微深入地进行了挖掘、该芯片也在上面的黑名单中。
所以
FRAM 器件似乎在器件 msp430foo.h 中包含 legacy.h 头文件
在这个旧头文件中、我们得到了以下代码:
#ifdef __MSP430_has_FRCTL__
#define __MSP430_has_FRAM__
[..]
#endif
因此、每个在其标头中具有__MSP430_has_FRCTL__的芯片也将从上面的代码中获得__MSP430_has_FRAM__。
但是
msp430fr5994未定义__MSP430_has _FRCTL__,因为有人将其更改为__MSP430_has _FRCTL_A__,
因此、当 legacy.h 被解析时、至少不会为 msp430fr5994设置_msp430_has_FRAM__。
请有人仔细检查 MSP430-gcc-support-files 归档文件的维护人员、并告诉我是否可以帮助找到更多的不一致之处。
谢谢、
Peter
我编写了一个小脚本、该脚本将自动编译包含所有 fram 目标的小型测试 main.c、并报告哪些目标最终没有_MSP430_has _FRAM_(请忽略我的第一个帖子中的列表):
https://github.com/rodan/reference_libs_msp430/blob/master/tools/test_headers.sh
~破坏者~
故障接头列表:MSP430FR5041 MSP430FR5043 MSP430FR50431 MSP430FR5720 MSP430FR5721 MSP430FR5722 MSP430FR5723 MSP430FR5724 MSP430FR5725 MSP430FR5726 MSP430FR5727 MSP430FR5728 MSP430FR5729 MSP430FR5730 MSP430FR5731 MSP430FR5731 MSP430FR5739 MSP430FR6043 MSP430FR6043 MSP430FR5735 MSP430FR6043 MSP430FR6043 MSP430FR6043 MSP430FR6043 MSP430FR5739 MSP430FR6043 MSP430FR5731 MSP430FR6043 MSP430FR6043 MSP430FR6043 MSP430FR6043 MSP430FR6043 MSP430FR6043 MSP430FR5731 MSP430FR5731 MSP430FR5739 MSP430FR5739 MSP430FR6043 MSP430FR6043 MSP430FR6043 MSP430FR6043 MSP430FR6043 MSP430FR6043 MSP430FR6043 MSP430FR6043 MSP430FR6043 MSP430FR6043 MSP430FR6043 MSP430FR5731 MSP430FR57