You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 3, 2025. It is now read-only.
***fast** - uploads 4k binary in 1 second @115200bps
8
+
***configurable** - can be adjusted for parts with different flash block size
9
+
10
+
## Configuration
11
+
12
+
The default configuration targets low-density devices (STM8S003). Configuration is located in `config.h`.
13
+
***BLOCK_SIZE** - flash block size according to device datasheet. This should be set to 64 for low-density devices or 128 for devices with >8k flash.
14
+
***BOOT_ADDR** - application boot address.
15
+
***BOOT_PIN** - entry jumper. This is set to PD3 by default.
16
+
***RELOCATE_IVT** - when set to 1 (default) the interrupt vectors are relocated. When set to 0 the bootloader will overwrite it's own interrupt vector table with the application's IVT, thus eliminating additional CPU overhead during interrupts. Write-protection cannot be used in this case and resulting binary is slightly larger.
17
+
18
+
### Changing boot address
19
+
Boot address must be a multiple of BLOCK_SIZE. Address is set in 2 places:
20
+
* config.h
21
+
* init.s
22
+
23
+
Main application is compiled with `--code-loc <address>` option. When RELOCATE_IVT is set to 0, 0x80 must be subtracted from application address and isr29 must be implemented: `void dummy_isr() __interrupt(29) __naked { ; }`.
24
+
25
+
## Build instructions
26
+
Build and flash the bootloader:
7
27
8
-
Short PD3 -> GND.
9
28
```bash
10
29
$ make && make flash
30
+
```
31
+
32
+
Enable write-protection (UBC) on pages 0-10:
33
+
34
+
```bash
35
+
make opt-set
36
+
```
37
+
38
+
## Uploading the firmware
39
+
40
+
There is a demo application inside `app` directory which toggles PD4 via interrupts. To upload the application short PD3 to ground, power-cycle the MCU and run the uploader utility.
0 commit comments