/tinysafeboot

Extending and improving the Tinysafeboot (TSB) bootloader originally written by Julien Thomas.

Primary LanguageVisual BasicGNU General Public License v3.0GPL-3.0

tinysafeboot

Public repository to expand on Julien Thomas excellent Tinysafeboot bootloader for ATMEGA and ATTINY

The original Tinysafeboot, including detailed documentation if available from Julien's website at http://jtxp.org/tech/tinysafeboot_en.htm

The aim of this repository is to integrate changes and improvements made to TSB and share them in compliance with the original license. Everyone is welcome to expand on this excellent work.

Git repository structure:

  • firmware_ASM/original_FW: includes the firmware part to be installed on the ATMEGA and ATTINY devices using ICSP, originally written by Julien Thomas.
    This implementation has a bug when operating in Daisy chain (multiple devices connected in parallel). See issue #1
  • firmware_ASM/release_20170626: a bugfix attempt at resolving Issue #1. It has not yet been thoroughly tested.
  • software/tsb_loader_original: the original TSB Loader written by Julien Thomas in FreeBasic.
    You can use this program to produce TSB binaries for your processor without needing to use an ATMEL assembler.
    If using this tool to read code from your processor, beware that it has a bug when saving to BIN files (it won't save the last byte); save to Intel HEX instead which does not have this issue.
  • software/tsb_loader2: a completely re written TSB loader in Mono (C#) for cross platform compatibility.
    This new loader has several advantages:
    • You can specify the device password on the command line, thus eliminating the timeout in the original version
    • Communication relies on the OS buffers to detect arrival of device replies, which makes this code significantly faster to run (for example at 19 200 bps it can be up to 5x faster than tsb_original, which uses hard coded wait times).
    • Extremely verbose output: in case of error you are told exactly what is wrong
    • Ability to perform multiple operations in one single TSB session (for example, a firmware erase/write/verify in one go).
      In the original TSB Loader, you need to reset the processor and start a new TSB session for each individual operation.
    • Configurable pre_wait times and reply_timeout times makes it extremely versatile when dealing with self resetting boards (like Arduino)
    • Automatically repeatable operations for multiple devices: if you have devices on a daisy chain (connected in parallel) with unique passwords, you can enter a list of device passwords and all operations are performed on all of them at once (your board needs to have an auto reset capability based on DTR transitions, similar to the Arduino implementation)
    • It includes a clever work around to overcome the bug on Daisy chain operation where silent devices might escape the "wrong password" lock and go into Emergency Erase confirm mode and subsequently boot.
      While the fix does not prevent them from booting, it forces the devices out of the "wrong password lock" before initiating any communication in order to prevent interferences from the Emergency erase confirmation.
    • What it does NOT DO: it will not produce the TSB binaries to load on your ATMEGA/ATTINY device. If you need that feature, please use TSB original.