TI中文支持网
TI专业的中文技术问题搜集分享网站

TMS570LS0432 BootLoad FLASH API函数调用有问题

参考TI 官方BootLoad 程序,使用HerCoGen 生产的底层程序,接受DOWNLOAD 消息时,调用函数

BLInternalFlashStartAddrCheck( g_ulTransferAddress, g_ulTransferSize ) 时, g_ulTransferAddress = 0x00020000;  g_ulTransferSize = 0x000003e8;

当debug 单步调试进入函数BLInternalFlashStartAddrCheck(uint32_t ulAddr, uint32_t ulImgSize) ,ulAddr = 0x09B56E12  ulImgSize = 0x00142000;

形参的数值发生了变化 ,很奇怪的值,不知道是什么原因造成的?

Flash API 运行在RAM中,cmd 配置如下:

–retain="*(.intvecs)"

MEMORY
{
VECTORS (X) : origin=0x00000000 length=0x00000020
FLASH_API (RX) : origin=0x00000020 length=0x000014E0
FLASH0 (RX) : origin=0x00001500 length=0x0005EB00 //LS04x and RM42 Flash size is 0x60000
SRAM (RW) : origin=0x08002000 length=0x00006000 //LS04x and RM42 SRAM size is 0x8000
STACK (RW) : origin=0x08000000 length=0x00002000
}
SECTIONS
{
.intvecs : {} > VECTORS
flashAPI :
{
.\source\Fapi_UserDefinedFunctions.obj (.text)
.\source\bl_flash.obj (.text)

–library= F021_API_CortexR4_BE.lib < FlashStateMachine.IssueFsmCommand.obj
FlashStateMachine.SetActiveBank.obj
FlashStateMachine.InitializeFlashBanks.obj
FlashStateMachine.EnableMainSectors.obj
FlashStateMachine.IssueFsmCommand.obj
FlashStateMachine.ScaleFclk.obj
Init.obj
Utilities.CalculateEcc.obj
Utilities.WaitDelay.obj
Utilities.CalculateFletcher.obj
Read.MarginByByte.obj
Read.Common.obj
Read.FlushPipeline.obj
Read.WdService.obj
Async.WithAddress.obj
Program.obj > (.text)
} load = FLASH_API, run = SRAM, LOAD_START(api_load), RUN_START(api_run), SIZE(api_size)

.text > FLASH0
.const > FLASH0
.cinit > FLASH0
.pinit > FLASH0
.data > SRAM
.bss > SRAM
}

做了一个简单测试,将CMD 中FLASH API 相关删掉后,让函数运行在FLASH 中,入参带入就没什么问题,但是BootLoad 需要将Flash 函数运行在RAM中,问题一直无法解决。

flashAPI :
{
.\source\Fapi_UserDefinedFunctions.obj (.text)
.\source\bl_flash.obj (.text)

–library= F021_API_CortexR4_BE.lib < FlashStateMachine.IssueFsmCommand.obj
FlashStateMachine.SetActiveBank.obj
FlashStateMachine.InitializeFlashBanks.obj
FlashStateMachine.EnableMainSectors.obj
FlashStateMachine.IssueFsmCommand.obj
FlashStateMachine.ScaleFclk.obj
Init.obj
Utilities.CalculateEcc.obj
Utilities.WaitDelay.obj
Utilities.CalculateFletcher.obj
Read.MarginByByte.obj
Read.Common.obj
Read.FlushPipeline.obj
Read.WdService.obj
Async.WithAddress.obj
Program.obj > (.text)
} load = FLASH_API, run = SRAM, LOAD_START(api_load), RUN_START(api_run), SIZE(api_size)

Susan Yang:

能否给出详细的例程路径?我明天看看有没有这个板子做一下测试

user3791525:

回复 Susan Yang:

谢谢 已经解决了。 _copyAPI2RAM_ 没移植到 void _c_int00(void)中

Susan Yang:

回复 user3791525:

很高兴您能解决问题

赞(0)
未经允许不得转载:TI中文支持网 » TMS570LS0432 BootLoad FLASH API函数调用有问题
分享到: 更多 (0)