hello,
with the great support by this community I am nearly done with an initial port
of the STM8 Standard Peripheral Library to SDCC.
Technical status:
- basis is SPL v2.2.0 available from
http://www.st.com/web/en/catalog/tools/FM147/CL1794/SC1807/SS1754/PF258009
<http://www.st.com/web/en/catalog/tools/FM147/CL1794/SC1807/SS1754/PF258009>
- applied SDCC specific changes to some headers and sources (marked with
"SDCC“)
- changed all ISR headers in examples to skip ISR declaration (see open
points)
- added flash r/w for 24b addresses via inline assembly (thanks Philipp!)
- created a SDCC "template project“ (i.e. Makefile). See
$(SPL)/Project/STM8S_StdPeriph_Template/
- created Win, Linux, and MacOSX batch scripts to compile and upload via
https://github.com/gicking/STM8_serial_flasher
<https://github.com/gicking/STM8_serial_flasher>
- added Doxygen input for creating manual from sources, since provided UM is
in Windows proprietary .chm format —> run Doxy to create HTML docu
- all SPL examples can be compiled but require editing of Makefile.
Functionality tested partly (see open points)
Open points —> questions to you:
- I only have access to a STM8 Discovery Board and a custom PCB, so I can't
verify all functionality -> additional checking is required
- since I am used to IDEs, the provided Makefile is far from perfect. For
example it lacks automatic dependencies. Any help is appreciated!
- in the same content: a template project for an IDE would be nice, but which
one…?
- acc. to UM flash block operations must be executed from RAM. How do I
compile/link code for RAM execution?
- the trap handler requires a patch or recent nightly-build. If not present
just comment out. However, traps shall be part of the next release (when?)
- SDCC requires the interrupt token AFTER the function name in ISR
declaration. I have fixed all examples, but this requires a manual fix for
other libs that rely on SPL (see STM homepage). However, according to Erik and
Philipp this would require a change of the SDCC parser with associated risks
--> not likely to be changed
Legal status:
- STM has indicated that they may approve of distribution of the modified
sources. But nothing official, yet
- I would still prefer STM to support SDCC officially to assert future
consistency. But so far no news on this
Until one of the above happens, you can download the SDCC patch for the STM8
SPL v2.2.0 from https://github.com/gicking/SPL_2.2.0_SDCC_patch
<https://github.com/gicking/SPL_2.2.0_SDCC_patch>
For instructions on patching see e.g.
http://jungels.net/articles/diff-patch-ten-minutes.html
<http://jungels.net/articles/diff-patch-ten-minutes.html>. Please let me know
if the patch works.
My first impressions of the SPL are quite mixed. It seems much more complicated
than e.g. Wiring for Arduino. However it is also much more versatile and, as
said before, the STM8 SPL is very similar to the STM32 SPL. And for the latter
with 100s of registers, a HW-lib is convenient to say the least. In addition
STM provides a lot of ready-made software which is based on the SPL. So I guess
it’s worth digging into… Let me know what you think!
Any feedback and/or support on the above open points is highly welcome!
Regards,
Georg Icking-Konert
>> I apologize for the ambiguity in my previous message; I was mainly trying
>> to reassure Philipp about the patch with respect to the non-stm8 backends.
>> I realize that what you are trying to accomplish probably will require
>> some modification to SDCC mainline to conform to the expected syntax.
>
> whoops, sorry! That would indeed solve the first of my 2 problems...
>
>> The patch has been applied in revision #9163 and will thus be in the
>> next release (and in the snapshots from tomorrow).
>
> :-) see above. Do you already know when the next release is due? In any case
> I?ll download the snapshot
>
> Regards,
> Georg Icking-Konert
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user