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.

[参考译文] TMS320F28386S:头文件中的某些函数具有链接器 pragma、而其他函数没有。

Guru**** 2535750 points
Other Parts Discussed in Thread: C2000WARE

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

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1201150/tms320f28386s-some-functions-in-header-files-have-linker-pragmas-and-others-do-not

器件型号:TMS320F28386S
主题中讨论的其他器件:C2000WARE


部分

C:\ti\c2000\C2000Ware_4_01_00_00\driverlib\f2838x\driverlib\flash.h


某些函数在文件开头具有链接 pragma:

#ifndef _cplusplus
#pragma code_section (Flash_setBankPowerMode、".TI.ramfunc");
#pragma code_section (Flash_setPumpPowerMode、".TI.ramfunc");
...

或像这样在函数处:
#ifdef _cplusplus
#pragma code_section (".TI.ramfunc");
#endif
静态内联空
FLASH_setBankPowerMode (uint32_t ctrlBase、Flash_BankNumber 组、
                      FLASH_BankPowerMode 电源模式)


一些内联函数不具有链接器 pragma、例如:

//*****
静态内联空
Flash_ClaimPumpSemaphore (Flash_PumpOwnership 包装程序)


为什么会这样? 我需要 Flash_ClaimPumpSemaphore 才能应用此 pragma。

是否有将这样的错误文件复制到我的项目空间并修改我自己的本地副本的解决方案?

此外、为什么函数定义放在头文件中? 它肯定让我跳了起来。

谢谢。

John

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

    您好、John:

    查看了您在文章中提到的函数:必须复制到 RAM 以供执行的函数(根据闪存架构要求)已分配给.TI.ramfunc 部分。   

    如果您希望 从 RAM 执行 Flash_ClaimPumpSemaphore (),您也可以分配。

    关于在头文件中放置函数定义:请打开一个新的帖子、我们的 driverlib 开发团队可以澄清他们这么做的原因。

    谢谢。此致、
    Vamsi

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

    您好、John:

    我可以关闭此帖子吗? 或者、您还有其他相关问题吗?

    谢谢。此致、
    Vamsi

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

    请关闭窗口。