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.

[参考译文] TM4C1294NCPDT:从调试器刷写程序有效;LM 闪存必须进行奇数代码更改

Guru**** 2540720 points


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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1123609/tm4c1294ncpdt-flashing-program-from-debugger-works-with-lm-flash-have-to-make-odd-code-changes

器件型号:TM4C1294NCPDT

从 CCS 调试工具中刷写时、我的程序完全正常运行。

当我创建一个二进制文件并使用 LM 闪存时、我必须对代码进行奇数调整才能使其正确运行。

例如、从 CCS 内刷写时、以下代码正确运行。  但是、当转换为二进制文件并使用 LM 闪存刷写时、它会立即崩溃。

int etherInit(void)
{
    /* normal code */
    ipaddr_aton(OUR_IP,&gd.requestedIpAddr);

    /* normal code */
    ipaddr_aton(OUR_SUBNET,&gd.subnetMask);
}

插入以下行、允许代码从 CCS 和 LM 闪存运行。

int etherInit(void)
{
    /* had to add this to have the program run correctly using LM Flash */
    gd.u32_junk_variable++;

    /* normal code */
    ipaddr_aton(OUR_IP,&gd.requestedIpAddr);

    /* had to add this to have the program run correctly using LM Flash */
    gd.u32_junk_variable++;

    /* normal code */
    ipaddr_aton(OUR_SUBNET,&gd.subnetMask);
}

无论编译器/链接器配置的变体是什么(优化级别、数据对齐等)、使用 CCS 刷写代码时、代码始终有效。

但是、在刷写 LM 闪存时、任何内容都不允许我删除垃圾变量递增器。

任何建议都将受到非常欢迎、

Peter

环境:

Code Composer Studio 版本:11.2.0.00007

调用:ARM 编译器
"c:/ti/ccs1120/cs/tools/compiler/ti-cgt-arm_20.2.LTS / bin/armcl"-mv7M4 -code_state=16 -float_support=FPv4SPD16 -me -fp1 -fp_mode=relaxed -include_tradeway/ti_tran.transc/ove/tif_tran.tran.transc/tran.tran.tran.transc/tran.tran.transc/include/tine/tex-tran.tran.tran.tran.tran/tran/transc/tran.tran.tran.tran.tran.transc/tran.transc/tran.tran.tran.tran.tran.tran.tran.tran.tran.tran.tran.tran.tran.tran.tran.transc/content/tex-content/content/content/content/content/content/content/content/tran.
建筑完工:"../乙醚.c"

构建目标:"FlexGen.out"
调用:ARM 链接器
"c:/ti/ccs1120/ccs/tools/compiler/ti-cgt-arm_20.2.LTS / bin/armcl"-mv7M4 -code_state=16 -float_support=FPv4SPD16 -me -op1 -fp_mode=relaxed=ccs="ccs"-code_status=tex-mag/cc=tex-code.tex-ctrab-code.tex-codest-codest-ctrab-codest-codest-mag=tex-mag-mag-ctrab-codest-cortex-mag-m=tex-m=tex-mag-mag-mag-mag-cortex-mag-cortex-cortex-mag-cortex-m=tex-cortex-cortex-cortex-cortex-cortex-codest-cortex-cortex-cortex-tex-tex-codest-cortex-tex-ctr- xml_link_info="FlexGen_linkInfo.xml"--rom_model -o "FlexGen.out""/dataCollect.obj ""/datib.lib""/define./define.obj "./dq.obj "./filter.obj "./hardware./librt/latit.htm"/content/tobj "/latit.cn/tools.html/rtobj "/latit./latit./latit.cn/lib.cn/tools/tobj status.htm.htm./latit.htm.htm.htm.htm./latit.html/rtobj "/latit./latit.htm.htm.htm.htm.htm.htm./latit.htm./latits.htm./latits.html/rtobj

完成构建目标:"FlexGen.out"

构建次要目标:"FlexGen.bin"
调用:ARM 十六进制实用程序
"C:/ti/ccs1120/ccs/tools/compiler/ti-cgt-arm_20.2.ls/bin/armhex"--fill=0 --binary -o "FlexGen.bin""FlexGen.out"
正在转换为二进制格式...
"FlexGen.out".intvecs =>.intvecs
"FlexGen.out".text =>.text
"FlexGen.out".const =>.const
"FlexGen.out".cinit =>.cinit
已完成构建次要目标:"FlexGen.bin"

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

    您好、Peter、

    使用 IDE 进行调试会增加代码执行的一些开销、这会略微减慢执行速度。 当您自由运行时、代码执行速度更快。 因此、似乎需要较短的延迟才能完成代码段的处理或发送。 使用 IDE 时、需要较慢的执行掩码、这就是自由运行映像崩溃的原因。

    此致、

    Ralph Jacobi

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

    您好!

    感谢您的快速响应。

    为清楚起见、我应该降低系统时钟频率、还是应该在代码中的最早入口点插入某种延迟?

    再次感谢、

    Peter

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

    似乎在代码中最早添加一个短延迟已解决问题。  更改系统时钟速度没有任何影响。

    感谢您的建议!

    两天来、我一直在挖头发、认为我肯定遇到了链接器/armhex 配置问题。

    Peter