This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Application and Firmware Separation in Cortex M4

Hi Guys

I'm busy with a massive project where I need write software for a control system for an automotive vehicle. Here's what I am using:

1. I'm using an STM32F4 for the micro
2. I am writing the Application (Control app) in Matlab Simulink. I then generate Cortex M4 optimised code from Matlab which I simply Include in my Keil uVision Project. (Works like a charm)
3. I manually write software for the driver layer and to interface to the Hardware abstraction Layer.

I would like to maintain separation between my Simulink Generated Code and my 'firmware' hand written code. Essentially, I want to be able to change the firmware without affecting my control application.

I would like to use a configuration file to map the variables that Matlab Simulink generates with my Hardware Registers (for GPIO, for instance). I would like to do this via a configuration file (e.g. via an xml file).

Has anyone ever done something like this and is it even possible. I'm looking for an elegant solution that does not consume a lot of RAM.

Thanks so much!

PS: Is it possible to declare variables in your code based on variables names that are stored in say an .xml or .txt file.

So if in the .txt file I have "Pressure_Sensor = 0", is it possible, perhaps using a Macro Definition, to declare a variable in the code: Pressure_Sensor = 0;

Parents Reply Children
  • Yeah that'd be easy, except I need to do the variable mapping post compilation.

    I want to be to change a set of variables( say K1 and K2) that are mapped to say GPIO PortC pin 1 & 2 to Pin 3 or 4 using only a configuration file that I load during run time...

    I'm probably not explaining myself too well... :-(

    The code is for an automotive application and it really helps not to recompile code in the field because vehicle wiring changed slightly.

    Thanks

  • Then make sure you split the two halves completely, and have the core functionality act as a loader of your application portion. I'd have a linker generate me an ELF executable image, and load that into RAM against the pin translation table in a configuration file.