工具/软件:TI C/C++编译器
您好!
为我们的项目开发自定义引导加载程序我需要将其代码放置在闪存中的特殊位置、因此在固件更新期间它不会擦除自身和配置数据。 此引导加载程序使用 usblib 和自定义更新协议、因此我还需要在本节中放置来自 driverlib 的 usblib 和 USB 驱动程序。
问题是当我按如下方式编写链接器命令文件时:
bootu:{ --library=usblib.lib (.text) --library=driverlib.lib (.text) }> boot .bootc:{ --library=usblib.lib (.const) }> boot
在 SECTIONS 块中、这意味着引导是一个特殊的存储器区域、在 USB 器件初始化期间、我遇到了硬件故障、调试这一点、我看到常量数据的重定位不正确、即我看到的
G_ppCDCSerConfigDescriptors 的地址为0x0032b70、但在行上
psInst->sDevInfo.ppsConfigDescriptors = g_ppCDCSerConfigDescriptors;
我看到加载了错误地址0x002CA50的变量、就像常量变量仍然驻留在.const 段中、而不是驻留在.bootc 中一样。
.map 文件显示这些常量的正确位置:
引导 0 00032a68 00000110 00032a68 00000034 usblib.lib:usbdenum.obj (.const:g_psUSBDStdRequests) 00032a9c 00000030 :usbdcd.obj (.const:g_sCDCHandlers) 00032acc 00000023 :usbdcdc.obj (.const:.string:g_pui8CDCSerCommInterface) 00032aef 00000017 :usbdcdc.obj (.const:.string:g_pui8CDCSerDataInterface) 00032b06 00000017 :usbdcdc.obj (.const:.string:g_pui8CDCSerDataInterfaceHS) 00032b1d 00000003 --hole --[填充= 0] 00032b20 00000008 :usbdcdc.obj (.const:g_sCDCCompSerConfigHeader) 00032b28 00000008 :usbdcdc.obj (.const:g_sCDCCompSerConfigHeaderHS) 00032b30 00000008 :usbdcdc.obj (.const:g_sCDCSerCommInterfaceSection) 00032b38 00000008 :usbdcdc.obj (.const:g_sCDCSerConfigHeader) 00032b40 00000008 :usbdcdc.obj (.const:g_sCDCSerConfigHeaderHS) 00032b48 00000008 :usbdcdc.obj (.const:g_sCDCSerConfigSection) 00032b50 00000008 :usbdcdc.obj (.const:g_sCDCSerDataInterfaceSection) 00032b58 00000008 :usbdcdc.obj (.const:g_sCDCSerDataInterfaceSectionHS) 00032b60 00000008 :usbdcdc.obj (.const:g_sIADSerConfigSection) 00032b68 00000004 :usbdcdc.obj (.const:g_pCDCCompSerConfigDescriptors) 00032b6c 00000004 :usbdcd.obj (.const:g_pCDCCompSerConfigDescriptionersHS) 00032b70 00000004 :usbdcdc.obj (.const:g_ppCDCSerConfigDescriptors) 00032b74 00000004 :usbdcdc.obj (.const:g_ppCDCSerConfigDescriptionorsHS)
我出了什么问题?