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
Program to enter Trinkey bootloader
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- vincentlarsen
- Posts: 4
- Joined: Fri Jul 30, 2021 10:51 pm
Re: Program to enter Trinkey bootloader
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:
Enjoy,
Me :)
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();
Me :)
Please be positive and constructive with your questions and comments.