Skip to main content
Dave Jones
Associate III
April 7, 2018
Question

Where are option bytes defined?

  • April 7, 2018
  • 2 replies
  • 2033 views
Posted on April 07, 2018 at 06:20

Is there a place within CubeMX to define the configuration fuses (Option Bytes)?

What about in project settings in the IDE (I'm using TrueStudio)

(things like SRAM2_PE, nBoot0, etc....)

    This topic has been closed for replies.

    2 replies

    Joerg Wagner
    Senior III
    April 7, 2018
    Posted on April 07, 2018 at 13:01

    Take a look in the Reference Manual of your controller in the section 'Embedded Flash Memory'.

    There are also HAL functions described in the User Manual 'Description of HAL drivers'.

    Dave Jones
    Associate III
    April 7, 2018
    Posted on April 07, 2018 at 19:00

    I understand where they are in the MCU. And I understand they can be set programmatically. But that's not what I am asking.

    While sometimes you might want to change them on the fly, in the majority of cases you simply want to set them in the project to an initial state so they get programmed in at the same time the code is being burned into the Flash. With most microcontroller development systems (at least from other manufacturers) there is a place within the IDE where you define the initial state of configuration options/fuses for the project. Usually via some type of project settings page.

    Since STM also has the CubeMX system for creating projects, I would expect some way to define them within CubeMX as well as some way to define them within an IDE.

    These aren't registers that you simply set every time the chip boots up. These are configuration fuses that get set to at least an initial state when the code gets loaded into the chip.

    Tesla DeLorean
    Guru
    April 7, 2018
    Posted on April 07, 2018 at 20:10

    The method in Keil is to direct content to a specific section/load-region, and then select a flash algorithm that manages the option bytes. Figure structure, attribute, scatter file/linker script, and programmer that deals with the .HEX

    0690X00000604YkQAI.jpg

    The more practical method of dealing with options and settings is to have the code determine if it is on an freshly programmed device and push default settings.

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    Joerg Wagner
    Senior III
    April 10, 2018
    Posted on April 10, 2018 at 18:44

    The point is that all these software come from different vendors.

    If ST would have an IDE, I'm sure that this functionality would be integrated.

    Dave Jones
    Associate III
    April 10, 2018
    Posted on April 10, 2018 at 21:54

    Well, actually ST does now have an IDE. They bought Atollic and now own TrueStudio. And are giving away the full pro version for free to anybody that wants to work on STM parts. (they removed support for other brands of parts) Their website now says ST/Atollic.

    So there's no excuse for this functionality to not be integrated into TrueStudio. Since this just happened a few months ago, hopefully they are planning to add that functionality to it in the near future.