-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for STVP option byte hex format? #109
Comments
I am having the exact same problem with that chip.
Is there any known workaround to flash the opt bytes? Right now if I do |
As mentioned above the if you look your hex all odd addresses (where the negated OPT bytes are). If you fill them with the negated ones it going to work.
If you flash this above it will deactivate ROP and set some alternate functions, but your MCU will work and be programmable. |
@martonmiklos thanks for your comment. Can you describe how you changed |
The hex what I have pasted is not identical to your option byte config, I have just copied a known-to-be-working-with-stm8flash option byte hex from one of my projects. What I wanted to highlight, is the fact that it covers all the 11 bytes bytes from 0x4800 to 0x480A while your config only covers the even addresses. 0x4800, 0x4801, 0x4803 (6 bytes). Set all your even (0x4802, 0x4804...) bytes to the complemented one of the previous address's value and stm8flash will program your option bytes without any problems. This could help you to calc the checsum: As the datasheet says:
|
In case anyone reads this and asks himself how this works for the stm8s003f3: |
@vdudouyt @spth There is an interesting hint in this discussion. The mentioned database file shows how an automatic device identification can be done. This would allow to eliminate the -p command line parameter altogether, and avoid some common mistakes leading to 'tries exceeded' error. Is there interest for a pull request along this line? |
AFAIK, some devices are identical, except for the size of some of the memory, or peripherals, possibly they are using the same die, binned according to what works / what there is market demand for. But, I think a pull request for the following autodetection could be very welcome:
|
good approach. I'll make something along this line. |
The risk here is that the flash / eeprom / ram / peripheral might be physically present, but have failed a test. I do not know how much testing ST does. Maybe they do more testing on the STM8A parts than on the other ones. |
Hi folks, I am not sure how the topic was hijacked from the original "STVP option bytes hex format support" but I assume the mention of the MDB files was the key ;-). What I personally would find to added value from this is generating the stm8_devices struct array from the mentioned MDB files. |
Hello all,
As far as I know the only graphical option byte editor is the STVP. Unfortunately it saves the option bytes in a weird format:
(This is a file saved for an STM8S003F3.)
If you take a look on the HEX above you can see that all negated option bytes left out from it.
When the stm8flash opens such a file it will fill only the addresses present in the hex file leaving the negated bytes uninitialized.
Since we have no access to royalty free database* of the registermaps I would either recommend to implement the following "hack":
If the hex file read for option byte programming and single byte "holes" found between values fill them with the negated value of the previous byte. If a single byte is missing from the end of the option area that should be also negated from the last-1th byte.
Let me know if you have any better idea!
* The STVD ships with some password protected MDB files where this information could be obtained. (We can look for the register name pairs in the option area with and ) If you have no objections about it I can extract and patch the stm8.c file with those data .I have checked the STVD/STVP mdb files and only the option byte addresses are present there (they have no info on the negated ones). So I assume that they simply program the next bytes with the negated values for the option bytes.
The text was updated successfully, but these errors were encountered: