Crossworks & ChibiOS
Hi,
I am trying to run Chibios on STM32F104RB. I made project containing chibios. It compiles well except for cmemcore.c I modified it more or less like Michael Fisher changing __heap_base__ to __heap_start__ to meet crossworks linker script standards. I also modified Crossworks vector files to meet Chibios naming convention. Compilation goes fine (only warrnings chthreads.h:171: warning: declaration does not declare anything, and redefining STM32_SYSCLK ), running uc not. After some time it hangs calling HardFaultException.
My main function looks like:
int main(int argc, char **argv) {
hwinit0();
hwinit1();
while (TRUE) {
palClearPad(IOPORT2, GPIOC_LED);
chThdSleepMilliseconds(500);
palSetPad(IOPORT2, GPIOC_LED);
chThdSleepMilliseconds(500);
}
return 0;
}
chThdSleepMilliseconds(500); causes hardfault.
I have uploaded project to http://tinyurl.com/34ktqp9 it should run on olimex board ony difference is I use ioport2 instead of 3 to blink led.
Any ideas what am I doing wrong?
Thomas
Edit:
BTW how to use custom linker scripts in crosstudio?
-
Problem solved by creating Generic STM32 Project (not STM32F10X it is missing some options so u cannot set procces stack). Also u need to add USE_PROCESS_STACK;INITIALIZE_STACK in preprocessor options (taken from yagarto rtos benchmark project) and modify chmemcore to use __heap_start__ instead of __heap_base__.
I have uploaded template project in case someone needs it (although it uses modified startup file from Generic STM32F103x project to lazy now to modify Generic STM32 startup file). Hal should work fine if I didn’t make any mistake.
Template: http://tinyurl.com/3xfon9a
Regards Thomas
-
Lipin, your projct dowes not compile "out-of-the-box". WHen I try to build, I get:
/usr/share/crossworks_for_arm_2.3/gcc/arm-unknown-elf/bin/ld: cannot find /home/acourt/.rowley_associates_limited/CrossWorks for ARM/packages/targets/STM32/lib/libcmsis_v7m_t_le.a: No such file or directory
-
That is an old old post. I do not use Rowley and I am even not on cortex m3 anymore. I guess many things changed since then.
You may look at post https://rowley.zendesk.com/entries/421541--Solved-Build-failed-but-No-errors-reported it seems like it is the same issue with solution.
Basing on zip filename it was hobby induction motor inverter project that ended up using freertos in later phases therefore I cannot guarantee quality of previously attached code and to be honest I can barely recall it.
Greetings
Please sign in to leave a comment.
Comments
4 comments