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.

F28335串口在线更新程序的问题------flash_api code调用擦除函数返回值为24

如题:
我的烧录方法是:
将ti官方提供的flash_api code工程依据自己的需求做合适的修改,编译并转换成16进制的机器码(这个工程会有一个c _init00地址)。
然后在应用程序cmd文件中定义相关的flash段,将16进制的机器码以一个数组的形式存放到分配的段里。
上位机是sdflash,sdflash向dsp发送烧录命令后,应用程序将16进制的机器码从flash段复制到ram中,然后跳转到flash_api code工程的c _init00地址处开始运行。
flash_api code会与上位机握手并传输数据,同时根据上位机的命令执行擦除、编程、校验操作。

目前我的问题是:烧录开始以后  dsp跳转到flash_api code中运行,   但执行擦除操作时,返回值是24(0x18),根据手册 返回值24表示
STATUS_FAIL_PRECOMPACT
-------------------------------------
Erase operation failed because the pre- 
compaction portion failed. The pre-compaction is 
applied to all sectors on the device. The 
FLASH_ST structure will return a fail address 
corresponding to the first sector fails this step. 


奇怪的是我用jtag仿真器将flash_api  code下载到dsp中单步调试,用串口调试工具发送握手报文和擦除指令时,flash_api  code正确调用了擦除函数,且返回值也是正确的0,一旦脱离调试环境,用sdflash软件启动烧录过程,则返回值就成了24,报erase fail 

请问这个错误是什么原因?应该如何解决?  期待TI的专家能有解答。


下面这个帖子和我的情况比较类似,似乎也还没有解决。

www.deyisupport.com/.../69031.aspx