STM8 support dropped?

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
Gamadril
Posts: 3
Joined: Wed Jan 29, 2014 9:31 am

STM8 support dropped?

Post by Gamadril »

Hello,
It seems that the latest ChibiOS/RT version does not support STM8 any more. Which was the latest release still supporting that platform? I want to try get it compiled with SDCC (Small Device C Compiler)...

regards
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM8 support dropped?

Post by Giovanni »

Hi,

The STM8 support is present in 2.4.x and is still present in 2.6.x but untested.

The problem are the compilers:
1) Raisonance: works but the generated code could be better.
2) Cosmic: has bugs preventing the test suite execution completion.
3) IAR: limited to 8k does not allow testing.

When the STM8 support will be released officially in SDCC probably I will give it another try, probably I would also drop all the other compilers. You may definitely try a port for SDCC, it should not be difficult.

Giovanni
Gamadril
Posts: 3
Joined: Wed Jan 29, 2014 9:31 am

Re: STM8 support dropped?

Post by Gamadril »

Thanks Giovanni,

I did a quick test with the current SDCC snapshot (SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8 3.3.2 #8938 (Jan 28 2014) (Mac OS X i386)), but it seems it does not like empty structs:

Code: Select all

ChibiOS_2.4.5/os/kernel/templates/chcore.h:123: syntax error: token -> '}' ; column 1

Are they there for doxygen?

and some macros:

Code: Select all

ChibiOS_2.4.5/os/kernel/include/ch.h:110: error 176: sizeof applied to an incomplete type
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM8 support dropped?

Post by Giovanni »

Hi,

The empty struct are only in template files, you are not supposed to compile templates. See how the other 3 STM8 ports are placed under "ports" and create a 4th port under ./ports/SDCC/STM8

Giovanni
Gamadril
Posts: 3
Joined: Wed Jan 29, 2014 9:31 am

Re: STM8 support dropped?

Post by Gamadril »

Thanks for pointing to the right direction. I created a new port. However I'm not sure what are equivalents in SDCC for far/near/tiny/const...

Other problem I found trying to compile the STM8S discovery demo from ChibiOS:

Code: Select all

ChibiOS_2.4.5/test/test.h:80: error 195: Size of array 'T0' is negative

Seems it's the STACK_ALIGN macro. It makes the passed value negative (0x00A1 -> 0xFFA1)
SDCC bug?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM8 support dropped?

Post by Giovanni »

Can't tell, I should look at the code. It could also be an error in the macro.

Giovanni
User avatar
aGuegu
Posts: 29
Joined: Thu Dec 07, 2017 4:15 am
Has thanked: 1 time
Been thanked: 5 times

Re: STM8 support dropped?

Post by aGuegu »

Is now a good timing to reconsider stm8 support?

Now SDCC, like 3.6.0, supports stm8 quite well. The community has developed a patch on STM standard Periph Libs.

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

I personally have tried the patched lib with SDCC on several typical boards, and I will keep doing it. https://github.com/aguegu/stm8demos

And check this out:

http://www.colecovision.eu/stm8/compilers.shtml
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM8 support dropped?

Post by Giovanni »

Hi,

Support has been dropped after 2.6 because lack of interest/feedback and, mainly, me being tired to deal with bad proprietary toolchains.

What about debugging and ST-Link support? the compiler is just one of the required element. Porting the code from 2.6 should be easy.

Giovanni
User avatar
aGuegu
Posts: 29
Joined: Thu Dec 07, 2017 4:15 am
Has thanked: 1 time
Been thanked: 5 times

Re: STM8 support dropped?

Post by aGuegu »

Both ST-Link v1/v2 works fine with stm8flash.

I do not know how to debug on stm8, stm32 also, with GDB. All I got is one or two blinking led and serial output, and building my projects little step by step.

I know it is a lot of work. And I understand why you drop support.

There is another rtos called Atomthreads, http://atomthreads.com/, claims it supports stm8. But at the first glance, it is lack of the HAL layer. I may try that first as long as I got enough understanding about the chip.
Post Reply