STM32F030F4

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

Moderators: barthess, RoccoMarco

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

Re: STM32F030F4

Postby etrombly » Fri Jul 17, 2015 4:30 pm

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

Postby mesutevin » Fri Aug 26, 2016 2:22 pm

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: 13121
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 769 times
Been thanked: 653 times
Contact:

Re: STM32F030F4

Postby Giovanni » Fri Aug 26, 2016 2:29 pm

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

Postby mesutevin » Fri Aug 26, 2016 4:31 pm

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 62 times

User avatar
Giovanni
Site Admin
Posts: 13121
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 769 times
Been thanked: 653 times
Contact:

Re: STM32F030F4

Postby Giovanni » Fri Aug 26, 2016 5:27 pm

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

Postby Xela » Fri Oct 13, 2017 3:55 pm

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: 13121
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 769 times
Been thanked: 653 times
Contact:

Re: STM32F030F4

Postby Giovanni » Fri Oct 13, 2017 6:18 pm

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

Postby Xela » Wed Oct 18, 2017 11:33 am

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


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 7 guests