Sharing library between bootloader and bootloadable projects.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ChVa_3548136
Level 2
Level 2
Welcome!

Hello,

I have a project for PSoC 5 well along that uses a custom bootloader to load a .cyacd file from a SD Card and run it, as well as the ability to download and save new firmware files OTA.  All of these things are working well enough, but I have a question about libraries.

Both the bootloader project and the bootloadable project use the emFile library for accessing the SD Card.  (They also use the same source file for a crc function).  I imagine that this means that the program code for emFile exists in Flash twice in the running system, once for each project.  I'm not running out of flash, but I'm trying to be forward thinking and minimize usage where I can.

My question is this: is it possible for the the bootloadable project to call the emFile functions from within the bootloader section of Flash? 

Chris VanBrederode

0 Likes
1 Solution
GeonaP_26
Moderator
Moderator
Moderator
250 solutions authored 100 solutions authored 50 solutions authored

Bootloadable can call bootloader project functions residing in flash using function pointers. PSoC Creator generates <project>.map file which details function and variable placement in device memory. It is available in Results tab in PSoC Creator.

Please use bootloader project function pointer along with parameters to call from bootloadable project. Please note that resources which the Bootloader Function uses needs to be present in the Bootloadable Project with same configurations.

View solution in original post

0 Likes
1 Reply
GeonaP_26
Moderator
Moderator
Moderator
250 solutions authored 100 solutions authored 50 solutions authored

Bootloadable can call bootloader project functions residing in flash using function pointers. PSoC Creator generates <project>.map file which details function and variable placement in device memory. It is available in Results tab in PSoC Creator.

Please use bootloader project function pointer along with parameters to call from bootloadable project. Please note that resources which the Bootloader Function uses needs to be present in the Bootloadable Project with same configurations.

0 Likes