Forum Rule: Always post complete source code & details to reproduce any issue!
Page 2 of 2 FirstFirst 1 2
Results 26 to 28 of 28

Thread: Setting flash security byte

  1. #26
    Member gimpo's Avatar
    Join Date
    Mar 2018
    Location
    Munich
    Posts
    51
    Very interesting. That would be a "game changer" for me and my needs.

  2. #27
    Member gimpo's Avatar
    Join Date
    Mar 2018
    Location
    Munich
    Posts
    51
    No news about resetting the Teensy 3.x via software?

    My Teensy 3.2 is equipped with a TFT screen. My idea is to propose to the user a menu option that allows to reprogram the Teensy.
    When user confirm its choice then:

    1. the flash memory is erased
    2. a new sketch can be uploaded

  3. #28
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,171
    Quote Originally Posted by Darcy View Post
    It appears that reprogram initialisation can be done in software:

    _reboot_Teensyduino_();

    I am guessing: if the security byte is set and the program button is inaccessible, calling the above command in my sketch should put the teensy into program mode ready for a new sketch upload.
    I can confirm this does *NOT* work when FSEC sets the code read security lock.

    As explained in the comments where you edit FSEC, when the security lock is set, pressing the button is the only way to initiate bootloader mode, and pressing the button causes a full wipe of the flash memory. That is the consequence of setting the security lock. The bootloader is fully locked out of access to the chip, and access can only be restored by a full wipe of memory. The security lock wouldn't be effective if it allowed some way for an external chip to access memory. This restriction is strictly enforced by the hardware. No amount of software trickery can work around it. The security lock simply always works this way!

    I tried to clearly document how it works in the comments where you edit the code to set FSEC. Please, read that carefully and avoid the mental trap of tricking yourself of believing it might be able to work some other way simply because another way would be more convenient for you. This is a hardware enforced security feature. It is designed at the hardware level inside the chip to have no way to cheat. The only way to unlock security is a full erase of all flash.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •