<html>
  <head>
    <meta content="text/html; charset=ISO-8859-2"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Jinak je dokumentace spoustu napr. v
      dokumentu porovnani CPU, zrovna jsem na to narazil:<br>
      <br>
      STM32F10x and STM32F0xx Flash driver API correspondence
      <div class="" data-canvas-width="364.07399999999996"
        data-angle="0" data-font-name="g_font_2" style="position:
        absolute; left: 226.3px; top: 301.629px; font-size: 15px;
        font-family: sans-serif; transform: rotate(0deg) scale(1.02268,
        1); transform-origin: 0% 0% 0px;">STM32F10x Flash driver API S</div>
      <div class="" data-canvas-width="190.68149999999997"
        data-angle="0" data-font-name="g_font_2" style="position:
        absolute; left: 590.399px; top: 301.629px; font-size: 15px;
        font-family: sans-serif; transform: rotate(0deg) scale(1.01426,
        1); transform-origin: 0% 0% 0px;">TM32F0xx Flash driver API</div>
      <div data-canvas-width="162.12599999999998" data-angle="-90"
        data-font-name="g_font_2" style="position: absolute; left:
        134.43px; top: 500.199px; font-size: 15px; font-family:
        sans-serif; transform: rotate(-90deg) scale(1.00699, 1);
        transform-origin: 0% 0% 0px;">Interface configuration</div>
      <div class="" data-canvas-width="225.057" data-angle="0"
        data-font-name="g_font_1" style="position: absolute; left:
        175px; top: 333.329px; font-size: 15px; font-family: sans-serif;
        transform: rotate(0deg) scale(0.957689, 1); transform-origin: 0%
        0% 0px;">void FLASH_SetLatency(uint32_t </div>
      <div class="" data-canvas-width="118.146" data-angle="0"
        data-font-name="g_font_1" style="position: absolute; left:
        175px; top: 351.629px; font-size: 15px; font-family: sans-serif;
        transform: rotate(0deg) scale(0.98455, 1); transform-origin: 0%
        0% 0px;">FLASH_Latency);</div>
      <div class="" data-canvas-width="343.2614999999999" data-angle="0"
        data-font-name="g_font_1" style="position: absolute; left:
        488.2px; top: 342.43px; font-size: 15px; font-family:
        sans-serif; transform: rotate(0deg) scale(0.966934, 1);
        transform-origin: 0% 0% 0px;">void FLASH_SetLatency(uint32_t
        FLASH_Latency);</div>
      <div class="" data-canvas-width="153.195" data-angle="0"
        data-font-name="g_font_1" style="position: absolute; left:
        175px; top: 379.93px; font-size: 15px; font-family: sans-serif;
        transform: rotate(0deg) scale(0.939847, 1); transform-origin: 0%
        0% 0px;">void FLASH_PrefetchB</div>
      <div data-canvas-width="123.56099999999999" data-angle="0"
        data-font-name="g_font_1" style="position: absolute; left:
        328.199px; top: 379.93px; font-size: 15px; font-family:
        sans-serif; transform: rotate(0deg) scale(0.943214, 1);
        transform-origin: 0% 0% 0px;">ufferCmd(uint32_t </div>
      <div class="" data-canvas-width="160.5105" data-angle="0"
        data-font-name="g_font_1" style="position: absolute; left:
        175px; top: 398.331px; font-size: 15px; font-family: sans-serif;
        transform: rotate(0deg) scale(0.938658, 1); transform-origin: 0%
        0% 0px;">FLASH_PrefetchBuffer);</div>
      <div class="" data-canvas-width="327.40049999999997"
        data-angle="0" data-font-name="g_font_1" style="position:
        absolute; left: 488.2px; top: 379.93px; font-size: 15px;
        font-family: sans-serif; transform: rotate(0deg) scale(0.93811,
        1); transform-origin: 0% 0% 0px;">void
        FLASH_PrefetchBufferCmd(FunctionalState </div>
      <div data-canvas-width="73.755" data-angle="0"
        data-font-name="g_font_1" style="position: absolute; left:
        488.2px; top: 398.331px; font-size: 15px; font-family:
        sans-serif; transform: rotate(0deg) scale(0.957857, 1);
        transform-origin: 0% 0% 0px;">NewState);</div>
      <div class="" data-canvas-width="294.123" data-angle="0"
        data-font-name="g_font_1" style="position: absolute; left:
        175px; top: 426.631px; font-size: 15px; font-family: sans-serif;
        transform: rotate(0deg) scale(0.964338, 1); transform-origin: 0%
        0% 0px;">void FLASH_HalfCycleAccessCmd(uint32_t </div>
      <div class="" data-canvas-width="178.12949999999998"
        data-angle="0" data-font-name="g_font_1" style="position:
        absolute; left: 175px; top: 444.931px; font-size: 15px;
        font-family: sans-serif; transform: rotate(0deg) scale(0.978734,
        1); transform-origin: 0% 0% 0px;">FLASH_HalfCycleAccess);</div>
      <div data-canvas-width="20.775" data-angle="0"
        data-font-name="g_font_1" style="position: absolute; left:
        488.2px; top: 435.829px; font-size: 15px; font-family:
        sans-serif; transform: rotate(0deg) scale(1.03875, 1);
        transform-origin: 0% 0% 0px;">NA</div>
      <div class="" data-canvas-width="283.13999999999993"
        data-angle="0" data-font-name="g_font_1" style="position:
        absolute; left: 175px; top: 473.329px; font-size: 15px;
        font-family: sans-serif; transform: rotate(0deg) scale(0.966348,
        1); transform-origin: 0% 0% 0px;">void FLASH_ITConfig(uint32_t
        FLASH_IT, </div>
      <div data-canvas-width="181.95899999999997" data-angle="0"
        data-font-name="g_font_1" style="position: absolute; left:
        175px; top: 491.629px; font-size: 15px; font-family: sans-serif;
        transform: rotate(0deg) scale(0.947703, 1); transform-origin: 0%
        0% 0px;">FunctionalState NewState);</div>
      <div class="" data-canvas-width="283.12649999999996"
        data-angle="0" data-font-name="g_font_1" style="position:
        absolute; left: 488.2px; top: 473.329px; font-size: 15px;
        font-family: sans-serif; transform: rotate(0deg) scale(0.966302,
        1); transform-origin: 0% 0% 0px;">void FLASH_ITConfig(uint32_t
        FLASH_IT, </div>
      <div data-canvas-width="181.82399999999996" data-angle="0"
        data-font-name="g_font_1" style="position: absolute; left:
        488.2px; top: 491.629px; font-size: 15px; font-family:
        sans-serif; transform: rotate(0deg) scale(0.947, 1);
        transform-origin: 0% 0% 0px;">FunctionalState NewState);</div>
      <div data-canvas-width="158.76749999999998" data-angle="-90"
        data-font-name="g_font_2" style="position: absolute; left:
        134.43px; top: 746px; font-size: 15px; font-family: sans-serif;
        transform: rotate(-90deg) scale(1.03096, 1); transform-origin:
        0% 0% 0px;">Memory Programming</div>
      <div class="" data-canvas-width="487.6379999999999" data-angle="0"
        data-font-name="g_font_1" style="position: absolute; left:
        175px; top: 520.029px; font-size: 15px; font-family: sans-serif;
        transform: rotate(0deg) scale(0.97139, 1); transform-origin: 0%
        0% 0px;">void FLASH_Unlock(void); void FLASH_Unlock(void);</div>
      <div class="" data-canvas-width="473.4405" data-angle="0"
        data-font-name="g_font_1" style="position: absolute; left:
        175px; top: 548.33px; font-size: 15px; font-family: sans-serif;
        transform: rotate(0deg) scale(0.970165, 1); transform-origin: 0%
        0% 0px;">void FLASH_Lock(void); void FLASH_Lock(void);</div>
      <div class="" data-canvas-width="295.581" data-angle="0"
        data-font-name="g_font_1" style="position: absolute; left:
        175px; top: 576.63px; font-size: 15px; font-family: sans-serif;
        transform: rotate(0deg) scale(0.975515, 1); transform-origin: 0%
        0% 0px;">FLASH_Status FLASH_ErasePage(uint32_t </div>
      <div data-canvas-width="106.7175" data-angle="0"
        data-font-name="g_font_1" style="position: absolute; left:
        175px; top: 595.031px; font-size: 15px; font-family: sans-serif;
        transform: rotate(0deg) scale(0.961419, 1); transform-origin: 0%
        0% 0px;">Page_Address);</div>
      <div class="" data-canvas-width="295.7204999999999" data-angle="0"
        data-font-name="g_font_1" style="position: absolute; left:
        488.2px; top: 576.63px; font-size: 15px; font-family:
        sans-serif; transform: rotate(0deg) scale(0.975975, 1);
        transform-origin: 0% 0% 0px;">FLASH_Status
        FLASH_ErasePage(uint32_t </div>
      <div data-canvas-width="106.7175" data-angle="0"
        data-font-name="g_font_1" style="position: absolute; left:
        488.2px; top: 595.03px; font-size: 15px; font-family:
        sans-serif; transform: rotate(0deg) scale(0.961419, 1);
        transform-origin: 0% 0% 0px;">Page_Address);</div>
      <div class="" data-canvas-width="611.6160000000001" data-angle="0"
        data-font-name="g_font_1" style="position: absolute; left:
        175px; top: 623.331px; font-size: 15px; font-family: sans-serif;
        transform: rotate(0deg) scale(0.967747, 1); transform-origin: 0%
        0% 0px;">FLASH_Status FLASH_EraseAllPages(void); FLASH_Status
        FLASH_EraseAllPages(void);</div>
      <div class="" data-canvas-width="116.26199999999999"
        data-angle="0" data-font-name="g_font_1" style="position:
        absolute; left: 175px; top: 651.631px; font-size: 15px;
        font-family: sans-serif; transform: rotate(0deg) scale(0.985271,
        1); transform-origin: 0% 0% 0px;">FLASH_STATUS </div>
      <div class="" data-canvas-width="255.198" data-angle="0"
        data-font-name="g_font_1" style="position: absolute; left:
        175px; top: 670.031px; font-size: 15px; font-family: sans-serif;
        transform: rotate(0deg) scale(0.97777, 1); transform-origin: 0%
        0% 0px;">FLASH_ERASEOPTIONBYTES(void);</div>
      <div class="" data-canvas-width="294.7995" data-angle="0"
        data-font-name="g_font_1" style="position: absolute; left:
        488.2px; top: 660.832px; font-size: 15px; font-family:
        sans-serif; transform: rotate(0deg) scale(0.982665, 1);
        transform-origin: 0% 0% 0px;">FLASH_STATUS FLASH_OB_ERASE(void);</div>
      <div class="" data-canvas-width="103.13550000000001"
        data-angle="0" data-font-name="g_font_1" style="position:
        absolute; left: 175px; top: 698.332px; font-size: 15px;
        font-family: sans-serif; transform: rotate(0deg) scale(0.982243,
        1); transform-origin: 0% 0% 0px;">FLASH_Status </div>
      <div class="" data-canvas-width="274.5135" data-angle="0"
        data-font-name="g_font_1" style="position: absolute; left:
        175px; top: 716.632px; font-size: 15px; font-family: sans-serif;
        transform: rotate(0deg) scale(0.966597, 1); transform-origin: 0%
        0% 0px;">FLASH_ProgramWord(uint32_t Address, </div>
      <div data-canvas-width="98.03249999999997" data-angle="0"
        data-font-name="g_font_1" style="position: absolute; left:
        175px; top: 735.032px; font-size: 15px; font-family: sans-serif;
        transform: rotate(0deg) scale(0.970619, 1); transform-origin: 0%
        0% 0px;">uint32_t Data);</div>
      <div class="" data-canvas-width="377.76000000000005"
        data-angle="0" data-font-name="g_font_1" style="position:
        absolute; left: 488.2px; top: 707.533px; font-size: 15px;
        font-family: sans-serif; transform: rotate(0deg) scale(0.971105,
        1); transform-origin: 0% 0% 0px;">FLASH_Status
        FLASH_ProgramWord(uint32_t Address, </div>
      <div data-canvas-width="98.19000000000001" data-angle="0"
        data-font-name="g_font_1" style="position: absolute; left:
        488.2px; top: 725.833px; font-size: 15px; font-family:
        sans-serif; transform: rotate(0deg) scale(0.972178, 1);
        transform-origin: 0% 0% 0px;">uint32_t Data);</div>
      <div class="" data-canvas-width="103.13550000000001"
        data-angle="0" data-font-name="g_font_1" style="position:
        absolute; left: 175px; top: 763.333px; font-size: 15px;
        font-family: sans-serif; transform: rotate(0deg) scale(0.982243,
        1); transform-origin: 0% 0% 0px;">FLASH_Status </div>
      <div class="" data-canvas-width="301.10100000000006"
        data-angle="0" data-font-name="g_font_1" style="position:
        absolute; left: 175px; top: 781.633px; font-size: 15px;
        font-family: sans-serif; transform: rotate(0deg) scale(0.965067,
        1); transform-origin: 0% 0% 0px;">FLASH_ProgramHalfWord(uint32_t
        Address, </div>
      <div data-canvas-width="98.03249999999997" data-angle="0"
        data-font-name="g_font_1" style="position: absolute; left:
        175px; top: 800.034px; font-size: 15px; font-family: sans-serif;
        transform: rotate(0deg) scale(0.970619, 1); transform-origin: 0%
        0% 0px;">uint16_t Data);</div>
      <div class="" data-canvas-width="341.406" data-angle="0"
        data-font-name="g_font_1" style="position: absolute; left:
        488.2px; top: 772.534px; font-size: 15px; font-family:
        sans-serif; transform: rotate(0deg) scale(0.972667, 1);
        transform-origin: 0% 0% 0px;">FLASH_Status
        FLASH_ProgramHalfWord(uint32_t </div>
      <div data-canvas-width="161.16599999999997" data-angle="0"
        data-font-name="g_font_1" style="position: absolute; left:
        488.2px; top: 790.834px; font-size: 15px; font-family:
        sans-serif; transform: rotate(0deg) scale(0.965066, 1);
        transform-origin: 0% 0% 0px;">Address, uint16_t Data);</div>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      Dne 19. 9. 2014 10:45, Jiří Nesvačil napsal(a):<br>
    </div>
    <blockquote cite="mid:541BED3A.3090306@posys.cz" type="cite">Zdravim,
      <br>
      na F1 mam toto:
      <br>
      <br>
      // 0 = ok, -1 chyba
      <br>
      int8_t bf_write16bit(uint32_t Address, uint8_t * buf)
      <br>
      {
      <br>
          FLASH_Status FLASHStatus=FLASH_ProgramHalfWord(Address,
      ((uint16_t)(*buf)|((uint16_t)(*(buf+1)))<<8));
      <br>
          if (FLASHStatus != FLASH_COMPLETE)
      <br>
              return -1;
      <br>
          return 0;
      <br>
      }
      <br>
      <br>
      <br>
      <br>
      // 0 = ok, -1 chyba
      <br>
      int8_t bf_app_erase(uint32_t app_size)
      <br>
      {
      <br>
          uint32_t EraseCounter;
      <br>
          uint32_t NbrOfPage = app_size / FLASH_PAGE_SIZE;
      <br>
          if ((app_size % FLASH_PAGE_SIZE) > 0) NbrOfPage++;
      <br>
          FLASH_ClearFlag(FLASH_FLAG_BSY | FLASH_FLAG_EOP |
      FLASH_FLAG_PGERR | FLASH_FLAG_WRPRTERR);
      <br>
          for(EraseCounter=0; EraseCounter<NbrOfPage; EraseCounter++)
      <br>
          {
      <br>
            FLASH_Status FLASHStatus =
      FLASH_ErasePage(APPLICATION_ADDRESS + (FLASH_PAGE_SIZE *
      EraseCounter));
      <br>
      // BUG asi mozna taky vraci timeout, protoze to po prvni strance
      vyskoci a je to
      <br>
      //      if (FLASHStatus != FLASH_COMPLETE) return -1;
      <br>
          }
      <br>
          return 0;
      <br>
      }
      <br>
      <br>
      <br>
      Dne 19. 9. 2014 8:58, Miroslav Mraz napsal(a):
      <br>
      <blockquote type="cite">Tak mě napadá, že minimálně rutiny pro
        mazání a zápis do flash musí být
        <br>
        součástí systémového bootloaderu. Marně však hledám bližší
        popis. Třeba
        <br>
        NXP má pro tyto účely ROM API, které se dá volat z uživatelského
        <br>
        programu docela jednoduše. Buď neumím hledat nebo se na to v STM
        <br>
        jednoduše vykašlali, nechť si to každý jeden udělá po svém.
        <br>
        <br>
        Mrazík
        <br>
        <br>
        On 09/18/2014 11:39 PM, Jan Waclawek wrote:
        <br>
        <blockquote type="cite">Nebudte sarkasticky, pan kolega. Myslim,
          ze tu kazdy chape hodnotu
          <br>
          dokumentacie, ale ona ma naozaj dost daleko ku dokonalosti a
          nie je prilis
          <br>
          instruktivna. Takze ja chapem, ze pan kolega Grunt by sa rad
          nechal
          <br>
          inspirovat.
          <br>
          <br>
          Ale este je tu aj ta "standardna kniznica". To sa da pouzit aj
          ako zdroj
          <br>
          inspiracie, a aj ako doplnok tej prepytujem dokumentacie. A u
          'F0 je
          <br>
          vyhoda v tom, ze su aj "snippets", do ktorych som sa sice
          nepozeral, ale
          <br>
          som presvedceny o tom, ze to bude tiez inspirativne. A pre
          <br>
          sadomasochisticke typy je tu aj F0-Cube.
          <br>
          <br>
          Ide o to sklbit dve veci - zvladnut samotne mazanie a
          napalovanie FLASH, a
          <br>
          vymysliet a implementovat tu "emulaciu EEPROM". V
          predchadzajucom
          <br>
          prispevku som to druhe naznacil v asi tej najjednoduchsej
          podobe, co podla
          <br>
          mna u vacsiny aplikacii bohate staci.
          <br>
          <br>
          Este tretia vec, co to moze skomplikovat, a co sme teraz
          nespomenuli (ale v
          <br>
          tej diskusii spred par mesiacov to bolo prave jadro problemu)
          je mozna
          <br>
          potreba behu aspon casti programu (typicky obsluhy preruseni)
          pocas
          <br>
          mazania/programovania FLASH - to vyzaduje zvladnutie behu
          inkriminovanych
          <br>
          casti programu z RAM (co znamena vediet identifikovat
          inkriminovane casti,
          <br>
          vediet ich linkovat do RAM, pred kritickymi operaciami ich tam
          <br>
          nakopirovat, presmerovat tabulku vektorov, a ktovie na co som
          este
          <br>
          zabudol). Takze najlepsie je, ak je to taka aplikacia, kde to
          <br>
          "pozastavenie" jednoducho nebude vadit... :-)
          <br>
          <br>
          wek
          <br>
          <br>
          <br>
        </blockquote>
        _______________________________________________
        <br>
        HW-list mailing list  -  sponsored by <a class="moz-txt-link-abbreviated" href="http://www.HW.cz">www.HW.cz</a>
        <br>
        <a class="moz-txt-link-abbreviated" href="mailto:Hw-list@list.hw.cz">Hw-list@list.hw.cz</a>
        <br>
        <a class="moz-txt-link-freetext" href="http://list.hw.cz/mailman/listinfo/hw-list">http://list.hw.cz/mailman/listinfo/hw-list</a>
        <br>
      </blockquote>
      <br>
      _______________________________________________
      <br>
      HW-list mailing list  -  sponsored by <a class="moz-txt-link-abbreviated" href="http://www.HW.cz">www.HW.cz</a>
      <br>
      <a class="moz-txt-link-abbreviated" href="mailto:Hw-list@list.hw.cz">Hw-list@list.hw.cz</a>
      <br>
      <a class="moz-txt-link-freetext" href="http://list.hw.cz/mailman/listinfo/hw-list">http://list.hw.cz/mailman/listinfo/hw-list</a>
      <br>
    </blockquote>
    <br>
  </body>
</html>