🛠 Récupération, sécurisation du code et gestion de la fin de vie (EOL)

Teensy 3.2 · avance · Schéma : IMG-teensy-32-avance-9-teensy32-recuperation-securite-fin-de-vie.svg — Teensy 3.2 en mode récupération : flèche sur le bouton Program annotée « accès même après un code verrouillé (FSEC) », puce HalfKay dessinée à part du flash principal du MK20DX256, terminal affichant teensy_reboot et la ligne de commande Makefile ; en fond, le badge « Discontinued — last batch Oct 2023 » et une flèche vers une Teensy 4.0.

Objectives

Three production-level skills for using a Teensy 3.2: (1) recovering a board that refuses to reprogram, (2) securing your code against reading (FSEC mode), (3) living with a discontinued board — understanding why, anticipating failures, and knowing when to migrate to Teensy 4.0.

1) Recovery: why the Teensy is almost impossible to brick

The HalfKay bootloader lives in a physically separate chip from the MK20DX256: a failed flash, a buffer overflow, or code that disables interrupts cannot destroy the bootloader. Recovery scales, from the gentlest to the most radical:

# Chaine de compilation 100 % en ligne de commande (livree avec Teensyduino) :
# Makefile : {Arduino}/hardware/teensy/avr/cores/teensy3/Makefile
make -C build -f makefile.mk          # compile
teensy_post_compile -file=firmware -path=. -tools=/path/to/arduino/hardware/teensy
teensy_reboot                          # redemarre la carte en mode prog
# Alternative : PlatformIO ou Visual Micro (Visual Studio, commercial)

2) Securing your code

The FSEC secure mode bit of the MK20DX256 locks flash reading via the debug interface — your algorithms are not extractable. Assumed consequence: no more soft reprogramming, the Program button erases everything. Test first on a demo board, never on the only board in the field.

3) Living with an EOL board

The facts, from the PJRC shop page: the last batch sold in October 2023 after an 11-year career — NXP could not help maintain the supply of the MK20DX256; status "Out Of Stock" with a physical stock recount on April 22, 2026, and limited occasional restocks (July 7, 2025, October 13, 2025 — limit 5 pieces/person). Strategy:

Expected Verification

Complete exercise on a test board: upload code that disables everything (infinite loop disabling interrupts) → the Program button puts the board back into flashing mode in 2 seconds, proof of HalfKay isolation. Enable FSEC → re-uploading is refused until you press Program (complete erase) → the board returns blank and programmable. Compile your project via the Makefile + loader_cli chain without opening the IDE.

Common Errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials