Skip to content

Commit

Permalink
updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lujji committed Aug 7, 2017
1 parent cee9d57 commit 58cfe6a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
MCU ?= stm8s003f3
ARCH = stm8

F_CPU ?= 16000000
TARGET ?= main.ihx

SRCS := $(wildcard *.c)
Expand All @@ -15,8 +14,7 @@ LD = sdld
AS = sdasstm8
OBJCOPY = sdobjcopy
ASFLAGS = -plosgff
CFLAGS = -m$(ARCH) -p$(MCU)
CFLAGS += -DF_CPU=$(F_CPU)UL -I.
CFLAGS = -m$(ARCH) -p$(MCU) -I.
CFLAGS += --stack-auto --noinduction --use-non-free --noinvariant --opt-code-size
LDFLAGS = -m$(ARCH) -l$(ARCH) --out-fmt-ihx
LDFLAGS += -Wl-bIVT=0x8000 -Wl-bGSINIT=0x8080
Expand Down Expand Up @@ -45,7 +43,7 @@ size:

# enable write-protection on first 10 pages
opt-set:
@echo '0x00 0x0a 0xf5 0x00 0xff 0x00 0xff 0x00 0xff 0x00 0xff' | xxd -r > opt.bin
@echo '0x00 0x09 0xf6 0x00 0xff 0x00 0xff 0x00 0xff 0x00 0xff' | xxd -r > opt.bin
stm8flash -c stlinkv2 -p stm8s003f3 -s opt -w opt.bin

# reset option-bytes to factory defaults
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# stm8-bootloader
Serial bootloader for STM8S microcontrollers.
Serial bootloader for STM8S microcontrollers. A detailed write-up on this bootloader is posted [here](https://lujji.github.io/blog/serial-bootloader-for-stm8).

## Features

* **small** - fits in 9 pages (547 bytes w/ SDCC v3.6.8 #9951)
* **small** - fits in 547 bytes (SDCC v3.6.8 #9951)
* **fast** - uploads 4k binary in 1 second @115200bps
* **configurable** - can be adjusted for parts with different flash block size

Expand All @@ -29,7 +29,7 @@ Build and flash the bootloader:
$ make && make flash
```

Enable write-protection (UBC) on pages 0-10:
Enable write-protection (UBC) on pages 0-9:

``` bash
$ make opt-set
Expand Down
4 changes: 4 additions & 0 deletions config.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

#define BAUDRATE 115200

/* internal RC oscillator, CKDIVR = 0 */
#define F_CPU 16000000UL
#define UART_DIV ((F_CPU + BAUDRATE / 2) / BAUDRATE)

/* application address */
#define BOOT_ADDR 0x8280

Expand Down
2 changes: 0 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
#include "stm8s.h"
#include "ram.h"

#define UART_DIV ((F_CPU + BAUDRATE / 2) / BAUDRATE)

static uint8_t CRC;
static uint8_t ivt[128];
static uint8_t f_ram[128];
Expand Down

0 comments on commit 58cfe6a

Please sign in to comment.