Page 1 of 1
STM32F103C8T6 support
Posted: Mon Nov 21, 2016 2:38 am
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???
Re: STM32F103C8T6 support
Posted: Mon Nov 21, 2016 9:57 am
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.
Re: STM32F103C8T6 support
Posted: Mon Nov 21, 2016 9:59 am
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_guideYou 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

Re: STM32F103C8T6 support
Posted: Mon Nov 21, 2016 10:08 am
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
Re: STM32F103C8T6 support
Posted: Mon Nov 21, 2016 1:06 pm
by InvalidException
FInally
got blink working on BluePill
if someone want to play here is code
https://github.com/InvalidExcepti0n/BluePill-ChibiOSHope will help someone and thx for tips
Re: STM32F103C8T6 support
Posted: Tue Nov 22, 2016 12:17 am
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_Pillnow on issue
Delays are wrong, so maybe could someone guide me trough my config
https://github.com/InvalidExcepti0n/Blu ... /mcuconf.hI'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;
}
Re: STM32F103C8T6 support
Posted: Tue Nov 22, 2016 12:38 am
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.
Re: STM32F103C8T6 support
Posted: Tue Nov 22, 2016 1:10 am
by tfAteba
You can take a look to this topic:
viewtopic.php?f=16&t=3027I 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

Re: STM32F103C8T6 support
Posted: Tue Nov 22, 2016 1:58 am
by InvalidException
thx for reply
Agree that is not related so will open new topic