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.

TMS320C5517: 5517固化程序问题

Part Number: TMS320C5517


自己做的板,我想固化程序,参考bootloader,我总结了一下烧写过程

1、用记事本打开M文件;
hex55 -boot -v5505 -serial8 -b -o DSP_TEST.bin DSP_TEST.out
//程序说明:CCS软件对项目进行编译链接后,生成.out文件;上述语句的目的是将.out文件转化为DSP可识别的二进制机器码,即.bin文件。
2、修改文件中的DSP_TEST.out为工程输出的.out文件名;修改文件中DSP_TEST.bin为目标二进制机器码的名称。
3、保存并关闭。
4、当工程编译完成后,获得最新的.out文件。
5、双击M文件,实现.out文件到.bin文件的转换。
6、进入调试模式,选择DEBUG菜单下的load选项,选中并load文件夹中programmer_C5535_eZdsp.out文件。
7、全速运行,在弹出框内输入步骤5获得的.bin文件的绝对地址,回车。(擦除flash的操作,随便输入无效路径即可,待提示擦除完成即可)
8、等待至提示program complete,即完成烧写,退出调试模式即可。

我按照以上过程,验证了一个简单的管脚翻转程序,掉电重启后程序能正常工作,但是我烧写另外的程序时,掉电后程序就运行不了了,请教,是我上述过程有错还是什么原因?

  • 请参考下面c5517 flash启动文档7 Common Mistakes in Boot Image User Code,看一下注意事项。
    https://www.ti.com/lit/ug/spruhw2/spruhw2.pdf

  • 我看文档上有推荐在程序里面加上

    asm(" *port(#0x1C1F) = #0x0 "); //Clock Configuration MSW reg
    // program PLL to 50MHz
    asm(" *port(#0x1c20) = #0x2055 "); //PLL Control 1 reg
    asm(" *port(#0x1c21) = #0x0001 "); //PLL Control 2 reg
    asm(" *port(#0x1c22) = #0x0010 "); //PLL Control 3 reg
    asm(" *port(#0x1C23) = #0x0001 "); //PLL Control 4 reg
    // wait at least 4 milli sec for PLL to lock
    asm(" repeat(0xC350) ");
    asm(" nop "); // wait 1ms @ 50Mhz: 0x001s * 50 Mhz = 50000

    但是我把这些汇编语句加入主程序,编译报错如下

    "C:\Users\yin\AppData\Local\Temp\1507610", ERROR! at line 2158: [E9999]
    Illegal directive or mnemonic
    *port(#0x1C1F) = #0x0

    "C:\Users\yin\AppData\Local\Temp\1507610", ERROR! at line 2160: [E9999]
    Illegal directive or mnemonic
    *port(#0x1c20) = #0x2055

    "C:\Users\yin\AppData\Local\Temp\1507610", ERROR! at line 2162: [E9999]
    Illegal directive or mnemonic
    *port(#0x1c21) = #0x0001

    "C:\Users\yin\AppData\Local\Temp\1507610", ERROR! at line 2164: [E9999]
    Illegal directive or mnemonic
    *port(#0x1c22) = #0x0010

    "C:\Users\yin\AppData\Local\Temp\1507610", ERROR! at line 2166: [E9999]
    Illegal directive or mnemonic
    *port(#0x1C23) = #0x0001

    "C:\Users\yin\AppData\Local\Temp\1507610", ERROR! at line 2168: [E9999]
    Syntax Error
    repeat(0xC350)

    "C:\Users\yin\AppData\Local\Temp\1507610", ERROR! at line 2168: [E9999]
    Invalid mnemonic specified
    repeat(0xC350)

    请问是什么问题

  • *port是Algebraic代数指令。请试试在ccs->Properties -> C/C++-Build -> Runtime Model Options下面勾选 "Codegen outputs algebraic assembly" ,"Select assembly source language" 选择 Algebraic。