Skip to content

Commit 81be79f

Browse files
authored
Beta salt (#33)
* salt splashscreen and screensaver * bump version firmware to 4.0.1 bootloader to 1.0.4
1 parent 33bbd22 commit 81be79f

14 files changed

+364
-10
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
.metadata/
1313

1414
# component libraries
15-
build/
15+
build
16+
bin
1617

1718
# Misc
1819
tags

b

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def proc_args():
2727
parser.add_argument('-bf', '--bump-feature', help = 'Bump feature release version.', action = 'store_true')
2828
parser.add_argument('-bb', '--bump-bug-fix', help = 'Bump bug fix version.', action = 'store_true')
2929
parser.add_argument('-bt', '--bump-test', help = 'Bump test version.', action = 'store_true')
30+
parser.add_argument('-salt', '--salt-logo', help = 'Build with the salt logo', action = 'store_true')
3031
parser.add_argument('-d', '--debug', help = 'Build debug variant.', action = 'store_true')
3132
parser.add_argument('-v', '--verbose', help = 'Build with verbose output.', action = 'store_true')
3233
args = parser.parse_args()
@@ -93,6 +94,8 @@ def main():
9394
buildargs += ' debug=1'
9495
if args.verbose:
9596
buildargs += ' verbose=1'
97+
if args.salt_logo:
98+
buildargs += ' salt-logo=1'
9699

97100
target ='arm-none-gnu-eabi'
98101
local('scons ' + 'target='+target + buildargs)

docker_build.sh renamed to docker_build_keepkey_debug.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ docker build -t $IMAGETAG .
77
docker run -t -v $(pwd):/root/keepkey-firmware --rm $IMAGETAG /bin/sh -c "\
88
cd /root/keepkey-firmware/libopencm3 && \
99
make clean && \
10-
make && \
10+
make && \
1111
cd /root/keepkey-firmware && \
12-
./b -d"
12+
./b -d && \
13+
mkdir -p bin/debug/keepkey && \
14+
mv build/arm-none-gnu-eabi/debug/bin/*.bin bin/debug/keepkey/"

docker_build_release.sh renamed to docker_build_keepkey_release.sh

+7-6
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ docker build -t $IMAGETAG .
1717
docker run -t -v $(pwd):/root/keepkey-firmware --rm $IMAGETAG /bin/sh -c "\
1818
cd /root/keepkey-firmware/libopencm3 && \
1919
make clean && \
20-
make && \
20+
make && \
2121
cd /root/keepkey-firmware && \
2222
./b -mp && \
23-
echo '*********************************************************************' && \
24-
echo '* KeepKey Application Fingerprint *' && \
25-
echo '*********************************************************************' && \
26-
cat build/arm-none-gnu-eabi/release/bin/keepkey_main.bin | sha256sum"
27-
23+
mkdir -p bin/release/keepkey && \
24+
mv build/arm-none-gnu-eabi/release/bin/*.bin bin/release/keepkey/ && \
25+
echo '*********************************************************************' && \
26+
echo '* KeepKey Application Fingerprint *' && \
27+
echo '*********************************************************************' && \
28+
cat bin/release/keepkey/keepkey_main.bin | sha256sum"
2829
fi

docker_build_salt_debug.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
IMAGETAG=keepkey/firmware
4+
5+
docker build -t $IMAGETAG .
6+
7+
docker run -t -v $(pwd):/root/keepkey-firmware --rm $IMAGETAG /bin/sh -c "\
8+
cd /root/keepkey-firmware/libopencm3 && \
9+
make clean && \
10+
make && \
11+
cd /root/keepkey-firmware && \
12+
./b -d -salt && \
13+
mkdir -p bin/debug/salt && \
14+
mv build/arm-none-gnu-eabi/debug/bin/*.bin bin/debug/salt/"

docker_build_salt_release.sh

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
echo "*********************************************************************"
4+
echo "* You are about to build a release version of KeepKey firmware. The *"
5+
echo "* resulting bootloader image will memory protect the flash on your *"
6+
echo "* device, so please use it with extreme care. *"
7+
echo "*********************************************************************"
8+
read -p "Are you sure you want to continue? " -n 1 -r
9+
echo # (optional) move to a new line
10+
if [[ $REPLY =~ ^[Yy]$ ]]
11+
then
12+
13+
IMAGETAG=keepkey/firmware
14+
15+
docker build -t $IMAGETAG .
16+
17+
docker run -t -v $(pwd):/root/keepkey-firmware --rm $IMAGETAG /bin/sh -c "\
18+
cd /root/keepkey-firmware/libopencm3 && \
19+
make clean && \
20+
make && \
21+
cd /root/keepkey-firmware && \
22+
./b -mp -salt && \
23+
mkdir -p bin/release/salt && \
24+
mv build/arm-none-gnu-eabi/release/bin/*.bin bin/release/salt/ && \
25+
echo '*********************************************************************' && \
26+
echo '* KeepKey Application Fingerprint (SALT) *' && \
27+
echo '*********************************************************************' && \
28+
cat bin/release/salt/keepkey_main.bin | sha256sum"
29+
fi

interface/public/messages.options

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Features.coins max_count:9
66
Features.revision max_size:20
77
Features.bootloader_hash max_size:32
88
Features.policies max_count:1
9+
Features.model max_size:32
910

1011
ApplySettings.language max_size:17
1112
ApplySettings.label max_size:33

keepkey/SConscript

+3
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@ else:
2020
if(ARGUMENTS.get('project') == 'keepkey'):
2121
env = add_flags(env, ['-DKEEPKEY_PRJ'])
2222

23+
if(ARGUMENTS.get('salt-logo')):
24+
env = add_flags(env, ['-DSALT_WHITELABEL'])
25+
2326
init_project(env, deps=deps, libs=['opencm3_stm32f2'])
2427

keepkey/local/baremetal/app_resources.c

+119
Large diffs are not rendered by default.

keepkey/local/baremetal/fsm.c

+8
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,14 @@ void fsm_msgGetFeatures(GetFeatures *msg)
364364
resp->has_device_id = true;
365365
strlcpy(resp->device_id, storage_get_uuid_str(), sizeof(resp->device_id));
366366

367+
368+
resp->has_model = true;
369+
#ifdef SALT_WHITELABEL
370+
strlcpy(resp->model, "K1-14WL-S", sizeof(resp->model));
371+
#else
372+
strlcpy(resp->model, "K1-14WL", sizeof(resp->model));
373+
#endif
374+
367375
/* Security settings */
368376
resp->has_pin_protection = true; resp->pin_protection = storage_has_pin();
369377
resp->has_passphrase_protection = true;

keepkey_board/SConscript

+3
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,7 @@ else:
2626
if(ARGUMENTS.get('project') == 'keepkey'):
2727
env = add_flags(env, ['-DKEEPKEY_PRJ'])
2828

29+
if(ARGUMENTS.get('salt-logo')):
30+
env = add_flags(env, ['-DSALT_WHITELABEL'])
31+
2932
init_project(env, deps=deps, libs=["opencm3_stm32f2"])

keepkey_board/local/baremetal/layout.c

+5
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@ static void layout_home_helper(bool reversed)
5656
layout_clear();
5757

5858
static AnimationImageDrawableParams logo;
59+
60+
#ifdef SALT_WHITELABEL
61+
logo.base.x = 60;
62+
#else
5963
logo.base.x = 100;
64+
#endif
6065
logo.base.y = 10;
6166

6267
if(reversed)

keepkey_board/local/baremetal/resources.c

+165
Large diffs are not rendered by default.

version.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"BOOTLOADER_PATCH_VERSION": 3, "MAJOR_VERSION": 4, "MINOR_VERSION": 0, "PATCH_VERSION": 0, "BOOTLOADER_MAJOR_VERSION": 1, "BOOTLOADER_MINOR_VERSION": 0}
1+
{"BOOTLOADER_PATCH_VERSION": 4, "MAJOR_VERSION": 4, "MINOR_VERSION": 0, "PATCH_VERSION": 1, "BOOTLOADER_MAJOR_VERSION": 1, "BOOTLOADER_MINOR_VERSION": 0}

0 commit comments

Comments
 (0)