- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Basically, I have a sensor system that has various I2C sensors that can be plugged into it. I won't know at main firmware development time which I2C sensors will be plugged in, so I can't provide the code to read them at firmware development time. I would like to generate the "driver" code for the I2C sensor after the fact and load it into flash via my normal communications channel at a later time (be able to load different "driver") code at different times. The driver routine will be passed pointers to the needed functions and variables in the main firmware, so no fixup needed for that. I assume that locating this driver code in a standard address in flash will allow the main code to call it. How would one go about compiling/linking/locating this driver code so that it can be coppied directly into flash at a later time?
- Labels:
-
PSoC Creator Software
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It looks like the cyelftool.exe generates the .hex file, but I can't see in the documentation any description of that process.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Wow, looks like I stumped the experts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can implement bootloader-bootloadable architecture to meet the driver update requirement.
- As you pointed out, bootloader can contain the main firmware which uses functions in bootloadable image. Function pointers can be used to call functions from the other application flash area. However, you would need to know the function pointers and approximate API flash consumption while developing the main firmware.
- You can keep the design simple and straight forward by combining the driver part and the main firmware. This combined bootlodable image can be sent over communication protocol for bootloading. In this case bootloader will consist of bootloader component+communcation protocol+necessary services.
- You can also use dual-application bootloader option, which allows two bootloadable applications to reside in flash. You can either seperate out main firmare and driver as two images. Or use dual applications as two versions of combined main firmware+driver image. The later is useful for designs that require a guarantee that there is always a valid application that can be run.
PSoC Creator generates bootloader+bootloadable combined hex image and bootloadable code+data file (.cyacd format) as part of build process. Please use Bootloader Code Examples for PSoC® 3/PSoC 4/ PSoC 5LP to understand more details on bootloader architecture.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your response! You helped with the ida to maybe use dual boatloader. I have done boat-loaders in the past to replace the whole firmware. Unfortunately, the drivers need to be loaded by the main firmware as needed and may possibly contain a combination of drivers. Combining the drivers and firmware into one image is not really feasible due to the use cases I am addressing.
Are you saying that I could use the dual image to load the main firmware and the other image would be the driver? How would I go about preparing the driver hex? That is actually the piece I am most confused by because I am not sure how the cyelftool.exe and rest of tool chain works. I was having a hard time finding detailed documentation on it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To combine dual-application hex files, refer Combine Dual-application Bootloadable Hex Files for Production Programming– KBA224390
Please refer to sections: 8.1 Project Files, 7.2 Adding Bootloadable Applications, 8 Loading Your Projects into PSoC of https://www.cypress.com/documentation/application-notes/an73854-psoc-3-psoc-4-and-psoc-5lp-introduct... for more detials on various files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I really appreciate your response. You mention combining the applications? That seams to be opposite of what I am trying to do. Did I miss something? I really need to know how to locate an external set of code so that I can load it later without replacing the main firmware which needs to keep running. This is a dynamic load.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Could you please confirm what you meant by dynamic load? Is it bootloading over communication protocol or programming over SWD?
If it's bootloading; as elaborated in shared documents, bootloadable project creates .cyacd file which contains only the bootloadable project. Bootloadable hex file is different from normal project as it combines both bootloader and bootloadable. However, .cyacd contains code and data for bootloadable project only.