Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS101 #16

Open
wants to merge 6 commits into
base: mainline
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ ifeq ($(build_type), runtime)
SRC_LD = src/stm32f103_runtime_s60.ld
else
# For MHP30 override the runtime to offset to 32k
ifeq ($(model),"MHP30")
ifeq ($(model),$(filter $(model),MHP30 TS101))
VECTOR_TABLE_OFFSET := 0x8000
SRC_LD = stm32f103_32k_runtime.ld
SRC_LD = src/stm32f103_32k_runtime.ld
else

VECTOR_TABLE_OFFSET := 0x4000
Expand Down
12 changes: 12 additions & 0 deletions build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,15 @@ make -j build_type=bootloader model=MHP30
rm -rf build/*.o build/*.d
make -j build_type=runtime model=MHP30
rm -rf build/*.o build/*.d

make -j build_type=bootloader model=S60
rm -rf build/*.o build/*.d
make -j build_type=runtime model=S60
rm -rf build/*.o build/*.d


make -j build_type=bootloader model=TS101
rm -rf build/*.o build/*.d
make -j build_type=runtime model=TS101
rm -rf build/*.o build/*.d

2 changes: 1 addition & 1 deletion docs/BackUp.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The Iron will show a IronOS logo and then show the text "DFU" with its version n
```
For TS80,TS80P,TS100
sudo dfu-util -d 28e9:0189 -U backup.bin -s 0x08000000:0x4000
OR for MHP30
OR for MHP30,TS101
sudo dfu-util -d 28e9:0189 -U backup.bin -s 0x08000000:0x8000

```
Expand Down
42 changes: 34 additions & 8 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,26 @@
#define FLASH_SIZE_KB 128
#define FLASH_BOOTLDR_SIZE_KB 16
#define FLASH_BOOTLDR_PAYLOAD_SIZE_KB 112

#define SCL_Pin 6
#define SCL_GPIO_Port GPIOB
#define SDA_Pin 7
#define SDA_GPIO_Port GPIOB

#elif MODEL_S60
#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 GPIO_DP_PULLUP_PORT GPIOA
#define GPIO_DP_PULLUP_PIN 8
#define FLASH_SIZE_KB 128
#define FLASH_BOOTLDR_SIZE_KB 17
#define FLASH_BOOTLDR_PAYLOAD_SIZE_KB 111

#define SCL_Pin 6
#define SCL_GPIO_Port GPIOB
#define SDA_Pin 7
#define SDA_GPIO_Port GPIOB

#elif MODEL_TS80 || MODEL_TS80P
#define GPIO_DFU_BOOT_PORT GPIOB
#define GPIO_DFU_BOOT_PIN 1
Expand All @@ -55,6 +66,11 @@
#define FLASH_BOOTLDR_PAYLOAD_SIZE_KB 112
#define OLED_FLIP

#define SCL_Pin 6
#define SCL_GPIO_Port GPIOB
#define SDA_Pin 7
#define SDA_GPIO_Port GPIOB

#elif MODEL_MHP30
#define GPIO_DFU_BOOT_PORT GPIOA
#define GPIO_DFU_BOOT_PIN 10
Expand All @@ -63,14 +79,24 @@
#define FLASH_SIZE_KB 128
#define FLASH_BOOTLDR_SIZE_KB 32
#define FLASH_BOOTLDR_PAYLOAD_SIZE_KB 96

#define SCL_Pin 6
#define SCL_GPIO_Port GPIOB
#define SDA_Pin 7
#define SDA_GPIO_Port GPIOB
#elif MODEL_TS101
#define GPIO_DFU_BOOT_PORT GPIOA
#define GPIO_DFU_BOOT_PIN 8
#define OLED_RESET_Pin 7
#define OLED_RESET_GPIO_Port GPIOA
#define FLASH_SIZE_KB 128
#define FLASH_BOOTLDR_SIZE_KB 32
#define FLASH_BOOTLDR_PAYLOAD_SIZE_KB 96
#define SCL_Pin 0
#define SCL_GPIO_Port GPIOB
#define SDA_Pin 1
#define SDA_GPIO_Port GPIOB
#else
#error model not defined, use model= on makefile path
#endif
// Common for all models
#define SCL_Pin 6
#define SCL_GPIO_Port GPIOB
#define SDA_Pin 7
#define SDA_GPIO_Port GPIOB

#endif
50 changes: 30 additions & 20 deletions src/oled.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,37 @@
#define DEVICEADDR_OLED (0x3c << 1)

#ifdef MODEL_S60
// TODO; for now just cropping in on the screen from 128x32 to 96x16
#define OLED_WIDTH 96
#define OLED_HEIGHT 16
#define OLED_GRAM_START 0x10 // Should be 0x00 when we have full width
#define OLED_GRAM_END 0x6F // Should be 0x7F when we have full width
#define OLED_VCOM_LAYOUT 0x12
#define OLED_SEGMENT_MAP 0xA1
// TODO; for now just cropping in on the screen from 128x32 to 96x16
#define OLED_WIDTH 96
#define OLED_HEIGHT 16
#define OLED_GRAM_START 0x10 // Should be 0x00 when we have full width
#define OLED_GRAM_END 0x6F // Should be 0x7F when we have full width
#define OLED_VCOM_LAYOUT 0x12
#define OLED_SEGMENT_MAP 0xA1
#elif MODEL_TS101

// TODO; for now just cropping in on the screen from 128x32 to 96x16
#define OLED_WIDTH 96
#define OLED_HEIGHT 16
#define OLED_GRAM_START 0x00 // Should be 0x00 when we have full width
#define OLED_GRAM_END 0x5F // Should be 0x7F when we have full width
#define OLED_VCOM_LAYOUT 0x12
#define OLED_SEGMENT_MAP 0xA0
#define OLED_FLIP
#else
#define OLED_WIDTH 96
#define OLED_HEIGHT 16
#define OLED_VCOM_LAYOUT 0x02

#ifdef OLED_FLIP
#define OLED_GRAM_START 0 // Should be 0x00 when we have full width
#define OLED_GRAM_END 95
#define OLED_SEGMENT_MAP 0xA1
#else
#define OLED_GRAM_START 0x20 // Should be 0x00 when we have full width
#define OLED_GRAM_END 0x7F
#define OLED_SEGMENT_MAP 0xA0
#endif
#define OLED_WIDTH 96
#define OLED_HEIGHT 16
#define OLED_VCOM_LAYOUT 0x02

#ifdef OLED_FLIP
#define OLED_GRAM_START 0 // Should be 0x00 when we have full width
#define OLED_GRAM_END 95
#define OLED_SEGMENT_MAP 0xA1
#else
#define OLED_GRAM_START 0x20 // Should be 0x00 when we have full width
#define OLED_GRAM_END 0x7F
#define OLED_SEGMENT_MAP 0xA0
#endif

#endif
#define FRAMEBUFFER_START 17
Expand Down
2 changes: 1 addition & 1 deletion src/stm32f103.ld
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
MEMORY
{
rom (rx) : ORIGIN = 0x08000000, LENGTH = 8K
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 8k
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 20k
}

/* Enforce emmition of the vector table. */
Expand Down
2 changes: 1 addition & 1 deletion src/stm32f103_32k_runtime.ld
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
MEMORY
{
rom (rx) : ORIGIN = 0x08008000, LENGTH = 8K
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 8k
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 20k
}

/* Enforce emmition of the vector table. */
Expand Down
2 changes: 1 addition & 1 deletion src/stm32f103_runtime.ld
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
MEMORY
{
rom (rx) : ORIGIN = 0x08004000, LENGTH = 8K
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 8k
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 20k
}

/* Enforce emmition of the vector table. */
Expand Down
2 changes: 1 addition & 1 deletion src/stm32f103_runtime_s60.ld
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
MEMORY
{
rom (rx) : ORIGIN = 0x08004400, LENGTH = 8K
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 8k
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 20k
}

/* Enforce emmition of the vector table. */
Expand Down