Skip to content

Commit 036b44f

Browse files
committed
Add Artemis 'bootloader' dir
This directory is copied from the [SparkFun Artemis](https://github.com/sparkfun/SparkFun_Artemis) GitHub repo. It contains bootloader setting binaries for the Ambiq Secure Bootloader (SBL) at two different baud rates (921600 and 115200). These settings use *pad* 47 as the bootloader pin. The bootloader readme also provides basic information on how to generate these SBL configuration binaries using the 'create_info0.py' script (which currently is located one directory up form here). When designing an Artemis module-based board it would be possible to redefine the bootloader pin for your needs.
1 parent 26c5e76 commit 036b44f

File tree

7 files changed

+98
-0
lines changed

7 files changed

+98
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//connect to device
2+
device AMA3B1KK-KBR
3+
si SWD
4+
speed 1000
5+
r
6+
sleep 10
7+
8+
//set C runtime environment
9+
wreg MSP, 0x10000100
10+
11+
// erase info0
12+
w4 0x10000000 0 // flash info instance
13+
w4 0x10000004 0xd894e09e // info 0 key
14+
w4 0x10000008 0xFFFFFFFF // clear return value
15+
setPC 0x08000085 // call the ROM helper function flash_info_erase_from_sram
16+
g
17+
sleep 50
18+
mem32 0x10000008 1 // dump return value for check
19+
20+
// program info0
21+
w4 0x10000000 0 // flash info instance
22+
w4 0x10000004 0 // offset
23+
w4 0x10000008 0x800 // length in words
24+
w4 0x1000000C 0xd894e09e // info 0 key
25+
w4 0x10000010 0xFFFFFFFF // clear return value
26+
loadbin info0_artemis_47_115200.bin 0x10001000 //load the info0 binary into sram
27+
setPC 0x08000061 // call the ROM helper function flash_program_info_area_from_sram
28+
g
29+
sleep 50
30+
mem32 0x10000010 1 // dump return value for check
31+
32+
// perform software POI
33+
w4 0x40000004 0x1B
34+
35+
// quit
36+
qc
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//connect to device
2+
device AMA3B1KK-KBR
3+
si SWD
4+
speed 1000
5+
r
6+
sleep 10
7+
8+
//set C runtime environment
9+
wreg MSP, 0x10000100
10+
11+
// erase info0
12+
w4 0x10000000 0 // flash info instance
13+
w4 0x10000004 0xd894e09e // info 0 key
14+
w4 0x10000008 0xFFFFFFFF // clear return value
15+
setPC 0x08000085 // call the ROM helper function flash_info_erase_from_sram
16+
g
17+
sleep 50
18+
mem32 0x10000008 1 // dump return value for check
19+
20+
// program info0
21+
w4 0x10000000 0 // flash info instance
22+
w4 0x10000004 0 // offset
23+
w4 0x10000008 0x800 // length in words
24+
w4 0x1000000C 0xd894e09e // info 0 key
25+
w4 0x10000010 0xFFFFFFFF // clear return value
26+
//loadbin info0.bin 0x10001000 //load the info0 binary into sram
27+
loadbin info0_artemis_47_921600.bin 0x10001000 //load the info0 binary into sram
28+
setPC 0x08000061 // call the ROM helper function flash_program_info_area_from_sram
29+
g
30+
sleep 50
31+
mem32 0x10000010 1 // dump return value for check
32+
33+
// perform software POI
34+
w4 0x40000004 0x1B
35+
36+
// quit
37+
qc
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
jlink -CommanderScript jlink-prog-115200.txt
3+
pause
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
jlink -CommanderScript jlink-prog-921600.txt
3+
pause
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Artemis Bootloader
2+
==========================
3+
4+
This is created based on the documents from Ambiq. See \AmbiqSuite-Rel2.x.x\docs\secure_bootloader\ for how to create your own image.
5+
6+
* Run the bootloader at 921600bps: --u0 0xE1000
7+
* Currently pin 47 is used for BOOTLOAD: --gpio 0x2f
8+
* Bootloader to check if BOOTLOAD pin is high (not low): --gpiolvl 1
9+
* Trim timeout to 250ms: --wTO 250
10+
11+
This was used for Artemis v10 module that used pin 47 for boot:
12+
13+
create_info0.py --valid 1 info0_artemis_47 --pl 1 --u0 0xE1000c0 --u1 0xFFFF3031 --u2 0x2 --u3 0x0 --u4 0x0 --u5 0x0 --main 0xC000 --gpio 0x2f --version 0 --wTO 250 --gpiolvl 1
14+
15+
Create 115200bps bootloader:
16+
17+
create_info0.py --valid 1 info0_artemis_47 --pl 1 --u0 0x1C200c0 --u1 0xFFFF3031 --u2 0x2 --u3 0x0 --u4 0x0 --u5 0x0 --main 0xC000 --gpio 0x2f --version 0 --wTO 250 --gpiolvl 1
18+
19+
We have pre-compiled the fastest possible bootloader (921600bps) as well as the standard 115200bps. To program new bootloader: call program_xxxx.bat from command line with JLINK attached and Artemis powered from separate 3V supply.

0 commit comments

Comments
 (0)