title: Error while writing to the SDRAM
body: <p>I am working on the STM32F7xxx microcontroller. I am quite new to the entire microcontroller programming. I am using the latest STM32F7xxx libraries to build my code. I am using this microcontroller for a SLAM application. Since it doesn't have enough memory I want to save the pose information of the robot in the SDRAM. I use the libraries available at : <a href="http://stm32f4-discovery.com/2015/07/hal-library-11-sdram-for-stm32fxxx/" rel="nofollow">http://stm32f4-discovery.com/2015/07/hal-library-11-sdram-for-stm32fxxx/</a></p>
  
  <p>The code to write a float value to the SDRAM is quite simple, just a line:</p>
  
  <pre><code>    #define TM_SDRAM_WriteFloat(address, value)    (*(__IO float *) (SDRAM_START_ADR + (address)) = (value))
  </code></pre>
  
  <p>My code where I use it is as following:</p>
  
  <pre><code>    void write_Landmark()
      {
      int address = uwIndex_lm;
      SDRAM_Write8(LANDMARK_START_ADR+address,lm_head-&gt;landmark_index);
      address = address +1;
      SDRAM_WriteFloat(LANDMARK_START_ADR+address,lm_head-&gt;pos_x);
      address = address +4;
      SDRAM_WriteFloat(LANDMARK_START_ADR+address,lm_head-&gt;pos_y);
      address = address +4;
      SDRAM_WriteFloat(LANDMARK_START_ADR+address,lm_head-&gt;pos_theta);
      address = address +4;
      SDRAM_Write16(LANDMARK_START_ADR+address,lm_head-&gt;jump_point);
      address = address +2;
      SDRAM_Write8(LANDMARK_START_ADR+address,lm_head-&gt;landmark_detected);
      address = address +1;
      SDRAM_Write8(LANDMARK_START_ADR+address,lm_head-&gt;landmark_corrected);
      address = address +1;
      SDRAM_WriteFloat(LANDMARK_START_ADR+address,lm_head-&gt;hall_angle);
      address = address +4;
      SDRAM_WriteFloat(LANDMARK_START_ADR+address,lm_head-&gt;hall_distance);
      address = address +4;
      SDRAM_Write8(LANDMARK_START_ADR+address,lm_head-&gt;on_curve);
      address = address +1;
      uwIndex_lm = address;
     }
  </code></pre>
  
  <p>The code execution gets stuck at the line where I write float to SDRAM. But if instead of </p>
  
  <pre><code>    SDRAM_WriteFloat(LANDMARK_START_ADR+address,lm_head-&gt;pos_x);
  </code></pre>
  
  <p>I write,</p>
  
  <pre><code>    SDRAM_Write32(LANDMARK_START_ADR+address,lm_head-&gt;pos_x);
  </code></pre>
  
  <p>it works fine. I do understand that I am getting a hard fault here, but I don't really get how to fix this.Any suggestions will be very helpful. Thanks</p>