cancel
Showing results for 
Search instead for 
Did you mean: 

STM8 Option byte problems

louis2399
Associate II
Posted on September 06, 2010 at 08:53

STM8 Option byte problems

#tytyt
11 REPLIES 11
brazov22
Associate II
Posted on May 17, 2011 at 15:10

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

brazov

louis2399
Associate II
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

brazov22
Associate II
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

louis2399
Associate II
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

brazov22
Associate II
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

fggnrc2
Associate II
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

louis2399
Associate II
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

LaurentL
ST Employee
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

brazov22
Associate II
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