FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    How to use the MDK compiler to add firmware version information in the STM32 program HEX file

     

    This article introduces a small trick: Use the MDK compiler to add firmware version information in the STM32 program HEX file. Code code show as below: / / -------------------------------------------------------------------------------------------- ------------------------------ # include "absacc.h" / / -------------------------------------------------------------------------------------------- ------------------------------ # define verinfo_addr_base (0x8009f00) // version information in the storage address in Flash Const Char Hardware_VER [ ] __ATTRIBUTE __((VERINFO_ADDR_BASE + 0x00))) = "Hardware: 1.0.0"; const char number_ver [] __ATTRIBUTE __((AT (Verinfo_addr_base + 0x20)) = "Firmware: 1.0.0"; const char compiler_date [ ] __ATTRIBUTE __((Verinfo_ADDR_Base + 0x40))))) = "Date:" __date __; const char compiler_time [] __ATtribute __((at (verinfo_addr_base + 0x60))) = "Time:" __time__; / / -------------------------------------------------------------------------------------------- ------------------------------ Write into the program: Option configuration: Flash address and size don't make any modifications! HEX file: Serial print output: Disadvantages of the above method The above operation is feasible, but there is a disadvantage that the generated bin file is full of Flash size, resulting in a full flash reading and writing. In fact, this can put the storage address in front, such as a place to be offset, and do not have to change the designated address. According to the above operation, the program is at the end to the verinfo_addr_base address This will be filled into 0x00. Modify VERINFO_ADDR_BASE to reduce the address, or to force the specified address, automatically assign by the compiler, but then look for the corresponding version identity string. Optimization If you don't want to fill 0x00 in the previous paragraph, let the HEX file size is small, you can change the size of the flash in the option configuration, set verinfo_addr_base to start from the space behind FlashSize, so that the generated HEX file is small, and Unused space will not be populated with a lot of 0x00. EDTOR: JQ, Read the full article, original title: Add firmware version information in the HEX file in the SMT32 Article Source: [Micro Signal: C-STM32, WeChat Public Number: High Speed ​​PCB Hardware Design] Welcome to add attention! Please indicate the source of the article.

     

     

     

     

    List all Question

    Nickname

    Email

    Questions

    Our other product:

    Professional FM Radio Station Equipment Package

     



     

    Hotel IPTV Solution

     


      Enter email  to get a surprise

      fmuser.org

      es.fmuser.org
      it.fmuser.org
      fr.fmuser.org
      de.fmuser.org
      af.fmuser.org ->Afrikaans
      sq.fmuser.org ->Albanian
      ar.fmuser.org ->Arabic
      hy.fmuser.org ->Armenian
      az.fmuser.org ->Azerbaijani
      eu.fmuser.org ->Basque
      be.fmuser.org ->Belarusian
      bg.fmuser.org ->Bulgarian
      ca.fmuser.org ->Catalan
      zh-CN.fmuser.org ->Chinese (Simplified)
      zh-TW.fmuser.org ->Chinese (Traditional)
      hr.fmuser.org ->Croatian
      cs.fmuser.org ->Czech
      da.fmuser.org ->Danish
      nl.fmuser.org ->Dutch
      et.fmuser.org ->Estonian
      tl.fmuser.org ->Filipino
      fi.fmuser.org ->Finnish
      fr.fmuser.org ->French
      gl.fmuser.org ->Galician
      ka.fmuser.org ->Georgian
      de.fmuser.org ->German
      el.fmuser.org ->Greek
      ht.fmuser.org ->Haitian Creole
      iw.fmuser.org ->Hebrew
      hi.fmuser.org ->Hindi
      hu.fmuser.org ->Hungarian
      is.fmuser.org ->Icelandic
      id.fmuser.org ->Indonesian
      ga.fmuser.org ->Irish
      it.fmuser.org ->Italian
      ja.fmuser.org ->Japanese
      ko.fmuser.org ->Korean
      lv.fmuser.org ->Latvian
      lt.fmuser.org ->Lithuanian
      mk.fmuser.org ->Macedonian
      ms.fmuser.org ->Malay
      mt.fmuser.org ->Maltese
      no.fmuser.org ->Norwegian
      fa.fmuser.org ->Persian
      pl.fmuser.org ->Polish
      pt.fmuser.org ->Portuguese
      ro.fmuser.org ->Romanian
      ru.fmuser.org ->Russian
      sr.fmuser.org ->Serbian
      sk.fmuser.org ->Slovak
      sl.fmuser.org ->Slovenian
      es.fmuser.org ->Spanish
      sw.fmuser.org ->Swahili
      sv.fmuser.org ->Swedish
      th.fmuser.org ->Thai
      tr.fmuser.org ->Turkish
      uk.fmuser.org ->Ukrainian
      ur.fmuser.org ->Urdu
      vi.fmuser.org ->Vietnamese
      cy.fmuser.org ->Welsh
      yi.fmuser.org ->Yiddish

       
  •  

    FMUSER Wirless Transmit Video And Audio More Easier !

  • Contact

    Address:
    No.305 Room HuiLan Building No.273 Huanpu Road Guangzhou China 510620

    E-mail:
    [email protected]

    Tel / WhatApps:
    +8618078869184

  • Categories

  • Newsletter

    FIRST OR FULL NAME

    E-mail

  • paypal solution  Western UnionBank OF China
    E-mail:[email protected]   WhatsApp:+8618078869184   Skype:sky198710021 Chat with me
    Copyright 2006-2020 Powered By www.fmuser.org

    Contact Us