2 Replies Latest reply on Jul 21, 2016 4:12 AM by mark_kram

    Flash Data region - erasing data

    mark_kram

      I want to store couple bytes of data for example device ID, version etc for my informations I need about 64B of memory space. Refering to Memory sample of code I want to save this informations in Data Flash (4KB from 0x00200000 address) via below command :

       

      qm_flash_page_update(QM_FLASH_0, QM_FLASH_REGION_DATA, WR_FLASH_ADDR_IDNUM, flash_page_buffer, &My_Parameters, 0x40);

       

      all is great data is correctly stored in memory (from 0x00200000 to 0x00200040) I can also change this data via update command but is there simple way to erase all this 4KB of Flash Data or maybe one or two pages? In sample code is used command

       

      "qm_flash_page_erase(QM_FLASH_0, QM_FLASH_REGION_SYS, PAGE_TO_ERASE);"

       

      but it will errase space from address 0x00180000. What command should I use to erase this memory?

        • 1. Re: Flash Data region - erasing data
          Intel_Peter

          Hello mark_kram,

           

          There are two commands that help you erase data from the flash memory.

           

          qm_rc_t qm_flash_mass_erase(const qm_flash_t  flash, uint8_t  include_rom)

           

          And

           

          qm_rc_t qm_flash_page_erase(const qm_flash_t  flash, qm_flash_region_t  region, uint32_t  page_num)

           

          The former, as you can imagine, lets you perform a mass erase and the latter lets you erase only one page of memory. So, in this case you might be interested in using the former command

           

          I'd suggest you to look for the file group__groupFlash.html in the D2000’s documentation. The documentation is installed alongside the board's SDK and is normally found in C:\IntelSWTools\ISSM_2016.0.027\firmware\bsp\1.0\doc\html.

           

          I hope this information helps you.

          -Peter.

          1 of 1 people found this helpful
          • 2. Re: Flash Data region - erasing data
            mark_kram

            Hello Peter,

                Thank you for your response. In reference to your advice I used command:

             

            #define FIRST_DATA_FLASH_PAGE (0x00)

            qm_flash_page_erase(QM_FLASH_0, QM_FLASH_REGION_DATA, FIRST_DATA_FLASH_PAGE);

             

            to erase first data flash page and all is great. Thank you again and have a nice day.

             

            Mark

            1 of 1 people found this helpful