Skip to main content
stevemelnikoff9
Associate II
September 24, 2008
Question

STM32 headers

  • September 24, 2008
  • 16 replies
  • 4053 views
Posted on September 24, 2008 at 17:57

STM32 headers

    This topic has been closed for replies.

    16 replies

    stevemelnikoff9
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 12:24

    Yes, the bits are indeed defined in the .c files. This means that in order to use bit masks, the user has to either copy them into a header, or define their own. Either way, the headers aren't complete!

    This is why I was wondering if anyone had produced a set of headers which does contain all the registers and all the bit definitions.

    lanchon
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 12:24

    hi,

    in case you didn't notice, all registers are defined in stm32f10x_map.h. (but not the bits. some of the bits are defined in the implementation (.c) files.)

    [ This message was edited by: lanchon on 23-02-2008 07:06 ]

    stevemelnikoff9
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 12:24

    Hi.

    I've recently started using an STM32 with the ST firmware library.

    While the library is certainly very useful, I would like to have the option of accessing registers directly, without having to go through these functions.

    However, the library headers do not contain full defintions of register bits, etc, and having contacted both ST and Keil, I'm told that they do not provide headers that contain this information.

    Having used a number of different processor types before, I've never come across one whose tools do not include a set of full register definition headers.

    So my question is: do such headers exist, and are they freely available?

    Thanks,

    Steve.

    stevemelnikoff9
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 12:24

    Lanchon:

    I contacted ST, and they said that they don't have any publicly-available headers like this, but they'd have a look for me.

    I also contacted Keil, who said that they have only what ST provide them with!

    Regarding machine-readable definitions: that's certainly an interesting idea! I would hope that if ST do have the data in that form, they could extract the data for us.

    It also makes me wonder: what did ST use for headers before they wrote the library...?

    Erwin:

    Good to know I'm not the only one! I've started writing my own definitions for the registers I'm using. Perhaps once I've made some progress - and if my employers don't mind - I will make it public, and other people can fill in the gaps?

    Steve.

    lanchon
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 12:24

    why don't you guys contact support and see if ST has a machine readable description of the registers that they can give to you? the ideal case would be XML data describing the registers, maybe with the descriptions form the ref manual embedded in the data. it could be automatically translated into different headers using different methods (bit band or mask, macros or constant pointers or C++ references, etc), and using your choice of naming convention. :)

    do you think ST generates the ''tables'' describing the registers in the ref manual from a machine readable representation? I definitely do.

    er2
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 12:24

    100% agree!

    Using the ST Firmware Library is blowing up code and slowing down speed. Who will help us building a new header library only with address and bit definitions.

    Erwin Reuss

    Coming soon: German discussion forum for STM32 on

    http://www.mc32.de

    [ This message was edited by: er on 26-02-2008 00:20 ]

    lspr35
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 12:24

    bobz:

    this hint (C:\Program Files\Raisonance\Ride\Sim\ARM\STM32F103RBT6.sim) is quite useful. But this file does not include all registers: e.g. TIM1_BDTR is missing!

    Best regards

    bob239955
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 12:24

    I may have misunderstood but Raisonance provide a machine readable file.

    Visit;-

    http://www.stm32circle.com/hom/index.php

    In right had column near top locate and click CDROM link ;-

    2007/11/09 -The new CD-ROM image is available.

    Download the CDROM.

    Install it.

    You will find a machine readable file on your disk here;-

    C:\Program Files\Raisonance\Ride\Sim\ARM\STM32F103RBT6.sim

    On my copy the ARM core (NVIC etc) are missing but

    the peripherals are there.

    [ This message was edited by: bobz on 26-02-2008 11:14 ]

    er2
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 12:24

    Quote:

    Erwin:

    Good to know I'm not the only one! I've started writing my own definitions for the registers I'm using. Perhaps once I've made some progress - and if my employers don't mind - I will make it public, and other people can fill in the gaps?

    Steve.

    Hi Steve,

    i think we are on the same way. I also built my own header file with only the few registers i am using. I've startet with STM32 only 2 weeks ago, so there are only a few registers in my header file but it will be more and more.

    Greetings from germany,

    Erwin

    bob239955
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 12:24

    Actually - we do THANKYOU, JUST STICK TO THE TERMS:-). No doubt you'll want to explain them being as helpful as you are ;-). Yes there are a lot of those *.sim files for many variants - quite an undertaking. I am curious to know how they are derived.

    Obviously the goodwill of people who bother to tell Raisonance of the specific errors in these files can go unnoticed by some but nevertheless help make it worth selling. There are plenty of opportunities to contribute to the newer stuff at the moment should one be so inclined.