diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 0f7d3e9..e32ebe5 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -9,7 +9,7 @@ jobs: image: alpine:3.15 strategy: matrix: - model: ["TS100", "TS80", "TS80P", "MHP30", "S60P", "S60"] + model: ["TS100", "TS80", "TS80P", "MHP30", "S60P", "S60", "S99"] fail-fast: true steps: - name: Install dependencies (apk) diff --git a/Makefile b/Makefile index e6392fb..1669232 100644 --- a/Makefile +++ b/Makefile @@ -7,21 +7,28 @@ ifeq ($(build_type), runtime) ifeq ($(model), S60P) VECTOR_TABLE_OFFSET := 0x5000 SRC_LD = src/stm32f103_runtime_s60p.ld - else - ifeq ($(model), S60) - VECTOR_TABLE_OFFSET := 0x4400 - SRC_LD = src/stm32f103_runtime_s60.ld - else - # For MHP30 override the runtime to offset to 32k - ifeq ($(model),"MHP30") - VECTOR_TABLE_OFFSET := 0x8000 - SRC_LD = stm32f103_32k_runtime.ld - else - - VECTOR_TABLE_OFFSET := 0x4000 - SRC_LD = src/stm32f103_runtime.ld - endif - endif + endif + + ifeq ($(model), S60) + VECTOR_TABLE_OFFSET := 0x4400 + SRC_LD = src/stm32f103_runtime_s60.ld + endif + + ifeq ($(model), S99) + VECTOR_TABLE_OFFSET := 0x4C00 + SRC_LD = src/stm32f103_runtime_s99.ld + endif + + + + # For MHP30 override the runtime to offset to 32k + ifeq ($(model),"MHP30") + VECTOR_TABLE_OFFSET := 0x8000 + SRC_LD = stm32f103_32k_runtime.ld + endif + ifeq ($(model),$(filter $(model), TS100 TS80 TS80P )) + VECTOR_TABLE_OFFSET := 0x4000 + SRC_LD = src/stm32f103_runtime.ld endif BIN = runtime diff --git a/docs/BackUp.md b/docs/BackUp.md index 0b44572..3a56a48 100644 --- a/docs/BackUp.md +++ b/docs/BackUp.md @@ -32,6 +32,10 @@ However, we will publish known checksums of the backups so you can check if your `sudo dfu-util -d 28e9:0189 -U backup.bin -s 0x08000000:0x5000` +### S99 + +`sudo dfu-util -d 28e9:0189 -U backup.bin -s 0x08000000:0x4C00` + ### MHP30 `sudo dfu-util -d 28e9:0189 -U backup.bin -s 0x08000000:0x8000` diff --git a/src/config.h b/src/config.h index c862ca0..175cfa1 100644 --- a/src/config.h +++ b/src/config.h @@ -38,6 +38,15 @@ #define FLASH_BOOTLDR_SIZE_KB 20 #define FLASH_BOOTLDR_PAYLOAD_SIZE_KB 108 +#elif MODEL_S99 +#define GPIO_DFU_BOOT_PORT GPIOB +#define GPIO_DFU_BOOT_PIN 0 +#define GPIO_DP_PULLUP_PORT GPIOA +#define GPIO_DP_PULLUP_PIN 8 +#define FLASH_SIZE_KB 128 +#define FLASH_BOOTLDR_SIZE_KB 19 +#define FLASH_BOOTLDR_PAYLOAD_SIZE_KB 109 + #elif MODEL_TS80 || MODEL_TS80P #define GPIO_DFU_BOOT_PORT GPIOB #define GPIO_DFU_BOOT_PIN 1 diff --git a/src/oled.h b/src/oled.h index eee4c8a..728151b 100644 --- a/src/oled.h +++ b/src/oled.h @@ -5,7 +5,7 @@ #define DEVICEADDR_OLED (0x3c << 1) -#if MODEL_S60 || MODEL_S60P +#if MODEL_S60 || MODEL_S60P || MODEL_S99 #define OLED_AREA_X 16 #define OLED_AREA_Y 8 #define OLED_WIDTH 128 diff --git a/src/stm32f103_runtime_s99.ld b/src/stm32f103_runtime_s99.ld new file mode 100644 index 0000000..98cf19e --- /dev/null +++ b/src/stm32f103_runtime_s99.ld @@ -0,0 +1,73 @@ +/* + * This file is part of the libopenstm32 project. + * + * Copyright (C) 2010 Thomas Otto + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/* Define memory regions. */ +MEMORY +{ + rom (rx) : ORIGIN = 0x08004C00, LENGTH = 19K + ram (rwx) : ORIGIN = 0x20000000, LENGTH = 8k +} + +/* Enforce emmition of the vector table. */ +EXTERN (vector_table) + +/* Define the entry point of the output file. */ +ENTRY(reset_handler) + +/* Define sections. */ +SECTIONS +{ + .text : { + *(.vectors) /* Vector table */ + *(.text*) /* Program code */ + . = ALIGN(4); + *(.rodata*) /* Read-only data */ + . = ALIGN(4); + } >rom + + _etext = .; + + .data : { + _data = .; + *(.data*) /* Read-write initialized data */ + . = ALIGN(4); + _edata = .; + } >ram AT >rom + _data_loadaddr = LOADADDR(.data); + + .bss : { + *(.bss*) /* Read-write zero initialized data */ + *(COMMON) + . = ALIGN(4); + _ebss = .; + } >ram + + /* + * The .eh_frame section appears to be used for C++ exception handling. + * You may need to fix this if you're using C++. + */ + /DISCARD/ : { *(.eh_frame) } + + . = ALIGN(4); + end = .; +} + +PROVIDE(_stack = ORIGIN(ram) + LENGTH(ram)); + +