Skip to content

Commit 3d685a8

Browse files
committed
add FAQ, minor spelling fixes, fix tenbaht#76
1 parent 31c577f commit 3d685a8

5 files changed

Lines changed: 93 additions & 18 deletions

File tree

docs/hardware/stm8blue.md

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,39 @@ boards are my main development platform.
66

77
![Image of the STM8S103 board](stm8blue.jpg)
88

9-
They are very similar to the [ESP14 Wifi-boards](esp14.md) and
10-
most programs will work fine on those chinese gems as well.
11-
12-
The STM8S103 breakout boards are build around a CPU STM8S103F3P6 with 16MHz
13-
internal oscillator, 8kB flash, 1kB RAM, and 640 byte EEPROM. The CPU
14-
includes a UART, SPI, I2C, PWM, 10 bit ADC, 3 timer, and up to 14 I/O pins -
15-
quite similar to an Atmel ATmega8.
9+
## Features
10+
11+
The hardware features are quite similar to an ATmega8:
12+
13+
Boardname |stm8blue
14+
----- |-------
15+
CPU |STM8S103F3P6
16+
Clock |16MHz, internal oscillator
17+
Flash |8kB
18+
RAM |1kB
19+
EEPROM |640 byte
20+
I/O voltage |3.3V
21+
GPIO |14
22+
serial connections |UART, SPI, I2C
23+
PWM |4 (up to 7 via alternate mapping)
24+
ADC |5 channel, 10 bit
25+
LED |PB5 (Arduino D3), active low, shared with I2C, red
26+
programming interface |SWIM, no serial bootloader
27+
USB connector |mini, power only (data lines not connected)
1628

1729
One (red) LED is connected to GPIO PB5 (CPU pin 11). This LED is low active.
1830
Please keep in mind that this is one of the I2C signals and **using the LED
1931
blocks the I2C bus**. The push button is for reset. The CPU runs on 3.3V, a
2032
linear regulator is integrated on the board. The micro USB connector is only
2133
for (5V) power supply, the data lines are not connected.
2234

35+
![Schematic of the STMS103 board](stm8blue-schematic.png)
36+
2337
All CPU pins are easily accessible on (optional) pin headers (pitch 2.54mm,
2438
perfect for breadboards).
2539

26-
![Schematic of the STMS103 board](stm8blue-schematic.png)
27-
40+
They are very similar to the [ESP14 Wifi-boards](esp14.md) and
41+
most programs will work fine on those chinese gems as well.
2842

2943
## Unlocking a write protected MCU
3044

@@ -65,6 +79,13 @@ SWIM |2 |5 | 5
6579
GND |3 |7 | 3
6680
NRST |4 |9 | 1
6781

82+
***Crap alert:*** Some lots of the stm8blue boards seem to have no working
83+
connection to GND on the SWIM connector!
84+
85+
If the board does not respond to the flash tool when only powered from the
86+
SWIM connector, try powering it from the the USB connector or the power pin
87+
instead.
88+
6889

6990

7091
## Pin number mappings
@@ -76,7 +97,7 @@ Ideally, all these numbers would be the same and all programs could be
7697
compiled without changes.
7798

7899
[Here](../developer/pin_mapping.md) I discuss some possible pin mapping
79-
schemes and check how close we could get the the ideal mapping.
100+
schemes and check how close we could get to the ideal mapping.
80101
Unfortunatly, it turns out that a perfect mapping is not possible.
81102

82103
In the end I chose a simple geometric numbering for the square UFQFPN20
@@ -88,7 +109,7 @@ this mapping:
88109

89110

90111
sduino pin | STM8S103 CPU port pin
91-
---------- | ---------------------
112+
---------: | ---------------------
92113
0-2 | PA1-PA3 (PA1 and PA2 only weak output drivers)
93114
3-4 | PB5-PB4 (reverse order)
94115
5-9 | PC3-PC7

docs/usage/board-manager-install.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ Wait for the download to finsh and you are ready to blink:
2323
Easy, isn't it?
2424

2525
In order to upload the compiled sketch to a connected board you need to
26-
[install your flash tool](../hardware/flashtool/#installation-for-windows).
26+
[install your flash tool](../hardware/flashtool/#installation-for-windows)
27+
first.
2728

2829

2930

docs/usage/faq.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# FAQ/common problems
2+
3+
## Compilation issues
4+
5+
### ASlink-Warning-No definition of area SSEG
6+
7+
This happens when there is no *.pde or *.ino file in the project directory,
8+
`Serial_begin()` is not used and only *.c files are compiled.
9+
10+
This message means that main.c is not pulled in by the linker because there
11+
was no reference to main() anywhere. When processing *.pde/ino files
12+
`wrapper/sdcc.sh` (for IDE builds) or `Arduino.mk` (for Makefile builds) adds
13+
a reference to main:
14+
15+
```
16+
/* add a dummy reference to main() to make sure to pull in main.c from the core library */
17+
void main(void);
18+
void (*dummy_variable) () = main;
19+
```
20+
21+
If there is no pde/ino file the user has to make sure main.c is pulled in by
22+
the linker or define its own main().
23+
24+
Possible ways to pull in main.c:
25+
26+
- Use Serial_begin(): This references the variable runSerialEvent which in turn pulls in main.c (some overhead)
27+
- reference the variable runSerialEvent yourself: `begin(){runSerialEvent=0;}` (Overhead: 4 bytes flash)
28+
- add a reference to main() like above. (Overhead: 2 bytes RAM and 2 bytes flash)
29+
- define your own main() function.
30+
31+
32+
### Flashing fails on the new board
33+
34+
It might be locked/write protected. [Check
35+
this](../../hardware/stm8blue/#unlocking-a-write-protected-mcu)
36+
37+
38+
## Hardware issues
39+
40+
41+
### My new stm8blue board seems dead and does not respond to the flash tool
42+
43+
***Crap alert:*** Some more recent lots of the stm8blue boards seem to have
44+
no working connection to GND on the SWIM connector.
45+
46+
Try connecting GND to the other GND board pin or power the board via USB.
47+
48+
Most freshly shipped boards come with a pre-programmed blinky. If the LED
49+
blinks when the board is powered via USB but doesn't when it is only
50+
connected to the flash tool, your board is probably missing the GND
51+
connection.
52+

docs/usage/why-stm8.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ $1.60-$3.00 for an ATmega8.
7676

7777
**Upgrade path**: The peripheral units of the STM8 are identical or at least
7878
very, very similar to the ones used with the STM32 family of 32 bit
79-
ARM-Cortex CPUs. This makes it is relatively easy to migrate existing
80-
software between the 8- and the 32-bit world. This is quite unique among the
81-
other CPUs.
79+
ARM-Cortex CPUs. This makes it relatively easy to migrate existing software
80+
between the 8- and the 32-bit world. This is quite unique among the other
81+
CPUs.
8282

mkdocs.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ nav:
88
- Introduction: 'index.md'
99
- Automatic Installation: 'usage/board-manager-install.md'
1010
- Building with the IDE: 'usage/build-ide.md'
11+
- 'usage/faq.md'
1112
- When to use an STM8S - and when not: 'usage/why-stm8.md'
1213
- Manual Installation: 'usage/manual-install.md'
1314
- Building with a Makefile: 'usage/build-cli.md'
@@ -29,7 +30,7 @@ nav:
2930
- Stepper library: api/Stepper.md
3031
- Servo library: api/Servo.md
3132
- Hardware:
32-
- Flash tool: hardware/flashtool.md
33+
- Flash tool: 'hardware/flashtool.md'
3334
# - List of supported boards: hardware.md
3435
- 'Generic STM8S103F3 breakout board (stm8blue)': hardware/stm8blue.md
3536
- 'Generic STM8S003 support': hardware/stm8s003.md
@@ -74,5 +75,5 @@ nav:
7475
# best: flatly, yeti (light typeface), cosmo, united, spacelab
7576
# with search: mkdocs
7677
#theme: flatly
77-
theme: bootstrap
78-
#theme: mkdocs
78+
#theme: bootstrap
79+
theme: mkdocs

0 commit comments

Comments
 (0)