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.

Share functions between 2 images

Other Parts Discussed in Thread: MSP430F5253, CC3100

Apologies if this has been answered before, but I couldn't find anything...

Is there a way to share functions between 2 separate images? What I'm looking to do is create a bootloader that uses several drivers (UART, SPI, and CC3100 Simplelink), and have a separate application image that uses the same drivers instead of each image having its own copy. Is there a way to do this by having the bootloader export symbols or something? I'm using CCS v6.1 with MSP430F5253 processor.

  • Any feedback on this? BTW, we upgraded to CCS 6.1.1, but the same question applies.
  • I know it's not what you asked for, but you might want to reconsider using the same drivers for boot code and application.

    Sure, it will take up more space to have duplicate (but separate) code, but if someone tries to upgrade the application and things are messed up, you'll still be able to talk to the device if boot code and application are kept completely separate.
  • Thanks for the reply Michael. You are correct, but what I had in mind is the shared drivers would be part of the bootloader, so they would likely not change. The reason I want to consider this is our product is utilizing a serial flash device connected to the CC3100 for storage of code images and other files. So if we were to update the application code via the bootloader, the bootloader would need to read the new application image file via the CC3100. Thus, the CC3100 Simplelink drivers are needed by the bootloader. The issue is that the size of the Simplelink drivers is on the order of 8K... thus the desire to not duplicate it. I do know the concept is possible as the CC26xx build tools provide the ability to import symbols/addresses of ROM based code, so I was hoping the same concept was available with the CCS toolchain.
  • OK, I can't help you with the shared drivers, but would it be possible to implement a "dumbed down" Simplelink driver with only basic functionality for the boot loader?
    You'll still need to copy the 8K driver for the App, but at least it will save you some space.
    Or is it the actual time for copying those 8K you want to avoid?
  • Since the Simplelink driver is a deliverable from TI, we don't want to mess with it too much as it could become a maintenance issue. It does come with the ability to dumb it down, but I think it was still about 6K, so it didn't save much. The issue isn't so much with the time copying the Simplelink drivers; it's the code space eaten up by the duplicate code.
  • Edward - One option is to create a symbol library of the image that has the driver code and then include that symbol library in the project for the other image that will make calls to that same driver code. That way you are not duplicating code.

    An example is discussed in this thread:
    e2e.ti.com/.../927276

    Hope this helps
    ki
  • Thanks Ki - that sounds promising, and I'll check it out!
  • Hi,

    Edward Ferrari56 said:

    Apologies if this has been answered before, but I couldn't find anything...

    Is there a way to share functions between 2 separate images? What I'm looking to do is create a bootloader that uses several drivers (UART, SPI, and CC3100 Simplelink), and have a separate application image that uses the same drivers instead of each image having its own copy. Is there a way to do this by having the bootloader export symbols or something? I'm using CCS v6.1 with MSP430F5253 processor.

    Perhaps Example 3 of the wiki page below helps?
    Regards,
    Rafael