Skip to main content
Visitor II
September 6, 2010
Question

STM8 Option byte problems

  • September 6, 2010
  • 10 replies
  • 5288 views
Posted on September 06, 2010 at 08:53

STM8 Option byte problems

#tytyt
    This topic has been closed for replies.

    10 replies

    louis2399Author
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:10

    When trying to program the options byte in STVP I get the error message ''Error while reading option byte'' ...

    Regards

    Louis

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:10

    try to reprogram option bytes area with default  values using STVP.

    brazov

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:10

    hi,

    Strange, I tried in my environment and it works. When ROP is set you can't change option bytes, the only thing you can done is to put ROP off and so the whole memory is erased. Check STVP configuration, SWIM RLINK USB, and STVP options ...

    brazov2

    louis2399Author
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:10

    Thanks for the help thus far ...

    Sadly the problem still persists.

    I opened STVP, went to the option bytes tab, selected ROP and pressed

    program current tab but still get the same message (Error while reading Option Bytes). 

    Is there any other way to return the option byte memory area to its default state?

    Or might it be possible to bypass the reading of the option bytes before the memory is programmed?

    If the ROP was set can the option bytes still be changed?

    Regards

    Louis

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:10

    hi,

    for some reason you wrote option bytes not complemented. You need to perform with STVP a full erase of the memory option bytes included. So to restore default option bytes do the following:

    - open stvd

    - in option bytes tabs select ROP on

    - program option bytes (now memory is protected)

    - secelt ROP off

    - program option bytes (now memory if fully erased and you'd have default option bytes)

    brazov2

    louis2399Author
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:10

    Thanks for the advice but sadly I still cannot read or write the Option Bytes.

    A general question:

    If the Hardware activated watchdog timer is active will you be able to see the reset pin switching using a scope(as I'm currently seeing)?

    Regards

    Louis

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:10

    Hello Luis.

    I had a trouble like your: no SWIM connection with STVD and STVP.

    My trouble was due to VCap: 470 nF is the minimum value which stabilizes the internal voltage regulator.

    According to the datasheet, this capacitor capacity must be 470 nF upto 3300 nF.

    I changed VCap to a 1uF one, and my communication errors disappeared.

    Regards

    EtaPhi

    louis2399Author
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:10

    Just another question ...

    I presume that there is a high possibility that the ''Error while reading option bytes'' error is caused by wrong option byte settings (not complemneted correctly).

    The answer as I understand is to overwrite these bytes using STVP.

    It would seem,however, that STVP never starts writing the Option Bytes.

    It looks like the option bytes are always read first before a write is done ...

    and since an error occured while reading the writing phase never starts.

    Is this correct? Would there be a way to circumvent the reading phase?

    Regards

    Louis

    Visitor II
    March 24, 2024

    Hi, more than 14 years later...same problem, I solved it by ST Programmer menu : Edit > Fill area (CTL+F) fill with 0 Whole address space. Then all option bytes and the program that rewrites wrong option bytes are deleted.

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:10

    Hi,

    if in the program memory there is a bad code writing an option byte location, but not it's complement, then after programming option byte with STVP, the reset seems to be released, this causes the code in the program memory is executed again and you get again in STVP the error of bad option byte. This is the reason why I suggested to enable/disable ROP in order to erase program memory containing not well written code. In this way after programming option bytes, program memory is erased, bad code is not  anymore present and executed; so you don't get error.

    brazov

    ST Employee
    May 17, 2011
    Posted on May 17, 2011 at 15:10

    Hello,

    Try removing the pull-up on Swim pin.

    It will interfere for Swim communication (especially in high speed mode).

    And maybe the pull-up on reset pin is too big. (if there is a capacitor too).

    The reset can come from HW wdg or also if the option bytes are not complemented

    so as said, you must reprogram them with STVP (no need to prog ROP on and off).

    If still not ok, maybe update STVP soft.

    Rgds,

    Laurent