I'm looking for a PSoC 4 bootloader that loads an image from an external buffer (ext. flash in this case, which has the cyacd file in it).
I'll make sure the image gets inside the flash from my end, I can provide the bootloader with the char array of the cyacd file, or line by line, whatever works. What I am looking for is the code that loads that cyacd file to the flash.
All bootloaders seem to be made to run from a communication protocol rather than from an external buffer.
Now the BLE examples have an external flash bootloader demo, but I dont really see the separation between bluetooth and the bootloading.
I guess a good start would be to have a bootloader that starts with a (hardcoded) images string (cyacd file contents) as an input. Does anyone have such a thing? The rest I can do myself
If I am approaching things the wrong way, or if I am not clear what I need, let me know
Solved! Go to Solution.
Thank you for the reply.
This seems to be what I am looking for. Though it all looks so hacky, since it is sort of an emulation of the bootloader protocol, and on top of that, the example does not feature any hardware abstraction making it not easy to read and understand.
The bootloadable / image write part I do understand, but I don't see the purpose of CyBtldrCommWrite function in the bootloader. It almost looks like the bootloader is WRITING commands to the memory during the bootload process.
Can you please enlighten me on the communication between bootloader and memory? Why is it writing stuff?
On a more general note, as a feature request;
I highly doubt I am the only one wanting to boot from alternate memory-based sources, it might be worth investing some time in getting the bootloader component updated and an example done with a proper interface meant for memory access instead of those CyBtldrCommRead/Write functions. Maybe make CyBtldrMemRead/Write functions for direct memory access in future versions of the bootloader. This really is a must-have in many IoT applications, especially when reliability of communication is unreliable.
Any programmer can get an image in a piece of memory, I would just need a function that tells me which data/string/array the bootloader wants to read.
I did a bootloader implementation that seems like the solution provides by hima.
I'm getting some problems, that I'll discuss in another thread.
Well, about your question the usage of CyBtldrCommWrite is up to you. I think that he used this approach because is easier to write the bootloader, you only shold have to write the functions CyBtldrCommStart, CyBtldrCommStop, CyBtldrCommReset, CyBtldrCommWrite and CyBtldrCommRead.