tenbaht / sduino

An Arduino-like programming API for the STM8
http://tenbaht.github.io/sduino/
GNU Lesser General Public License v2.1
351 stars 218 forks source link

Any idea to add support for stm8L. #67

Open TiNredmc opened 5 years ago

TiNredmc commented 5 years ago

Hello.Im very new to the stm8 .Normally I'm mostly working on stm32 and avr_arduino .but this time I got some of stm8l151f3 mcu from chinese seller on eBay.And I have some suggession for add support for stm8l.Im also working on that too.by replace the stm8s SPL with the stm8l one .I also done some board.txt changes and patched the stm8l SPL .but It stuck on some error ,maybe about the syntaxes .So will look into them later.It would be great idea to add support for the stm8l .

tenbaht commented 5 years ago

Yes, that would be interesting. Did you notice the build script to cut the SPL files into small pieces before compiling? That is needed as a workaround to help the linker to pull only the needed functions instead of the whole library. It shouldn't be hard to adopt that for the STM8L files. I could help if you need that.

tenbaht commented 5 years ago

Oh, please re-open this issue if needed.

gicking commented 5 years ago

sorry to re-open this issue! But what is the general procedure to add support for a STM8 variant other than STM8S or STM8A. SDCC patches for all available SPLs (including respective device headers) are available, but what to do with them in sduino...?

If I can help (in my limited way) please let me know!

tenbaht commented 5 years ago

After finishing the work on the SPL splitter I started to add some STM8L related files to a new branch add-stm8l.

This is only the beginning of some basic scaffolding. It is incomplete and does not compile, but it should be a good start.

- pins_arduino.h does not exist yet
- no support for any hardware at all (not even GPIO)
- no interrupt routines at all

I don't own any STM8L hardware, so any help is highly appreciated!

@TiNredmc: Maybe that can help you with your library problem? I included a precompiled library STM8L15X_LD for low-density-devices to the repro that should work with your STM8L151F3.

TiNredmc commented 5 years ago

I use this board : https://rover.ebay.com/rover/0/0/0?mpre=https%3A%2F%2Fwww.ebay.com%2Fulk%2Fitm%2F323104121862 I also modded the pins_arduino.h

tenbaht commented 5 years ago

Interesting! That seems to be the only source for that little board. Since it is no a very common one I would opt for a generic pin mapping. Did you upload your pins_arduino.h somewhere? or could you attach it here? I would be very interested in including your additions for the 8L series.

TiNredmc commented 5 years ago

Here is it. pins_arduino.zip

Jugulaire commented 5 years ago

Can it work with this board ? https://www.ebay.com/itm/2PCS-STM8S003-DIP-20-Small-Package-development-tool-STLink/322985694957?hash=item4b337296ed:g:boAAAOSwusdaUqs7

tenbaht commented 5 years ago

I didn't check that board in detail, but the S003 is almost identical to the S103. The only difference is the EEPROM size (128 bytes vs. 640 bytes). So yes, if it works with the S103 it will work with the S003.

(I am travelling right now and won't be back to STM8 things before end of April)

  Michael

andrewsclapp commented 4 years ago

Hello Michael,

I just wanted to say that I appreciate all the work you're doing here. I have been working on a project with the STM8S103/003 chips, but we've recently decided to go after the STM8L051 as it has 12 bit ADC and more current capabilities that better suit our needs. In that light, I was able to make some progress on getting a library file built for use with SDCC using the patch here ( https://github.com/gicking/STM8-SPL_SDCC_patch ) and then using your method from here ( https://tenbaht.github.io/sduino/developer/spl/ ). I still have testing to do, but I wanted to say thank you for all your work.

-ASC