0

Program to enter Trinkey bootloader
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Program to enter Trinkey bootloader

by vincentlarsen on Fri Jul 30, 2021 10:57 pm

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

vincentlarsen
 
Posts: 2
Joined: Fri Jul 30, 2021 10:51 pm

Re: Program to enter Trinkey bootloader

by vincentlarsen on Wed Aug 11, 2021 8:29 pm

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 | TOGGLE FULL SIZE
#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 :)

vincentlarsen
 
Posts: 2
Joined: Fri Jul 30, 2021 10:51 pm

Please be positive and constructive with your questions and comments.