Skip to content

Commit

Permalink
Merge branch 'release-0.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
tenbaht committed May 10, 2019
2 parents 1db470f + e04af40 commit cde4d22
Show file tree
Hide file tree
Showing 513 changed files with 4,895 additions and 3,021 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ tags
*.map
# ignore files generated by the Arduino make system:
build-*/
# ignore test log files:
*test.log
# ignore files generated by patch:
*.orig
*.rej
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,32 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]


## [0.5 - 2019-05-10]
### Changed
- reduced binary size by splitting some Arduino core files
- reduced binary size by optimizing the pinMode() implementation
- using busybox as command shell for windows to run the wrapper scripts
- move the SPL compilation scripts into a separate project spl-splitter
- update SPL files to v2.3.0 (add support for STM8S001)
- flatten the repository structure
- update stm8gal to version 1.3.0
- updated SDCC to version 3.9/build 11242

### Fixed
- make sure main.c is pulled in for IDE builds as well
- building the core library when using make (regression bug in 0.4.0)


## [0.4.0 - 2018-12-07]
### Added
- using stm8gal to upload using the builtin bootloader of larger STM8 devices
- Support for STM8S105K4 breakout board (stm8sblack)
- Support for Sduino-UNO board (s8uno)
- Support for Sduino MB board (mb208)
- Unlocking a MCU by using Tools->Burn Bootloader in the Arduino IDE
- new library LiquidCrystal_I2C for text LCD with I2C converter backpack
- new library LiquidCrystal_pcf2119 for I2C text LCD based on the PCF2119
- new library Wire for I2C communication
- new library EEPROM
Expand Down
34 changes: 27 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,23 @@ Now you should find a new entry *STM8S Boards* in the list at

## Known issues

The Arduino IDE Version 1.8.7 suffers from a known regression bug. If you
see the error message "select upload port first" apply this
**The Arduino IDE version 1.8.7 is buggy, use 1.8.8 instead.**

IDE error message **select upload port first** (IDE v1.8.7 only): Update to
IDE 1.8.8 or apply this
[workaround](https://github.com/tenbaht/sduino/issues/68#issuecomment-441425529).

Very slow compilation after using "save as" (IDE v1.8.7 only): After saving
a file under a different name the CPU load maxes out for one CPU core and
the IDE reacts extremly slow. Exit the Arduino IDE and re-open it. Update to
IDE 1.8.8.

**bash.exe: warning: could not find /tmp, please create!**: Shows up on windows
systems. Annoying, but harmless.
[Workaround](https://github.com/tenbaht/sduino/issues/61#issuecomment-443551180)
This whole issue will be fixed in the upcoming 0.5 release by using busybox
for all scripts on windows.


## Included libraries

Expand All @@ -69,24 +82,31 @@ guide](https://tenbaht.github.io/sduino/api/migration/) for details.
#### Communication

* SPI: Real hardware-SPI up to 10MHz.
* Wire: Port of the stock Wire library for I2C communication (with
improvements)
* I2C: Port of the I2C master library by Wayne Truchsess
* HardwareSerial: The standard serial interface.

#### Displays

* LiquidCrystal: HD44780 based text LCDs
* LiquidCrystal_I2C: HD44780 based text LCDs with I2C converter backpack
* LiquidCrystal_pcf2119: PCF2119 based text LCDs with I2C connection
* PCD8544: Monochrome graphical LCD based on the PCD8544 controller like the
Nokia 5110 display. SPI mode only.
* Mini_SSD1306: SSD1306-based monochrome OLED displays with 128x64 pixels.
I2C support only.

#### Storage

* EEPROM: Port of the stock EEPROM library for accessing the buildin EEPROM

#### Motor control

* Stepper: Stepper motors with 2, 4 or 5 phases.
* Servo: Up to 12 servos using only 1 timer.



## Compatibility with the Arduino world

Since there is no free C++ for the STM8, it is impossible to do a full 1:1
Expand All @@ -104,15 +124,15 @@ guide](https://tenbaht.github.io/sduino/api/migration/) for an overview.

## Supported Systems:

Arduino IDE versions 1.8.7, 1.8.5 and 1.6.13 are tested, but any version >=1.6.6
should work.
Arduino IDE versions 1.8.8, 1.8.7, 1.8.5 and 1.6.13 are tested, but any
version >=1.6.6 should work.

Version 1.8.7 might require a
[workaround](https://github.com/tenbaht/sduino/issues/68#issuecomment-441425529)
if you see an error message "select upload port first".

* Linux 64 bit: Tested on Ubuntu 16.04
* Linux 32 bit: Tested on Ubuntu 16.04
* Linux 64 bit: Tested on Mint 19/Ubuntu 18.04
* Linux 32 bit: Tested on Mint 19/Ubuntu 18.04
* Windows: Tested on Windows 7. Sduino might work on XP (not tested), but
the ST-Link/V2 driver is not available anymore for XP.
* MacOS: tested on 10.13.
8 changes: 4 additions & 4 deletions board-manager/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# the required versions for the new build
COREVERSION=0.4.0
SDCCVERSION=10738
TOOLSVERSION=2018.12.07
COREVERSION=0.5
SDCCVERSION=11242
TOOLSVERSION=2019.02.05

# default the tool version to be the current date as YYYY.MM.DD
#TOOLSVERSION?=$(shell date '+%Y.%m.%d')
Expand Down Expand Up @@ -46,7 +46,7 @@ DATE=$(shell date '+%F')
release:
# update the version number in the changelog if not already done:
grep -q "$(COREVERSION)" ../CHANGELOG.md || \
sed "/^## \[Unreleased\]/ a\\\n\n## [$(COREVERSION) - $(DATE)]" ../CHANGELOG.md
sed -i "/^## \[Unreleased\]/ a\\\n\n## [$(COREVERSION) - $(DATE)]" ../CHANGELOG.md
git add ../CHANGELOG.md ../$(PACKAGEFILE)
git add parts/tools-*-$(SDCCVERSION).txt parts/tools-*-$(TOOLSVERSION).txt parts/platform-*-$(COREVERSION).txt
git commit
Expand Down
10 changes: 7 additions & 3 deletions board-manager/Makefile.core
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ COREDIR?=release/v$(COREVERSION)
PARTSDIR?=parts

# subtree of the repository to be included in the archive
SUBTREE=sduino/hardware/sduino/stm8
SUBTREE=sduino/stm8

#
### No user serviceable part below here. ################################
Expand All @@ -43,8 +43,12 @@ $(PLATFORM_ENTRY): $(COREFILE)

$(COREFILE): | $(COREDIR)
echo "Generating the core archive file."
(cd ..; git archive -v --prefix=./ --format=tar HEAD:$(SUBTREE))|\
bzip2 > $(COREFILE)
$(eval TMPDIR := $(shell mktemp -d))
cd ..; git archive -v HEAD:sduino/stm8|tar -x -C $(TMPDIR)
sed -i '/^tools\.stm8/ s#{runtime.hardware.path}/tools#{runtime.tools.STM8Tools.path}#' \
$(TMPDIR)/platform.txt
tar cvjf $(COREFILE) -C $(TMPDIR) .
rm -rf $(TMPDIR)

# make a new release directory if not present
#
Expand Down
2 changes: 1 addition & 1 deletion board-manager/Makefile.tools
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ endif


# Where to find the tools directory
BASEDIR=../sduino/hardware/sduino
BASEDIR=../sduino

# Ignore all files matching one of these shell patterns:
IGNORE=*~ *bak x build-* *.orig *.rej
Expand Down
2 changes: 1 addition & 1 deletion board-manager/gen_platform_entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ list_boards()
{
echo -n " \"boards\": ["
n=0
sed -n "s/.*\.name=//p" ../sduino/hardware/sduino/stm8/boards.txt |\
sed -n "s/.*\.name=//p" ../sduino/stm8/boards.txt |\
while read line; do
if [ $n -ne 0 ]; then echo -n ","; fi
echo
Expand Down
5 changes: 3 additions & 2 deletions board-manager/minimize-sdcc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ TAR_EXCLUDE='--exclude=doc --exclude=src --exclude=non-free
--exclude=*00 --exclude=*08 --exclude=*2k
--exclude=*51 --exclude=*80 --exclude=*90
--exclude=*gb --exclude=*ka --exclude=*.info
--exclude=*pdk* --exclude=*rab --exclude=huge
--exclude=large* --exclude=medium --exclude=small*'

ZIP_EXCLUDE='-x */non-free/* */src/* *stlcs* */pic*
*00* *08* *80* *90* *51* *2k* *gb* *ka* */info/*
*/large* */medium/* */small*'
*00* *08* *80* *90* *51* *2k* *gb* *ka* */info/* *pdk* *rab*
*/huge/* */large* */medium/* */small*'

TMP=$(mktemp -d sdcc-repack-XXXXXX --tmpdir)

Expand Down
29 changes: 29 additions & 0 deletions board-manager/parts/platform-entry-sduino-0.5-pre2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "Sduino STM8 plain C core (non-C++)",
"architecture": "stm8",
"version": "0.5-pre2",
"category": "Contributed",
"boards": [
{"name": "STM8S103F3 Breakout Board"},
{"name": "STM8S105C6 Discovery Board"},
{"name": "STM8S105K4T6 Breakout Board"},
{"name": "sduino UNO (STM8S105K6)"},
{"name": "sduino MB (STM8S208MBT6B)"}
],
"toolsDependencies": [
{
"name": "STM8Tools",
"version": "2019.02.05",
"packager": "sduino"
},
{
"name": "sdcc",
"version": "build.10738",
"packager": "sduino"
}
],
"url": "https://github.com/tenbaht/sduino/releases/download/v0.5-pre2/sduino-core-0.5-pre2.tar.bz2",
"archiveFileName": "sduino-core-0.5-pre2.tar.bz2",
"checksum": "SHA-256:13f039942368fdc2fea5470c2d3d58d9fb377cc7ca9502b1177f11ae8c75a7d8",
"size": "2263319"
},
29 changes: 29 additions & 0 deletions board-manager/parts/platform-entry-sduino-0.5.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "Sduino STM8 plain C core (non-C++)",
"architecture": "stm8",
"version": "0.5",
"category": "Contributed",
"boards": [
{"name": "STM8S103F3 Breakout Board"},
{"name": "STM8S105C6 Discovery Board"},
{"name": "STM8S105K4T6 Breakout Board"},
{"name": "sduino UNO (STM8S105K6)"},
{"name": "sduino MB (STM8S208MBT6B)"}
],
"toolsDependencies": [
{
"name": "STM8Tools",
"version": "2019.02.05",
"packager": "sduino"
},
{
"name": "sdcc",
"version": "build.11242",
"packager": "sduino"
}
],
"url": "https://github.com/tenbaht/sduino/releases/download/v0.5/sduino-core-0.5.tar.bz2",
"archiveFileName": "sduino-core-0.5.tar.bz2",
"checksum": "SHA-256:16a8083583c704b18921cf5f8ededde925d313b4af6d9d64fa95ae2255e2bbf5",
"size": "2263740"
},
37 changes: 37 additions & 0 deletions board-manager/parts/tools-entry-sdcc-11242.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "sdcc",
"version": "build.11242",
"systems": [
{
"host": "x86_64-pc-linux-gnu",
"url": "https://github.com/tenbaht/sduino/releases/download/v0.5/sdcc-stm8-amd64-unknown-linux2.5-20190502-11242.tar.bz2",
"archiveFileName": "sdcc-stm8-amd64-unknown-linux2.5-20190502-11242.tar.bz2",
"checksum": "SHA-256:f69122faf38e72cccb7acc9b4d215e6e74901c053e04295c7ec8f4c29c5bad65",
"size": "2604557"
},{
"host": "x86_64-pc-linux-gnu",
"url": "https://github.com/tenbaht/sduino/releases/download/v0.5/sdcc-stm8-armv6l-unknown-linux-gnueabihf-20190502-11242.tar.bz2",
"archiveFileName": "sdcc-stm8-armv6l-unknown-linux-gnueabihf-20190502-11242.tar.bz2",
"checksum": "SHA-256:e079f964d7b74a8744681dfb53047aecdd0b563dee02c3724dd83a9d4b1e577c",
"size": "2388318"
},{
"host": "i686-pc-linux-gnu",
"url": "https://github.com/tenbaht/sduino/releases/download/v0.5/sdcc-stm8-i386-unknown-linux2.5-20190502-11242.tar.bz2",
"archiveFileName": "sdcc-stm8-i386-unknown-linux2.5-20190502-11242.tar.bz2",
"checksum": "SHA-256:86d3c21aa49199a0ffcf201148c261d5a391d9365b472ab434c3d3acf864de29",
"size": "2649974"
},{
"host": "i686-mingw32",
"url": "https://github.com/tenbaht/sduino/releases/download/v0.5/sdcc-stm8-i586-mingw32msvc-20190502-11242.tar.bz2",
"archiveFileName": "sdcc-stm8-i586-mingw32msvc-20190502-11242.tar.bz2",
"checksum": "SHA-256:1acdd54d62207bced3abb51fc401b0af85ef4711525033764b089fa0db7cb868",
"size": "3034472"
},{
"host": "x86_64-apple-darwin",
"url": "https://github.com/tenbaht/sduino/releases/download/v0.5/sdcc-stm8-x86_64-apple-macosx-20190502-11242.tar.bz2",
"archiveFileName": "sdcc-stm8-x86_64-apple-macosx-20190502-11242.tar.bz2",
"checksum": "SHA-256:b34b236bef7a2c87db601995e95e928cca1af56c8fd7018cf5612a8314afb559",
"size": "2803984"
}
]
},
31 changes: 31 additions & 0 deletions board-manager/parts/tools-entry-sduino-tools-2019.02.05.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "STM8Tools",
"version": "2019.02.05",
"systems": [
{
"host": "i686-pc-linux-gnu",
"url": "https://github.com/tenbaht/sduino/releases/download/v0.5/sduino-tools_linux32-2019.02.05.tar.bz2",
"archiveFileName": "sduino-tools_linux32-2019.02.05.tar.bz2",
"checksum": "SHA-256:86c816ce31fc37d8437ac9a1eb88f0c58444b9abbb9bc16934f0977dec474cc3",
"size": "49540"
},{
"host": "x86_64-pc-linux-gnu",
"url": "https://github.com/tenbaht/sduino/releases/download/v0.5/sduino-tools_linux64-2019.02.05.tar.bz2",
"archiveFileName": "sduino-tools_linux64-2019.02.05.tar.bz2",
"checksum": "SHA-256:e417e67551c6d34b6f9a8b8635eb1eb69342fd021b2962e52e495b2dd333d6c7",
"size": "49362"
},{
"host": "x86_64-apple-darwin",
"url": "https://github.com/tenbaht/sduino/releases/download/v0.5/sduino-tools_macosx-2019.02.05.tar.bz2",
"archiveFileName": "sduino-tools_macosx-2019.02.05.tar.bz2",
"checksum": "SHA-256:5711e486ff060f1a3941a49884bec061110ec33f4865afb1359bfd9e15280766",
"size": "52357"
},{
"host": "i686-mingw32",
"url": "https://github.com/tenbaht/sduino/releases/download/v0.5/sduino-tools_mingw32-2019.02.05.tar.bz2",
"archiveFileName": "sduino-tools_mingw32-2019.02.05.tar.bz2",
"checksum": "SHA-256:35d76fb968ac7998ec798502be597d7b234ceddb5c2bcb439d8f24711bd34064",
"size": "418464"
}
]
},
2 changes: 2 additions & 0 deletions docs/api/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ names. The preprocessor does not allow for variable macro names. That means
`_Generic` would work with fixed name like `Serial`, but it wouldn't work
for `SoftwareSerial` with no standard instance name.
[This](https://mort.coffee/home/obscure-c-features/) is a good introduction
into the use of `_Generic`.
Expand Down
34 changes: 34 additions & 0 deletions docs/developer/coding-style.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Coding style

## Development workflow

I recently read this great article about [a successful branching
model](https://nvie.com/posts/a-successful-git-branching-model/) for git and
will implement it. Highly recommended!


## Changelog

Every feature branch (or pull request) should include an update for
Changelog.md


## Code format

When porting an existing Arduino library I try to preserve the original
formatting as much as possible to allow for easy comparison to the original
state.

There is a development of a C++ capable compiler environment going on. There
is no public website for that project yet, but I am in contact with the
developer. He is even targeting Sduino for his project and at one point in
the (still distant) future we might be able to switch back to the orginal
library code again. Preserved code structure would be a big plus then. (But
don't hold your breath yet)

Newly written code is mostly formatted using indent according to the linux
kernel coding style, using Tabs, Tab width 8, line length 80:

```bash
indent -linux
```
Loading

0 comments on commit cde4d22

Please sign in to comment.