STM32F103C8T6 support

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
User avatar
InvalidException
Posts: 13
Joined: Tue Nov 15, 2016 2:33 pm
Been thanked: 3 times

STM32F103C8T6 support

Post by InvalidException »

Hi all

as I have seen in "ChibiOS/os/ext/CMSIS/ST/STM32F1xx/" there is no stm32f103x8.h or support for this CPU

I tried compile custom board but getting errors (a lot of it) so my question is will ChibiOS support it in future?
How do I make some changes to support it (for now until official support?
Any guideline, tip, link info would me good..

P.S.
Is possible to make BluePill board to be supported officially???
User avatar
RoccoMarco
Posts: 655
Joined: Wed Apr 24, 2013 4:11 pm
Has thanked: 83 times
Been thanked: 67 times

Re: STM32F103C8T6 support

Post by RoccoMarco »

Hi,
you should use the header file stm32f103xb.h.

Here a line from CMSIS/stm32f1xx.h

Code: Select all

  /* #define STM32F103xB  */   /*!< STM32F103C8, STM32F103R8, STM32F103T8, STM32F103V8, STM32F103CB, STM32F103RB, STM32F103TB and STM32F103VB */


There are a lot of board based on STM32F103, usually we don't add support for all of them. Is not about adding support but about maintain it.

Edit: why blue pill? STM32 Nucleo-32 boards are similar and they have on-board st-link.
User avatar
tfAteba
Posts: 551
Joined: Fri Oct 16, 2015 11:03 pm
Has thanked: 91 times
Been thanked: 50 times

Re: STM32F103C8T6 support

Post by tfAteba »

Hi,

If there is not a support for your CPU, you can make a port by following ChibiOS Porting Guide.
Here is the link: http://wiki.chibios.org/dokuwiki/doku.p ... port_guide
You can follow the existing port from an existing or close CPU to yours to make you port.

For your other question sorry I don't have the answer ;)
User avatar
InvalidException
Posts: 13
Joined: Tue Nov 15, 2016 2:33 pm
Been thanked: 3 times

Re: STM32F103C8T6 support

Post by InvalidException »

Thx for reply

managed to get 1st issue (Was on 3.x branch instead of 16.x)
Switched and now and got STM32F103C8_MINIMAL board that is almost same as BluePill so will try using it

Going to try, will post result later on
User avatar
InvalidException
Posts: 13
Joined: Tue Nov 15, 2016 2:33 pm
Been thanked: 3 times

Re: STM32F103C8T6 support

Post by InvalidException »

FInally

got blink working on BluePill
if someone want to play here is code
https://github.com/InvalidExcepti0n/BluePill-ChibiOS

Hope will help someone and thx for tips
User avatar
InvalidException
Posts: 13
Joined: Tue Nov 15, 2016 2:33 pm
Been thanked: 3 times

Re: STM32F103C8T6 support

Post by InvalidException »

I think someone have already issues with timers, so I'm asking for this specific STM32F103C8T6
Here is little bit more about board
http://wiki.stm32duino.com/index.php?title=Blue_Pill

now on issue

Delays are wrong, so maybe could someone guide me trough my config
https://github.com/InvalidExcepti0n/Blu ... /mcuconf.h

I'm getting wrong delays (for any microseconds)

Here is my chSysPolledDelayX(US2RTC(8000000, 1)); and I get 0.25us (positive) and 0.3125 (negative) pulse
For chSysPolledDelayX(US2RTC(8000000, 1*8)); I get right 1.062us positive and 1.165 negative pulse

Don't know if I'm doing something wrong? or my Clocks are configured wrong :(

But all is working for ms (from 1ms to seconds) and that part confuses me
for ms I'm using chThdSleepMilliseconds(1000);

Anyone have/had same issues? Any advice???

my code:

Code: Select all

void delau_us(int us) {
chSysPolledDelayX(US2RTC(8000000, 8*us)); //8 for test
}

int main(void) {
halInit();
chSysInit();

while(1) {
palSetPad(GPIOC, GPIOC_LED);
delau_us(1);
palClearPad(GPIOC, GPIOC_LED);
delau_us(1);
}
 return 0;
}
User avatar
tfAteba
Posts: 551
Joined: Fri Oct 16, 2015 11:03 pm
Has thanked: 91 times
Been thanked: 50 times

Re: STM32F103C8T6 support

Post by tfAteba »

Hi,

Some time ago, I played with delays, and for what I remember, you can configure the system tick by using chconf.h file. That will help you to have more resolution while using delay.

So you have to adjust CH_CFG_ST_FREQUENCY according your needs.
User avatar
tfAteba
Posts: 551
Joined: Fri Oct 16, 2015 11:03 pm
Has thanked: 91 times
Been thanked: 50 times

Re: STM32F103C8T6 support

Post by tfAteba »

You can take a look to this topic: viewtopic.php?f=16&t=3027

I also notice that this problem is not related to you first post subject. So please for next time open another topic for all your different problem :)
User avatar
InvalidException
Posts: 13
Joined: Tue Nov 15, 2016 2:33 pm
Been thanked: 3 times

Re: STM32F103C8T6 support

Post by InvalidException »

thx for reply

Agree that is not related so will open new topic
Post Reply