Discussion:
[Sdcc-user] Tutorials for STM8 and MCS-51 development using the Small Device C Compiler for various boards
Philipp Klaus Krause
2017-01-01 09:54:51 UTC
Permalink
Based on my experience in getting started with various STM8 and MCS-51
boards, I wrote a few simple tutorials to help others. They use free
tools only. For various evaluation boards there are three simple demos:

1) LED counter controlled by timer
2) Serial output
3) Dhrystone / Whetstone benchmarks

The tutorials can be found at:

http://www.colecovision.eu/stm8/
http://www.colecovision.eu/mcs51/

Please tell me if you find any mistakes, or have any suggestions for
improvement.

Philipp

P.S.: Most of the STM8 tutorials have been around for a while, but
recently I made some minor updates, and added tutorials porting the
demos to lots of MCS-51 boards.
Augusto Fraga Giachero
2017-01-01 15:11:48 UTC
Permalink
Well done!

Do you have any hint on how to debug STM8 targets with free tools?
Post by Philipp Klaus Krause
Based on my experience in getting started with various STM8 and MCS-51
boards, I wrote a few simple tutorials to help others. They use free
1) LED counter controlled by timer
2) Serial output
3) Dhrystone / Whetstone benchmarks
http://www.colecovision.eu/stm8/
http://www.colecovision.eu/mcs51/
Please tell me if you find any mistakes, or have any suggestions for
improvement.
Philipp
P.S.: Most of the STM8 tutorials have been around for a while, but
recently I made some minor updates, and added tutorials porting the
demos to lots of MCS-51 boards.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Sdcc-user mailing list
https://lists.sourceforge.net/lists/listinfo/sdcc-user
Philipp Klaus Krause
2017-01-01 18:15:07 UTC
Permalink
Post by Augusto Fraga Giachero
Well done!
Do you have any hint on how to debug STM8 targets with free tools?
SDCC can generate ELF with DWARF. AFAIK, ST has a gdb fork that could be
used for debugging (I've read they ship it with ST Visual develop).
AFAIK some people got that combination to work. But I haven't read about
any successes in getting the gdb source code from ST (there are posts
about that issue on ST forums).

Philipp
Augusto Fraga Giachero
2017-01-02 02:29:12 UTC
Permalink
Post by Philipp Klaus Krause
SDCC can generate ELF with DWARF. AFAIK, ST has a gdb fork that could be
used for debugging (I've read they ship it with ST Visual develop).
AFAIK some people got that combination to work. But I haven't read about
any successes in getting the gdb source code from ST (there are posts
about that issue on ST forums).
Philipp
I've found an recent post on ST forums that has a link to an old version
of the GDB source code modified by ST to support STM8 targets. I've
uploaded to GitLab for convenience. Maybe one day I'll try to compile it.

Here is the link for the git repository:
https://gitlab.com/Palmitoxico/stm8-gdb/tree/master

Augusto F. Giachero
Miklos Marton
2017-02-14 18:26:11 UTC
Permalink
Post by Augusto Fraga Giachero
I've found an recent post on ST forums that has a link to an old version
of the GDB source code modified by ST to support STM8 targets. I've
uploaded to GitLab for convenience. Maybe one day I'll try to compile it.
https://gitlab.com/Palmitoxico/stm8-gdb/tree/master
Augusto F. Giachero
In the case if anyone is interested:
I have managed to get the gdb sources from a guy who got it from ST
directly of the currently shipping STM8 GDB (it uses ST7 v3.10.2
internal version).
There are many changes between the publicly available (v3.9.16) and this
version.

https://gitlab.com/martonmiklos/stm8-gdb/tree/v3.10.2

Best regards,
Miklos Marton
Augusto Fraga Giachero
2017-02-21 18:56:23 UTC
Permalink
Nice!
Post by Miklos Marton
Post by Augusto Fraga Giachero
I've found an recent post on ST forums that has a link to an old version
of the GDB source code modified by ST to support STM8 targets. I've
uploaded to GitLab for convenience. Maybe one day I'll try to compile it.
https://gitlab.com/Palmitoxico/stm8-gdb/tree/master
Augusto F. Giachero
I have managed to get the gdb sources from a guy who got it from ST
directly of the currently shipping STM8 GDB (it uses ST7 v3.10.2
internal version).
There are many changes between the publicly available (v3.9.16) and this
version.
https://gitlab.com/martonmiklos/stm8-gdb/tree/v3.10.2
Best regards,
Miklos Marton
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Sdcc-user mailing list
https://lists.sourceforge.net/lists/listinfo/sdcc-user
Miklos Marton
2017-02-21 19:34:05 UTC
Permalink
Hi there,

I have sent you a separate mail about the gitlab stuff about branches &
PRs.

If you have some time please check that! Thanks!

Best regards,
Miklos Marton
Post by Philipp Klaus Krause
Nice!
Post by Miklos Marton
Post by Augusto Fraga Giachero
I've found an recent post on ST forums that has a link to an old version
of the GDB source code modified by ST to support STM8 targets. I've
uploaded to GitLab for convenience. Maybe one day I'll try to compile it.
https://gitlab.com/Palmitoxico/stm8-gdb/tree/master
Augusto F. Giachero
I have managed to get the gdb sources from a guy who got it from ST
directly of the currently shipping STM8 GDB (it uses ST7 v3.10.2
internal version).
There are many changes between the publicly available (v3.9.16) and this
version.
https://gitlab.com/martonmiklos/stm8-gdb/tree/v3.10.2
Best regards,
Miklos Marton
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Sdcc-user mailing list
https://lists.sourceforge.net/lists/listinfo/sdcc-user
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Sdcc-user mailing list
https://lists.sourceforge.net/lists/listinfo/sdcc-user
Augusto Fraga Giachero
2017-02-23 15:02:44 UTC
Permalink
I haven't received any email from you (I've checked my Spam folder).

Augusto F. Giachero
Post by Miklos Marton
Hi there,
I have sent you a separate mail about the gitlab stuff about branches &
PRs.
If you have some time please check that! Thanks!
Best regards,
Miklos Marton
Post by Philipp Klaus Krause
Nice!
Post by Miklos Marton
Post by Augusto Fraga Giachero
I've found an recent post on ST forums that has a link to an old version
of the GDB source code modified by ST to support STM8 targets. I've
uploaded to GitLab for convenience. Maybe one day I'll try to compile it.
https://gitlab.com/Palmitoxico/stm8-gdb/tree/master
Augusto F. Giachero
I have managed to get the gdb sources from a guy who got it from ST
directly of the currently shipping STM8 GDB (it uses ST7 v3.10.2
internal version).
There are many changes between the publicly available (v3.9.16) and this
version.
https://gitlab.com/martonmiklos/stm8-gdb/tree/v3.10.2
Best regards,
Miklos Marton
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Sdcc-user mailing list
https://lists.sourceforge.net/lists/listinfo/sdcc-user
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Sdcc-user mailing list
https://lists.sourceforge.net/lists/listinfo/sdcc-user
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Sdcc-user mailing list
https://lists.sourceforge.net/lists/listinfo/sdcc-user
Miklos Marton
2017-01-01 19:30:31 UTC
Permalink
Post by Philipp Klaus Krause
SDCC can generate ELF with DWARF. AFAIK, ST has a gdb fork that could be
used for debugging (I've read they ship it with ST Visual develop).
AFAIK some people got that combination to work. But I haven't read about
any successes in getting the gdb source code from ST (there are posts
about that issue on ST forums).
Philipp
Here is a link to the ST's gdb's sources:
http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/legacy-mcus-embedded-software/stsw-st7058.html

Please note that it is not the nost recent: the gdb7.exe which is
shipped with the STVD 4.3.9 (which is the latest available I think) has
a gdb7.exe with the following version:

gdb 4.17, ST7 v3.10.2 (Dec 3 2010)

However the in the sources above are from the 3.9.16 version according
to the line 2847 in the top.c:
fprintf_filtered (stream, "gdb %s, ST7 v3.9.16 (%s)", version, __DATE__);

There is a guy who have managed to get the latest sources from ST after
a long procedure, but he have not shared it with me yet.

Also this gdb source is heavilly windows oriented. I have not been able
to get it compiled under Linux, and the hw abstraction parts were totaly
left out from it. (They ship them as a separate dll and they did not
wanted to opensource it I think.)

Using this gdb with modern IDEs (Eclipse CDT, QtCreator) is not really
possible because it is an ancient version (the original version was
released ~2000), and it lacks the MI interface.

Recently there were a guy on the openOCD mailing list who started
looking at adding support for the ST Link's SWIM debugger to the openOCD.

I would be pretty happy if there would be a preferably recent
gdb+openocd based debugger for this architecture.

Best regards,
Miklos Marton
Maarten Brock
2017-05-14 09:54:35 UTC
Permalink
Post by Philipp Klaus Krause
Based on my experience in getting started with various STM8 and MCS-51
boards, I wrote a few simple tutorials to help others. They use free
1) LED counter controlled by timer
2) Serial output
3) Dhrystone / Whetstone benchmarks
http://www.colecovision.eu/stm8/
http://www.colecovision.eu/mcs51/
Please tell me if you find any mistakes, or have any suggestions for
improvement.
Philipp
Hi Philipp,

On the C8051F120 Dhrystone page you write:
The C8051F120 itself could run at up to 100 Mhz, but would require an
external crystal to do so.

This is not true. You can also use the PLL on the internal 24.5MHz +/-2%
oscillator giving 98MHz +/-2%.

Maarten

Loading...