I would like to be able to compile, link and load a small portion of code (driver) into an arbitrary area of memory and run it.

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

cross mob
AnSa_1225656
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted

I have some firmware in a PSoC4 that runs and communicates to the I2C bus.  I would like to be able to load "drivers" for various I2C devices into the unit at run time.  I do not want to have to maintain N versions of the whole firmware for N sensors as this would be unmanageable.  I need to only load the portion that actually interacts with the sensor.

What I had hoped was that I could compile and manage the drivers separately and load them at run time depending on which sensor was plugged in.  (I already have a method for detecting which sensor is plugged in - hot swap).

I put up a question for this before, but it seems that I was not clear enough on what I was trying to do as it got marked answered and was locked before I was able to respond to a question.

0 Likes
1 Solution
5 Replies
AnSa_1225656
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted

The previous post was this:

I would like to be able to compile a "driver" for some external hardware and load it into flash afte...

I do not want to bootload per se.  Certainly do not want to load a whole new firmware.  I am already familiar with bootloading.

0 Likes

I assume your query is on a method to load various drivers to the same portion of memory in runtime. Without bootloading approach, unfortunately the answer to your query would be no. If memory consumption is the bottleneck, you can use external memory to store various driver versions.

0 Likes

I have plenty of memory.  My question is really how to make the PSoC Creator linker locate the object code to the right memory address in order to be able to execute the code once I load it.  My goal is to compile and link a hex file that I can load into extra ram that I have reserved and then call it from my main firmware..

0 Likes

Please refer to section: 9.2 Placement Procedure to place function at custom location.

0 Likes

Thank you very much.  I looked and looked and somehow did not find this!

0 Likes