Tool/software: TI C/C++ Compiler
Hello!
Developing custom boot loader for our project I need to place it's code to special place in FLASH, so it will not erase itself and configuration data during firmware update. This bootloader uses usblib and custom update protocol, so I need to place usblib and usb driver from driverlib also in this section.
The problem is when I write a linker command file as this:
.bootu: { --library=usblib.lib(.text) --library=driverlib.lib<usb.obj>(.text) } > BOOT .bootc: { --library=usblib.lib(.const) } > BOOT
in SECTIONS block, meaning BOOT is a special memory region, I got a hardware fault during USB device initialization, and debugging this point I see the relocations for const data is not correct, i.e. I see
g_ppCDCSerConfigDescriptors has address 0x0032b70, but on the line
psInst->sDevInfo.ppsConfigDescriptors = g_ppCDCSerConfigDescriptors;
I see the variable loaded with incorrect address of 0x002CA50, as if the const variable still resided in .const section, not in .bootc.
.map file shows correct locations for these consts:
.bootc 0 00032a68 00000110 00032a68 00000034 usblib.lib : usbdenum.obj (.const:g_psUSBDStdRequests) 00032a9c 00000030 : usbdcdc.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-- [fill = 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 : usbdcdc.obj (.const:g_pCDCCompSerConfigDescriptorsHS) 00032b70 00000004 : usbdcdc.obj (.const:g_ppCDCSerConfigDescriptors) 00032b74 00000004 : usbdcdc.obj (.const:g_ppCDCSerConfigDescriptorsHS)
What am I doing wrong?