title: How to set custom memory region in Keil Scatter Loading Description File
body: <p>so I have a question with regards to the custom Scatter file I am about to use.</p>
  
  <pre><code>; *************************************************************
  ; *** Scatter-Loading Description File generated by uVision ***
  ; *************************************************************
  
  LR_IROM1 0x08000000 0x00008000  {    ; load region size_region
    ER_IROM1 0x08000000 0x00008000  {  ; load address = execution address
     *.o (RESET, +First)
     *(InRoot$$Sections)
     .ANY (+RO)
    }
    RW_IRAM1 0x20000000 0x00002000  {  ; RW data
     .ANY (+RW +ZI)
    }
  }
  </code></pre>
  
  <p>The ROM storage is from <code>0x08000000 ~ 0x08008000</code>. Would it be possible to set take some space from it say e.g. <code>0x08007C00 ~ 0x08007FFF</code> and set it to be a Read and Write region? Let's take that range of memory address as "User Data"</p>
  
  <p>I would be using the "User Data" region in my program as a segment where data can be written while my main program is running and when I power down and power on the device, I can load the data that was previously written to that segment.</p>
  
  <p>I am using a loop and <code>HAL_Flash_Program</code> to write data to the starting memory address of <code>0x08007C00</code>. What are the changes I must make on the Scatter file and possibly on my C file to enable writing data to the specified memory region while my main program is running?</p>
  
  <p>Thanks</p>
  
  <p>*I am using <code>STM32F051</code> micro-controller.</p>