title: Application and Firmware Separation in Cortex M4
body: <p>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:</p>
  
  <ol>
  <li>I'm using an STM32F4 for the micro</li>
  <li>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)</li>
  <li>I manually write software for the driver layer and to interface to the Hardware abstraction Layer.</li>
  </ol>
  
  <p>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.</p>
  
  <p>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).</p>
  
  <p>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.</p>
  
  <p>Thanks so much!</p>
  
  <p>PS: Is it possible to declare variables in your code based on variables names that are stored in say an .xml or .txt file.</p>
  
  <p>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;</p>