bschwand / STM8-SPL-SDCC

STM8S SPL for SDCC
45 stars 12 forks source link

other STM8 families should be supported, not just STM8 S #2

Open bschwand opened 6 years ago

bschwand commented 6 years ago

"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.

gicking commented 6 years ago

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

bschwand commented 6 years ago

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...

gicking commented 6 years ago

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

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...

bschwand commented 6 years ago

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 :-)

andrewsclapp commented 4 years ago

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

bschwand commented 4 years ago

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 notifications@github.com 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 .