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
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 ...
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
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
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
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
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.
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
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