title: STM32L073RZ (rev Z) IAP jump to bootloader (system memory)
body: <p>I use the STM32L073RZ (Nucleo 64 board).</p>
  
  <p>I would like to jump into the system memory in application programming (IAP).</p>
  
  <p>My code works on the revision B of the STM32L073 microcontroller but fails on the latest revision, rev Z.</p>
  
  <p>I read the errata sheet, no details are given, just a limitation fixed on the dual boot mechanism into system memory according to the BFB2 bit.</p>
  
  <p>Is the system memory no longer supports an IAP jumping to execute its code (to flash firmwares through USB or UART without using the BOOT0 pin) ?</p>
  
  <p>The function is the first line of my main program, it tests if the code has to jump to the booloader:</p>
  
  <pre><code>void jumpBootLoader(void)
  {
      /* to do jump? */
      if ( *((unsigned long *)0x20003FF0) == 0xDEADBEEF  ) 
      {
          /* erase the label */
          *((unsigned long *)0x20003FF0) = 0xCAFEFEED;
  
          /* set stack pointer to the bootloader start address */
          __set_MSP(*((uint32_t*)(0x1FF00000)));
  
          /* system memory mapped at 0x00000000 */
          __HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH();
  
          /* jump to @bootloader + 4 */
          ((void (*)(void))(*((uint32_t*)(0x1FF00004))))();
      }
  }   
  </code></pre>
  
  <p>I call these two lines as soon as the BP1 button is pressed to trig the jump operation after resetting the µC:</p>
  
  <pre><code>*((unsigned long *)0x20003FF0) = 0xDEADBEEF;
  NVIC_SystemReset();
  </code></pre>
  
  <p>I use the HSI 16Mhz clock source.</p>