Page 1 of 1

emblock STM32F1 skeleton

Posted: Sat Feb 28, 2015 7:39 pm
by fastlink30
I'm trying to make skeleton on emBlocks for chibios, but i'm stuck on this error:
....
.\ext\ChibiOS\boards\RLABS_OVENSTM32F1\board.h|39|warning: "STM32F10X_MD" redefined [enabled by default]|
:0|0|note: this is the location of the previous definition|
obj\debug\ext\chibios\os\hal\platforms\stm32\usartv1\serial_lld.o||In function `VectorD8':|
C:\EmBlocks\OVEN_STM32F1\ext\ChibiOS\os\hal\platforms\STM32\USARTv1\serial_lld.c:289||undefined reference to `_port_irq_epilogue'|
obj\debug\ext\chibios\os\kernel\src\chschd.o||In function `chSchGoSleepS':|
C:\EmBlocks\OVEN_STM32F1\ext\ChibiOS\os\kernel\src\chschd.c:128||undefined reference to `_port_switch'|
obj\debug\ext\chibios\os\kernel\src\chschd.o||In function `chSchWakeupS':|
C:\EmBlocks\OVEN_STM32F1\ext\ChibiOS\os\kernel\src\chschd.c:240||undefined reference to `_port_switch'|
obj\debug\ext\chibios\os\kernel\src\chsys.o||In function `chSysInit':|
C:\EmBlocks\OVEN_STM32F1\ext\ChibiOS\os\kernel\src\chsys.c:90||undefined reference to `_port_init'|
obj\debug\ext\chibios\os\kernel\src\chthreads.o||In function `chThdCreateI':|
C:\EmBlocks\OVEN_STM32F1\ext\ChibiOS\os\kernel\src\chthreads.c:167||undefined reference to `_port_thread_start'|
C:\EmBlocks\OVEN_STM32F1\ext\ChibiOS\os\kernel\src\chthreads.c:167||undefined reference to `_port_thread_start'|
||=== Build finished: 6 errors, 42 warnings (0 minutes, 15 seconds) ===|

first: i get warning "STM32F10X_MD" redefined, but i set it on board.h , as i see in other board.h files, so why this warning?
second: i get error on VectorD8, probably i not include some files, or removed some necessary, i must include USARTv1 or USARTv2? (what is the difference?), i've included USARTv1
third: is correct to use the linker script ChibiOS/os/ports/GCC/ARMCMx/STM32F1xx/ld/STM32F103xB.ld for STM32F103C8? (i use this micro)

thanks

Re: emblock STM32F1 skeleton

Posted: Sat Feb 28, 2015 8:09 pm
by Giovanni
Hi,

The linker script is not correct "B" devices have different memory sizes than "8" devices. Make a copy of the file naming it as STM32F103x8.ld then edit to adjust RAM and Flash sizes.

I don't know about the other problems, it is something in the project setup.

Giovanni

Re: emblock STM32F1 skeleton

Posted: Sat Feb 28, 2015 9:19 pm
by fastlink30
ok, problem solved, need also file chcore_v7m.c/.h , now can compile
i made also STM32F103x8.ld.

:)

thanks

Re: emblock STM32F1 skeleton

Posted: Sun Mar 01, 2015 5:33 pm
by fastlink30
i not know, maybe is a bug, i have this error:

Compiling: ext\ChibiOS\os\hal\platforms\STM32F1xx\adc_lld.c
Compiling: ext\ChibiOS\os\hal\platforms\STM32F1xx\ext_lld_isr.c
Compiling: ext\ChibiOS\os\hal\platforms\STM32F1xx\hal_lld.c
ext\ChibiOS\os\hal\platforms\STM32F1xx\ext_lld_isr.c: In function 'ext_lld_exti_irq_enable':
ext\ChibiOS\os\hal\platforms\STM32F1xx\ext_lld_isr.c:289:20: error: 'RTC_Alarm_IRQn' undeclared (first use in this function)
ext\ChibiOS\os\hal\platforms\STM32F1xx\ext_lld_isr.c:289:20: note: each undeclared identifier is reported only once for each function it appears in
ext\ChibiOS\os\hal\platforms\STM32F1xx\ext_lld_isr.c:302:20: error: 'USB_FS_WKUP_IRQn' undeclared (first use in this function)
ext\ChibiOS\os\hal\platforms\STM32F1xx\ext_lld_isr.c: In function 'ext_lld_exti_irq_disable':
ext\ChibiOS\os\hal\platforms\STM32F1xx\ext_lld_isr.c:322:21: error: 'RTC_Alarm_IRQn' undeclared (first use in this function)
ext\ChibiOS\os\hal\platforms\STM32F1xx\ext_lld_isr.c:332:21: error: 'USB_FS_WKUP_IRQn' undeclared (first use in this function)

i not understand why, i think that i have included all the files
the stm32f10x.h is present, maybe some conditional include make problem...
(i have #define STM32F10X_MD in board.h)

Re: emblock STM32F1 skeleton

Posted: Sun Mar 01, 2015 6:07 pm
by Giovanni
Probably you are using a different stm32f10x.h, not the one provided with ChibiOS.

Giovanni