STM32F030F4

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

Moderator: RoccoMarco

etrombly
Posts: 10
Joined: Tue Jul 14, 2015 9:26 pm

Re: STM32F030F4

Post by etrombly »

It works with gcc 4.7.4, thanks for all the help getting this working.
mesutevin
Posts: 3
Joined: Fri Aug 26, 2016 2:06 pm

Re: STM32F030F4

Post by mesutevin »

Hi everyone and Eddie,

I tried your tested code, but I can not run it. When the code was compiling, I got following error:

Code: Select all

Compiling chcoreasm_v7m.S
/home/mesut/ChibiOS/os/common/ports/ARMCMx/compilers/GCC/chcoreasm_v7m.S:51:2: error: #error "invalid chconf.h"
 #error "invalid chconf.h"


When I added the this line (#define _CHIBIOS_RT_CONF_) in chconf.h, the problem was solved, but another error is triggered.

Code: Select all


Compiling chsys.c
In file included from /home/mesut/ChibiOS/os/rt/include/ch.h:83:0,
                 from /home/mesut/ChibiOS/os/rt/src/chsys.c:36:
/home/mesut/ChibiOS/os/rt/include/chtrace.h:93:2: error: #error "CH_CFG_TRACE_HOOK not defined in chconf.h"
 #error "CH_CFG_TRACE_HOOK not defined in chconf.h"
  ^
In file included from /home/mesut/ChibiOS/os/rt/include/ch.h:87:0,
                 from /home/mesut/ChibiOS/os/rt/src/chsys.c:36:
/home/mesut/ChibiOS/os/rt/include/chsys.h:56:2: error: #error "CH_CFG_IRQ_PROLOGUE_HOOK not defined in chconf.h"
 #error "CH_CFG_IRQ_PROLOGUE_HOOK not defined in chconf.h"
  ^
/home/mesut/ChibiOS/os/rt/include/chsys.h:60:2: error: #error "CH_CFG_IRQ_EPILOGUE_HOOK not defined in chconf.h"
 #error "CH_CFG_IRQ_EPILOGUE_HOOK not defined in chconf.h"
  ^
/home/mesut/ChibiOS/os/common/startup/ARMCMx/compilers/GCC/rules.mk:217: recipe for target 'build/obj/chsys.o' failed
make: *** [build/obj/chsys.o] Error 1



I cloned the latest ChibiOS from github. I think the chconf.h is old for latest version of ChibiOS.

How can I solve this problem?
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32F030F4

Post by Giovanni »

Hi,

You are mixing incompatible chconf.h and kernel versions. Make sure to use a chconf.h from your kernel version.

The unofficial code on the community repository is not necessarily maintained and kept aligned by authors.

Giovanni
mesutevin
Posts: 3
Joined: Fri Aug 26, 2016 2:06 pm

Re: STM32F030F4

Post by mesutevin »

Thank you for your fast response. This kind of fast replies makes us feel safe :)

Yes, I thought so, too.
I added the following blocks in the chconf.h:

Code: Select all


#define CH_CFG_IRQ_PROLOGUE_HOOK() {                                        \
/* IRQ prologue code here.*/                                              \
}

/**
* @brief   ISR exit hook.
*/
#define CH_CFG_IRQ_EPILOGUE_HOOK() {                                        \
/* IRQ epilogue code here.*/                                              \
}

#define CH_CFG_TRACE_HOOK(tep) {                                            \
  /* Trace code here.*/                                                     \
}



And,
According to new file organization on new ChibiOS, I edited the Makefile.
Now, This is working for me.

I inserted the my working code to attachment.

Will you warn me if I have made a big mistake?
Attachments
STM32F030F4-ChibiOS-test.zip
(18.57 KiB) Downloaded 455 times
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32F030F4

Post by Giovanni »

Hi,

If you run with debug options enabled and nothing is caught then errors are not likely.

Giovanni
Xela
Posts: 15
Joined: Thu Sep 07, 2017 12:05 pm
Has thanked: 3 times

Re: STM32F030F4

Post by Xela »

I have this same issue with chThdSleepMilliseconds not returning, it is stuck in waiting for interrupt.

I have installed:

gcc version 5.4.0
gcc version 5.4.0
arm-none-eabi-gcc-4.9.3

Which is the recommended solution here? roll back gcc and g++ to 4.7 or replace arm-none-eabi with gcc-arm-embedded or both?

I was just about to roll back my gcc and g++ versions until I read the comment about gcc-arm-embedded... not quite sure how that fits in?

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

Re: STM32F030F4

Post by Giovanni »

Hi,

chThdSleepMilliseconds() not returning could mean system tick interrupt is not triggered or the system crashed, you don't give enough context to tell.

Giovanni
Xela
Posts: 15
Joined: Thu Sep 07, 2017 12:05 pm
Has thanked: 3 times

Re: STM32F030F4

Post by Xela »

The combination of compilers works just fine:

gcc version 5.4.0
gcc version 5.4.0
arm-none-eabi-gcc-4.9.3

I was just using my debugger incorrectly :lol:

Alex
Post Reply