Skip to content
This repository was archived by the owner on Jun 23, 2023. It is now read-only.

Commit 99de3aa

Browse files
committed
Prepared the script to release the firmware files
1 parent 73b7270 commit 99de3aa

3 files changed

Lines changed: 73 additions & 13 deletions

File tree

firmware/display/Makefile

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,46 @@
11
PROJECT_NAME := display_firmware
22
TARGETS := display_firmware
33

4+
APP_VER_MAJOR = 1
5+
APP_VER_MINOR = 0
6+
APP_VER_BUG = 0
7+
8+
ifdef DISPLAY_OLED_1.3_SPI
9+
$(warning )
10+
$(warning DISPLAY OLED 1.3 SPI)
11+
$(warning )
12+
DISPLAY = OLED_1.3_SPI
13+
CFLAGS += -DDISPLAY_SH1106
14+
CFLAGS += -DDISPLAY_SPI
15+
endif
16+
17+
ifdef DISPLAY_OLED_1.3_I2C
18+
$(warning )
19+
$(warning DISPLAY OLED 1.3 I2C)
20+
$(warning )
21+
DISPLAY = OLED_1.3_I2C
22+
CFLAGS += -DDISPLAY_SH1106
23+
CFLAGS += -DDISPLAY_I2C
24+
endif
25+
26+
ifdef DISPLAY_OLED_0.96_SPI
27+
$(warning )
28+
$(warning DISPLAY OLED 0.96 SPI)
29+
$(warning )
30+
DISPLAY = OLED_0.96_SPI
31+
CFLAGS += -DDISPLAY_SSD1306
32+
CFLAGS += -DDISPLAY_SPI
33+
endif
34+
35+
ifdef DISPLAY_OLED_0.96_I2C
36+
$(warning )
37+
$(warning DISPLAY_OLED_0.96_I2C)
38+
$(warning )
39+
DISPLAY = OLED_0.96_I2C
40+
CFLAGS += -DDISPLAY_SSD1306
41+
CFLAGS += -DDISPLAY_I2C
42+
endif
43+
444
# This is the expected version of the motor firmware. Display will stop to work with correct TSDZ2 firmware version
545
MOTOR_FIRMWARE_MAJOR := 1
646
MOTOR_FIRMWARE_MINOR := 1
@@ -16,9 +56,6 @@ $(OUTPUT_DIRECTORY)/display_firmware.out: \
1656
BOOTLOADER_DIR = $(PROJ_DIR)/../EBike_wireless_bootloader/firmware
1757
BOOTLOADER_HEX = $(BOOTLOADER_DIR)/_build/TSDZ2_bootloader_with_sd.hex
1858

19-
APP_VER_MAJOR = 0
20-
APP_VER_MINOR = 1
21-
2259
# The integer build number for this release, MUST BE INCREMENTED FOR EACH RELEASE SO BOOTLOADER WILL INSTALL
2360
# it is not user visible, but we must ensure it is monotonically increasing
2461
VERSION_NUM := 1
@@ -335,7 +372,7 @@ bl_settings:
335372
$(SREC_PATH)nrfutil settings generate --family NRF52840 --application $(OUTPUT_DIRECTORY)/display_firmware.hex --application-version-string $(APP_VER_MAJOR).$(APP_VER_MINOR).0 --bootloader-version 1 --bl-settings-version 2 $(OUTPUT_DIRECTORY)/bl_settings.hex
336373

337374
OTA:
338-
$(SREC_PATH)nrfutil pkg generate --hw-version 52 --sd-req 0xB9 --application-version-string $(APP_VER_MAJOR).$(APP_VER_MINOR).0 --application $(OUTPUT_DIRECTORY)/display_firmware.hex --key-file private.key --app-boot-validation VALIDATE_ECDSA_P256_SHA256 $(OUTPUT_DIRECTORY)/display_firmware_ota_update.zip
375+
$(SREC_PATH)nrfutil pkg generate --hw-version 52 --sd-req 0xB9 --application-version-string $(APP_VER_MAJOR).$(APP_VER_MINOR).$(APP_VER_BUG) --application $(OUTPUT_DIRECTORY)/display_firmware.hex --key-file private.key --app-boot-validation VALIDATE_ECDSA_P256_SHA256 $(OUTPUT_DIRECTORY)/firmware_ota-$(DISPLAY)-$(APP_VER_MAJOR).$(APP_VER_MINOR).$(APP_VER_BUG).zip
339376

340377

341378
TEMPLATE_PATH := $(SDK_ROOT)/components/toolchain/gcc

firmware/display/include/main.h

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,17 @@
22

33
#include <stdio.h>
44
#include "common.h"
5-
// #include "button.h"
65

7-
#define DEVELOPMENT
6+
//#define DEVELOPMENT
87

9-
#define DISPLAY_SSD1306 // 0.96 inches OLED
10-
// #define DISPLAY_SH1106 // 1.3 inches OLED
11-
12-
#define DISPLAY_SPI
13-
// #define DISPLAY_I2C
8+
#ifdef DEVELOPMENT
9+
#define DISPLAY_SSD1306
10+
#define DISPLAY_SPI
11+
#endif
1412

1513
#ifdef DISPLAY_SPI
16-
#define DISPLAY_USE_RESET_PIN
17-
// #define DISPLAY_USE_SELECT_PIN
14+
#define DISPLAY_USE_RESET_PIN
15+
// #define DISPLAY_USE_SELECT_PIN
1816
#endif
1917

2018

firmware/display/make_release.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
echo " "
3+
echo "Start building the release files"
4+
echo " "
5+
mkdir release
6+
make clean
7+
sleep 1
8+
make default DISPLAY_OLED_1.3_SPI=1
9+
cp _build/firmware_ota* release
10+
make clean
11+
sleep 1
12+
make default DISPLAY_OLED_1.3_I2C=1
13+
cp _build/firmware_ota* release
14+
make clean
15+
sleep 1
16+
make default DISPLAY_OLED_0.96_SPI=1
17+
cp _build/firmware_ota* release
18+
make clean
19+
sleep 1
20+
make default DISPLAY_OLED_0.96_I2C=1
21+
cp _build/firmware_ota* release
22+
echo " "
23+
echo "Done! - find files on 'release' folder"
24+
echo " "
25+

0 commit comments

Comments
 (0)