hello all,
I know this is not related directly to SDCC but rather to the auxiliary
tools for STM8. So if you don't use STM8 please just ignore this mail...
Today I uploaded a critical bugfix for the STM8 serial bootloader tool
"stm8gal" (https://github.com/gicking/stm8gal). Specifically, this
version fixes a bug when programming hexfiles with "holes" (i.e.
undefined content) in the option bytes memory range, leading to a
"bricked" STM8.
If you use stm8gal, please update it from Github and the "develop"
branch (https://github.com/gicking/stm8gal/tree/develop). I did do some
testing with the STM8 devices I have at hand, but any feedback is highly
appreciated! After confirmation that I didn't open a new bug -
respectively after fixing them - I will then release this version
officially.
Technical background:
- option bytes correspond to "fuse bits" in AVR and allow
enabling/disabling some STM8 features after reset, for example watchdog,
bootloader or read-out protection
- the STM8 requires that (most) option bytes (OPTx) are stored
together with the binary complement NOPTx. If (OPTx^NOPTx != 0xFF) the
STM8 resets automatically
- the previous version of stm8gal
(https://github.com/gicking/stm8gal) always uploads 128B blocks.
Undefined values (="holes") in the hexfile are filled with 0x00
- if "holes" exist in the hexfile at OPT/NOPT addresses, OPT and NOPT
don't match -> endless reset cycles (= "bricked" device)
- the recent bugfix (in branch "develop") uploads only the defined
data. "Holes" in the hexfile are now skipped
Notes:
- recovering from the above described reset cycle is possible via
SWIM e.g. using stm8flash (https://github.com/vdudouyt/stm8flash).
However, that requires access to the SWIM pins, which may not always be
possible. Hence my rating of this bug as "critical"
- when changing option bytes by yourself, please assert
(OPT^NOPT==0xFF), else you may end in the same condition as described above
- besides the above bugfix the new version also supports UART mode
auto-detection (issue #6) and facilitates option byte programming
(issues #7)
For your feedback thanks a lot in advance and have a great 2019! :-)
Georg
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user