I'm currently building a custom bootloader that needs to reside entirely in Sector A. To do this, I've created a CCS project with only my bootloader code. My aim is to then integrate whatever code changes I've made as well as reuse much of my linker command file for a much bigger project. That bigger CCS project will contain my custom bootloader code as well as code that can be upgraded in the future. The code that doesn't have anything to do with the bootloader can be in sectors B-H.
Here's my issue: the first CCS project that I mentioned above (which only has the bootloader) is now working. Meaning, if I erase sectors B-H, it's still able to try to load code to sectors B-H after a power cycle. Furthermore, I can see from the memory map and the Memory Allocation view that there's nothing in sectors B-H. However, in the memory map, I did notice the following:
.cinit 0 003f42af 0000000c
003f42af 00000005 <whole-program> (.cinit:__lock)
003f42b4 00000005 <whole-program> (.cinit:__unlock)
003f42b9 00000002 --HOLE-- [fill = 0]
This does make sense since in my linker command file, I have the following line:
.cinit : > FLASH_A_BOOT, PAGE = 0
As the name suggests, it's storing all the .cinit in flash sector A. However, in my larger project, this will need to reference sectors B-H instead. This is because as global variables change, there will be a need to overwrite those older variables. Therefore, in the larger project, I would need a line like this:
.cinit : > FLASH_BCDEFGH, PAGE = 0
In that larger project, I'll need to specify a section that puts all the bootloader .cinits in sector A (so that it's not erased when the bootloader executes). However, I'm having trouble finding the global variables that's causing the memory map to list <whole-program> (.cinit:__lock) and <whole-program> (.cinit:__unlock). I tried the following, but it didn't work:
As you can see, the linker couldn't find any .cinits associated with the object files highlighted in yellow. Does anyone know how to find the sources of <whole-program> (.cinit:__lock) and <whole-program> (.cinit:__unlock)? Sorry for the long post.