STM8-SPL-SDCC icon indicating copy to clipboard operation
STM8-SPL-SDCC copied to clipboard

other STM8 families should be supported, not just STM8 S

Open bschwand opened this issue 7 years ago • 6 comments

"PS: you also asked here for SPL patches for other devices than STM8A/S. Yes you are correct: on the STM homepage I found SPLs for 4 different STM8 families (STM8L10x, STM8L15x-16x-05x-AL31-L, STM8S, and STM8TL5x). The respective patches are all available from https://github.com/gicking/STM8-SPL_SDCC_patch"

I am not sure how to do this, does it make sense to try and have all that in a single repo ? I see the patches are against one original SPL download. I assume the code is different enough that one could not have a unified STM8 SPL for SDCC.

should we instead have separate projects ? I am not that interested in doing all that work for the other families unfortunately... I will add the (imperfect) script I used to help split all the files though, maybe anyone interested can then do the same for other families.

bschwand avatar Feb 24 '18 15:02 bschwand

hi Bruno, actually the patches are against different SPL downloads, namely STM8S/A, STM8L10x, STM8L15x-16x-05x-AL31-L, and STM8TL5x.

As the of the devices differs quite significantly, e.g. DMA or ADC, and also to reduce effort, I strongly propose to use different repos, and keep the structure of the SPLs as is.

How much manual re-work do you estimate after running your script (and how do I run it)? I would be volunteering if it isn't too much. However, I would greatly appreciate if you could take over the Github side if I prepare the files...? For a short feedback thanks a lot in advance!

Georg

gicking avatar Feb 25 '18 09:02 gicking

Yeah, I agree on different repositories. Well I did spend quite a bit of time, because every file needs to be checked manually after generation, and for each peripheral the proper "private" files need to be created. You just run the script in the SPL src/ directory, and give it the .c file to split as command line parameter and it will generate all the separate c files. YMMV, it might be all broken...

bschwand avatar Feb 25 '18 18:02 bschwand

I have trouble using your perl script on the STM8L10x SPL :-( Specifically:

  • in the script I replaced all "stm8s" to stm8l10x" to match the file prefixes
  • running "./split_spl.pl stm8l10x_gpio.c" gives no output and no new files

What do I do wrong here? Unfortunately I have no clue of Perl, so I would need some help by you... Thanks a lot in advance!

Georg

PS: do you use Skype? I guess that would be easiest...

gicking avatar Feb 25 '18 18:02 gicking

I was afraid of that. I'll have to download the others and check what is going on. you can also try, in split_spl.pl to uncomment the lines in #print and comment out the file creation: #open(FILE... and comment out the writing to the files: "print FILE ...

then invoke like this ./split_spl.pl < stm8l10x_gpio.c | less

it should make more obvious what the chunks it is trying to write out are. Most probably, the format is slightly different so the pattern matching for the beginning and end of functions is not succeeding. I said it was a hack :-)

bschwand avatar Feb 25 '18 20:02 bschwand

For folks who might have asked the question I asked below, check here first.

https://github.com/gicking/STM8-SPL_SDCC_patch

Hello Bruno,

I'm a late arrival to the conversation, but I have a strong interest in getting my copy of the SPL I downloaded for STM8L working for my project using STM8L051F3 chips. Would you be willing to outline your overall process for making the files useful in SDCC so that I might embark on the task with some direction? I'm starting with SDCC 4.0.0 and the files in STM8L15x-16x-05x-AL31-L_StdPeriph_Lib/ under linux. I'm able to leap small buildings in several attempts, but I have lots of time on my hands.

Thanks in advance,

-Andrew

andrewsclapp avatar May 07 '20 00:05 andrewsclapp

I just made a few scripts so that each function of the SPL resides in a single c file, since SDCC (the version I used) could not eliminate dead code if in the same file. That is pretty much all, just shuffling things and global variables around. I had a perl script using the comments in the SPL to help splitting the files.

Good luck, I have not touched this in a while so I can't tell you much more...

Bruno

On Thu, May 7, 2020 at 2:42 AM Andrew S Clapp [email protected] wrote:

Hello Bruno,

I'm a late arrival to the conversation, but I have a strong interest in getting my copy of the SPL I downloaded for STM8L working for my project using STM8L051F3 chips. Would you be willing to outline your overall process for making the files useful in SDCC so that I might embark on the task with some direction? I'm starting with SDCC 4.0.0 and the files in STM8L15x-16x-05x-AL31-L_StdPeriph_Lib/ under linux. I'm able to leap small buildings in several attempts, but I have lots of time on my hands.

Thanks in advance,

-Andrew

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bschwand/STM8-SPL-SDCC/issues/2#issuecomment-624964162, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFCURL3RWFZMNWUJMEPOBLRQH7XPANCNFSM4ESHW5OA .

bschwand avatar May 07 '20 10:05 bschwand