title: Why stm32f103's elf file works well, but binary not?
body: <p>I'm trying to run out my firmware inside stm32f103. So when I use opencod+gdb uploading and debugging elf file, everything is fine, my firmware is working and I can set and remove breakpoints.</p>
  
  <p>But it doens't work when I try to upload this firmware (which was built together with elf file) using st-flash and writing it into <code>0x8000000</code>. Although I get the message that 'the firmware was uploaded successfully'.</p>
  
  <p>I can see if my code runs when my leds start blinking.</p>
  
  <p>BOOT0 is connected to the DTR pin of a cp2102 via npn transistor, according to the datasheet to enable bootloader. I have to set BOOT0 to high. But my serial (cp2102) is not connected when I upload my fw via st-link. So I think that DTR pin is floating or pulled down. Where is my mistake?</p>
  
  <p>I was trying to mass erase my flash before uploading, it gives the same results</p>
  
  <p><a href="https://i.stack.imgur.com/RLLgE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RLLgE.png" alt="schematic"></a></p>
  
  <p>here is my linker's ld file:</p>
  
  <pre><code>MEMORY
  {
    RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K
    CCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 0
    FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 64K
    FLASHB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
    EXTMEMB0 (rx) : ORIGIN = 0x00000000, LENGTH = 0
    EXTMEMB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
    EXTMEMB2 (rx) : ORIGIN = 0x00000000, LENGTH = 0
    EXTMEMB3 (rx) : ORIGIN = 0x00000000, LENGTH = 0
    MEMORY_ARRAY (xrw)  : ORIGIN = 0x00000000, LENGTH = 0
  }
  </code></pre>
  
  <p>and sections <a href="https://pastebin.ubuntu.com/p/N32zQf9sCm/" rel="nofollow noreferrer">https://pastebin.ubuntu.com/p/N32zQf9sCm/</a></p>