STM32F1xx Option byte programming

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • STM32F1xx Option byte programming

    Using J-Flash Arm V4.46d

    Trying to program option bytes in micro. I've read the user manual section 7.6.1 for instructions. I've created a small S19 file with the option byte information in it. I've opened the data file, and the option byte data shows up beginning at address (alias) 0x06000000 as expected. However, when I try to program the data, then I get the error message as shown in the attachement.



    I have also unsecured the device. The purpose of this exercise if to remove the write protection bits from all flash pages.

    What am I doing wrong ?
    Images
    • J-Flash_Problem1.jpg

      313.77 kB, 915×709, viewed 3,891 times
  • OK, it's been a frustrating 24hrs, but here is where I'm at.



    I cannot figure out how to using J-Flash to program the option bytes. My S-record had one too many bytes in it (17 instead of 16) - which is another story, but after I fixed that, J-Flash is still unhappy about programming option bytes for the STM32 at the alias address.



    So, now I become an J-Link Commander script file expert. I was finally able to write a script file to erase and program the option bytes in the STM32. But as it turns out, the WRPR3,2,1,0 bits were already "1", which is unprotected anyway. I need to read the datasheet more closely. So, the J-Link Commander script thing was a pointless exercise - except I now know how it works.



    Now I get back to my original issue which was learning how to erase and program flash pages in the micro. First step, write fixed values into a flash page (complied, linked, and uploaded in a debug session), then test my FlashErasePage routine. It's very simple code. Using IAR EWARM, I was looking at the flash page in memory before and after I ran the erase routine. However, after my erase routine, there was no change to the memory display. The routine is so simple I couldn't figure out why it wouldn't work. I tried refreshing the memory display in the IDE, reseting the target, etc, and there was no change.



    Thinking that this may be an EWARM debugger issue, I exited the debugger, and read the target page with J-Link Commander. Guess what - the page WAS erased. This particular problem "appears" to be an EWARM issue instead of a J-Link issue. Has anyone had a simlar experience ?
  • Hi,

    J-Flash is still unhappy about programming option bytes for the STM32 at the alias address.


    According to the screenshot you provided, you have "STM32F100CB" selected as device
    while the J-Flash manual says:


    Selection the correct device in your J-Flash project should solve the problem:


    Moreover, we recommend to update to the latest version, since we recently fixed an issue regarding sector erase & option byte selection.

    Best regards
    Alex
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.