Program to enter Trinkey bootloader

Adafruit's tiny microcontroller platform. Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
vincentlarsen
 
Posts: 4
Joined: Fri Jul 30, 2021 10:51 pm

Program to enter Trinkey bootloader

Post by vincentlarsen »

I have a Trinkey (4870) that I am setting up to respond to a few commands, over the serial connection. I would like one of these commands to tell the Trinkey to enter its bootloader (so the host can download a new program to the Trinkey, without user intervention). How can I perform this operation? Is there documentation for the libraries, you supply, for the Arduino IDE?

Sincerely,
Vincent

User avatar
vincentlarsen
 
Posts: 4
Joined: Fri Jul 30, 2021 10:51 pm

Re: Program to enter Trinkey bootloader

Post by vincentlarsen »

After playing with search terms, I finally found the proper combination, to get my answer. For anyone else, who needs this functionality, the following snippet is what I found works:

Code: Select all

#define HSRAM_ADDR               0x20000000UL
#define HSRAM_SIZE               0x00008000UL
#define DOUBLE_TAP_MAGIC         0xF01669EFUL
#define BOOT_DOUBLE_TAP_ADDRESS  (((uint32_t*)(HSRAM_ADDR+HSRAM_SIZE-4))[0])

BOOT_DOUBLE_TAP_ADDRESS = DOUBLE_TAP_MAGIC;
NVIC_SystemReset();
Enjoy,
Me :)

Locked
Please be positive and constructive with your questions and comments.

Return to “Trinket ATTiny, Trinket M0”