Problem compiling ChibiOS for QMK

Discussions and support about ChibiOS/RT, the free embedded RTOS.
TnF
Posts: 2
Joined: Thu May 30, 2019 10:18 am

Problem compiling ChibiOS for QMK

Postby TnF » Thu May 30, 2019 10:27 am

Hello guys. I'm new to ChibiOS and i'm trying to compile QMK for teensy 3.2 under Ubuntu with chibiOS and i'm stuck now. I believe i've installed all the required packages, and i'm using the latest versions of everything. I'm not sure 100% if the issue is with ChibiOS but figured i could ask here as well. Here is what i get:

Code: Select all

tnf@tnf-VirtualBox:~/Desktop/qmk$ Make finished with errors
make chibios_test/teensy_lc_onekey
Making chibios_test/teensy_lc_onekey with keymap default

arm-none-eabi-gcc (15:6.3.1+svn253039-1build1) 6.3.1 20170620
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiling: keyboards/chibios_test/teensy_lc_onekey/matrix.c                                        In file included from ./lib/chibios/os/rt/include/ch.h:91:0,
                 from keyboards/chibios_test/teensy_lc_onekey/matrix.c:18:
./lib/chibios/os/rt/include/chchecks.h:48:2: error: #error "obsolete or unknown configuration file"
 #error "obsolete or unknown configuration file"
  ^~~~~
./lib/chibios/os/rt/include/chchecks.h:61:2: error: #error "CH_CFG_INTERVALS_SIZE not defined in chconf.h"
 #error "CH_CFG_INTERVALS_SIZE not defined in chconf.h"
  ^~~~~
./lib/chibios/os/rt/include/chchecks.h:65:2: error: #error "CH_CFG_TIME_TYPES_SIZE not defined in chconf.h"
 #error "CH_CFG_TIME_TYPES_SIZE not defined in chconf.h"
  ^~~~~
./lib/chibios/os/rt/include/chchecks.h:186:2: error: #error "CH_CFG_SYSTEM_INIT_HOOK not defined in chconf.h"
 #error "CH_CFG_SYSTEM_INIT_HOOK not defined in chconf.h"
  ^~~~~
./lib/chibios/os/rt/include/chchecks.h:190:2: error: #error "CH_CFG_SYSTEM_EXTRA_FIELDS not defined in chconf.h"
 #error "CH_CFG_SYSTEM_EXTRA_FIELDS not defined in chconf.h"
  ^~~~~
In file included from ./lib/chibios/os/rt/include/ch.h:108:0,
                 from keyboards/chibios_test/teensy_lc_onekey/matrix.c:18:
./lib/chibios/os/rt/include/chtime.h:87:2: error: #error "invalid CH_CFG_INTERVALS_SIZE specified, must be 16, 32 or 64"
 #error "invalid CH_CFG_INTERVALS_SIZE specified, must be 16, 32 or 64"
  ^~~~~
./lib/chibios/os/rt/include/chtime.h:91:2: error: #error "invalid CH_CFG_TIME_TYPES_SIZE specified, must be 16 or 32"
 #error "invalid CH_CFG_TIME_TYPES_SIZE specified, must be 16 or 32"
  ^~~~~
./lib/chibios/os/rt/include/chtime.h:95:2: error: #error "CH_CFG_INTERVALS_SIZE must be >= CH_CFG_ST_RESOLUTION"
 #error "CH_CFG_INTERVALS_SIZE must be >= CH_CFG_ST_RESOLUTION"
  ^~~~~
./lib/chibios/os/rt/include/chtime.h:308:15: error: unknown type name 'sysinterval_t'
 static inline sysinterval_t chTimeS2I(time_secs_t secs) {
               ^~~~~~~~~~~~~
In file included from ./lib/chibios/os/rt/include/ch.h:107:0,
                 from keyboards/chibios_test/teensy_lc_onekey/matrix.c:18:
./lib/chibios/os/rt/include/chtime.h: In function 'chTimeS2I':
./lib/chibios/os/rt/include/chtime.h:60:31: error: 'sysinterval_t' undeclared (first use in this function)
 #define TIME_MAX_INTERVAL   ((sysinterval_t)-2)
                               ^
./lib/chibios/os/rt/include/chdebug.h:130:11: note: in definition of macro 'chDbgAssert'
     if (!(c)) {                                                             \
           ^
./lib/chibios/os/rt/include/chtime.h:313:37: note: in expansion of macro 'TIME_MAX_INTERVAL'
   chDbgAssert(ticks <= (time_conv_t)TIME_MAX_INTERVAL,
                                     ^~~~~~~~~~~~~~~~~
./lib/chibios/os/rt/include/chtime.h:60:31: note: each undeclared identifier is reported only once for each function it appears in
 #define TIME_MAX_INTERVAL   ((sysinterval_t)-2)
                               ^
./lib/chibios/os/rt/include/chdebug.h:130:11: note: in definition of macro 'chDbgAssert'
     if (!(c)) {                                                             \
           ^
./lib/chibios/os/rt/include/chtime.h:313:37: note: in expansion of macro 'TIME_MAX_INTERVAL'
   chDbgAssert(ticks <= (time_conv_t)TIME_MAX_INTERVAL,
                                     ^~~~~~~~~~~~~~~~~
In file included from ./lib/chibios/os/rt/include/ch.h:108:0,
                 from keyboards/chibios_test/teensy_lc_onekey/matrix.c:18:
./lib/chibios/os/rt/include/chtime.h:316:25: error: expected ';' before 'ticks'
   return (sysinterval_t)ticks;
                         ^~~~~
./lib/chibios/os/rt/include/chtime.h: At top level:
./lib/chibios/os/rt/include/chtime.h:329:15: error: unknown type name 'sysinterval_t'
 static inline sysinterval_t chTimeMS2I(time_msecs_t msec) {
               ^~~~~~~~~~~~~
In file included from ./lib/chibios/os/rt/include/ch.h:107:0,
                 from keyboards/chibios_test/teensy_lc_onekey/matrix.c:18:
./lib/chibios/os/rt/include/chtime.h: In function 'chTimeMS2I':
./lib/chibios/os/rt/include/chtime.h:60:31: error: 'sysinterval_t' undeclared (first use in this function)
 #define TIME_MAX_INTERVAL   ((sysinterval_t)-2)
                               ^
./lib/chibios/os/rt/include/chdebug.h:130:11: note: in definition of macro 'chDbgAssert'
     if (!(c)) {                                                             \
           ^
./lib/chibios/os/rt/include/chtime.h:335:37: note: in expansion of macro 'TIME_MAX_INTERVAL'
   chDbgAssert(ticks <= (time_conv_t)TIME_MAX_INTERVAL,
                                     ^~~~~~~~~~~~~~~~~
In file included from ./lib/chibios/os/rt/include/ch.h:108:0,
                 from keyboards/chibios_test/teensy_lc_onekey/matrix.c:18:
./lib/chibios/os/rt/include/chtime.h:338:25: error: expected ';' before 'ticks'
   return (sysinterval_t)ticks;
                         ^~~~~
./lib/chibios/os/rt/include/chtime.h: At top level:
./lib/chibios/os/rt/include/chtime.h:351:15: error: unknown type name 'sysinterval_t'
 static inline sysinterval_t chTimeUS2I(time_usecs_t usec) {
               ^~~~~~~~~~~~~
In file included from ./lib/chibios/os/rt/include/ch.h:107:0,
                 from keyboards/chibios_test/teensy_lc_onekey/matrix.c:18:
./lib/chibios/os/rt/include/chtime.h: In function 'chTimeUS2I':
./lib/chibios/os/rt/include/chtime.h:60:31: error: 'sysinterval_t' undeclared (first use in this function)
 #define TIME_MAX_INTERVAL   ((sysinterval_t)-2)
                               ^
./lib/chibios/os/rt/include/chdebug.h:130:11: note: in definition of macro 'chDbgAssert'
     if (!(c)) {                                                             \
           ^
./lib/chibios/os/rt/include/chtime.h:357:37: note: in expansion of macro 'TIME_MAX_INTERVAL'
   chDbgAssert(ticks <= (time_conv_t)TIME_MAX_INTERVAL,
                                     ^~~~~~~~~~~~~~~~~
In file included from ./lib/chibios/os/rt/include/ch.h:108:0,
                 from keyboards/chibios_test/teensy_lc_onekey/matrix.c:18:
./lib/chibios/os/rt/include/chtime.h:360:25: error: expected ';' before 'ticks'
   return (sysinterval_t)ticks;
                         ^~~~~
./lib/chibios/os/rt/include/chtime.h: At top level:
./lib/chibios/os/rt/include/chtime.h:373:37: error: unknown type name 'sysinterval_t'
 static inline time_secs_t chTimeI2S(sysinterval_t interval) {
                                     ^~~~~~~~~~~~~
./lib/chibios/os/rt/include/chtime.h:396:39: error: unknown type name 'sysinterval_t'
 static inline time_msecs_t chTimeI2MS(sysinterval_t interval) {
                                       ^~~~~~~~~~~~~
./lib/chibios/os/rt/include/chtime.h:419:39: error: unknown type name 'sysinterval_t'
 static inline time_usecs_t chTimeI2US(sysinterval_t interval) {
                                       ^~~~~~~~~~~~~
./lib/chibios/os/rt/include/chtime.h:442:36: error: unknown type name 'sysinterval_t'
                                    sysinterval_t interval) {
                                    ^~~~~~~~~~~~~
./lib/chibios/os/rt/include/chtime.h:460:15: error: unknown type name 'sysinterval_t'
 static inline sysinterval_t chTimeDiffX(systime_t start, systime_t end) {
               ^~~~~~~~~~~~~
./lib/chibios/os/rt/include/chtime.h: In function 'chTimeDiffX':
./lib/chibios/os/rt/include/chtime.h:464:11: error: 'sysinterval_t' undeclared (first use in this function)
   return (sysinterval_t)((systime_t)(end - start));
           ^~~~~~~~~~~~~
In file included from ./lib/chibios/os/common/ports/ARMCMx/chcore.h:193:0,
                 from ./lib/chibios/os/rt/include/ch.h:110,
                 from keyboards/chibios_test/teensy_lc_onekey/matrix.c:18:
./lib/chibios/os/common/ports/ARMCMx/chcore_v6m.h: At top level:
./lib/chibios/os/common/ports/ARMCMx/chcore_v6m.h:132:2: error: #warning "This compiler has a know problem with Cortex-M0, see bugs: 88167, 88656." [-Werror=cpp]
 #warning "This compiler has a know problem with Cortex-M0, see bugs: 88167, 88656."
  ^~~~~~~
./lib/chibios/os/common/ports/ARMCMx/chcore_v6m.h:133:2: error: #warning "*** Use GCC version 5 or below ***" [-Werror=cpp]
 #warning "*** Use GCC version 5 or below ***"
  ^~~~~~~
In file included from ./lib/chibios/os/rt/include/ch.h:114:0,
                 from keyboards/chibios_test/teensy_lc_onekey/matrix.c:18:
./lib/chibios/os/rt/include/chschd.h:316:3: error: unknown type name 'sysinterval_t'
   sysinterval_t         delta;      /**< @brief Time delta before timeout.  */
   ^~~~~~~~~~~~~
./lib/chibios/os/rt/include/chschd.h:334:3: error: unknown type name 'sysinterval_t'
   sysinterval_t         delta;      /**< @brief Must be initialized to -1.  */
   ^~~~~~~~~~~~~
./lib/chibios/os/rt/include/chschd.h:429:3: error: expected specifier-qualifier-list before 'CH_CFG_SYSTEM_EXTRA_FIELDS'
   CH_CFG_SYSTEM_EXTRA_FIELDS
   ^~~~~~~~~~~~~~~~~~~~~~~~~~
./lib/chibios/os/rt/include/chschd.h:468:49: error: unknown type name 'sysinterval_t'
   msg_t chSchGoSleepTimeoutS(tstate_t newstate, sysinterval_t timeout);
                                                 ^~~~~~~~~~~~~
In file included from ./lib/chibios/os/rt/include/ch.h:116:0,
                 from keyboards/chibios_test/teensy_lc_onekey/matrix.c:18:
./lib/chibios/os/rt/include/chvt.h:75:41: error: unknown type name 'sysinterval_t'
   void chVTDoSetI(virtual_timer_t *vtp, sysinterval_t delay,
                                         ^~~~~~~~~~~~~
./lib/chibios/os/rt/include/chvt.h:152:15: error: unknown type name 'sysinterval_t'
 static inline sysinterval_t chVTTimeElapsedSinceX(systime_t start) {
               ^~~~~~~~~~~~~
./lib/chibios/os/rt/include/chvt.h:209:40: error: unknown type name 'sysinterval_t'
 static inline bool chVTGetTimersStateI(sysinterval_t *timep) {
                                        ^~~~~~~~~~~~~
./lib/chibios/os/rt/include/chvt.h:324:51: error: unknown type name 'sysinterval_t'
 static inline void chVTSetI(virtual_timer_t *vtp, sysinterval_t delay,
                                                   ^~~~~~~~~~~~~
./lib/chibios/os/rt/include/chvt.h:353:50: error: unknown type name 'sysinterval_t'
 static inline void chVTSet(virtual_timer_t *vtp, sysinterval_t delay,
                                                  ^~~~~~~~~~~~~
./lib/chibios/os/rt/include/chvt.h: In function 'chVTDoTickI':
./lib/chibios/os/rt/include/chvt.h:379:38: error: 'sysinterval_t' undeclared (first use in this function)
     while (ch.vtlist.next->delta == (sysinterval_t)0) {
                                      ^~~~~~~~~~~~~
./lib/chibios/os/rt/include/chvt.h:379:52: error: expected ')' before numeric constant
     while (ch.vtlist.next->delta == (sysinterval_t)0) {
                                                    ^
In file included from ./lib/chibios/os/rt/include/ch.h:117:0,
                 from keyboards/chibios_test/teensy_lc_onekey/matrix.c:18:
./lib/chibios/os/rt/include/chthreads.h: At top level:
./lib/chibios/os/rt/include/chthreads.h:246:55: error: unknown type name 'sysinterval_t'
   msg_t chThdSuspendTimeoutS(thread_reference_t *trp, sysinterval_t timeout);
                                                       ^~~~~~~~~~~~~
./lib/chibios/os/rt/include/chthreads.h:250:52: error: unknown type name 'sysinterval_t'
   msg_t chThdEnqueueTimeoutS(threads_queue_t *tqp, sysinterval_t timeout);
                                                    ^~~~~~~~~~~~~
./lib/chibios/os/rt/include/chthreads.h:253:19: error: unknown type name 'sysinterval_t'
   void chThdSleep(sysinterval_t time);
                   ^~~~~~~~~~~~~
./lib/chibios/os/rt/include/chthreads.h:378:32: error: unknown type name 'sysinterval_t'
 static inline void chThdSleepS(sysinterval_t ticks) {
                                ^~~~~~~~~~~~~
In file included from ./lib/chibios/os/rt/include/ch.h:121:0,
                 from keyboards/chibios_test/teensy_lc_onekey/matrix.c:18:
./lib/chibios/os/rt/include/chsem.h:96:43: error: unknown type name 'sysinterval_t'
   msg_t chSemWaitTimeout(semaphore_t *sp, sysinterval_t timeout);
                                           ^~~~~~~~~~~~~
./lib/chibios/os/rt/include/chsem.h:97:44: error: unknown type name 'sysinterval_t'
   msg_t chSemWaitTimeoutS(semaphore_t *sp, sysinterval_t timeout);
                                            ^~~~~~~~~~~~~
In file included from ./lib/chibios/os/rt/include/ch.h:123:0,
                 from keyboards/chibios_test/teensy_lc_onekey/matrix.c:18:
./lib/chibios/os/rt/include/chcond.h:101:53: error: unknown type name 'sysinterval_t'
   msg_t chCondWaitTimeout(condition_variable_t *cp, sysinterval_t timeout);
                                                     ^~~~~~~~~~~~~
./lib/chibios/os/rt/include/chcond.h:102:54: error: unknown type name 'sysinterval_t'
   msg_t chCondWaitTimeoutS(condition_variable_t *cp, sysinterval_t timeout);
                                                      ^~~~~~~~~~~~~
In file included from ./lib/chibios/os/rt/include/ch.h:124:0,
                 from keyboards/chibios_test/teensy_lc_onekey/matrix.c:18:
./lib/chibios/os/rt/include/chevents.h:144:55: error: unknown type name 'sysinterval_t'
   eventmask_t chEvtWaitOneTimeout(eventmask_t events, sysinterval_t timeout);
                                                       ^~~~~~~~~~~~~
./lib/chibios/os/rt/include/chevents.h:145:55: error: unknown type name 'sysinterval_t'
   eventmask_t chEvtWaitAnyTimeout(eventmask_t events, sysinterval_t timeout);
                                                       ^~~~~~~~~~~~~
./lib/chibios/os/rt/include/chevents.h:146:55: error: unknown type name 'sysinterval_t'
   eventmask_t chEvtWaitAllTimeout(eventmask_t events, sysinterval_t timeout);
                                                       ^~~~~~~~~~~~~
In file included from keyboards/chibios_test/teensy_lc_onekey/matrix.c:18:0:
./lib/chibios/os/rt/include/ch.h:128:19: fatal error: chlib.h: No such file or directory

                   ^
cc1: all warnings being treated as errors
compilation terminated.
 [ERRORS]
 |
 |
 |
tmk_core/rules.mk:369: recipe for target '.build/obj_chibios_test_teensy_lc_onekey_default/matrix.o' failed
make[1]: *** [.build/obj_chibios_test_teensy_lc_onekey_default/matrix.o] Error 1
Makefile:535: recipe for target 'chibios_test/teensy_lc_onekey' failed
make: *** [chibios_test/teensy_lc_onekey] Error 1
tnf@tnf-VirtualBox:~/Desktop/qmk$ Make finished with errors



Any ideas where is the problem? Kind regards

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

Re: Problem compiling ChibiOS for QMK

Postby Giovanni » Thu May 30, 2019 10:54 am

Hi,

Apparently you are using a newer ChibiOS with an old chconf.h file, there is a version check failing, see that "obsolete or unknown configuration file", the other errors are a consequence.

The question is, how ChibiOS got updated in that project? is it intentional? you could have other problems because of this.

Giovanni

TnF
Posts: 2
Joined: Thu May 30, 2019 10:18 am

Re: Problem compiling ChibiOS for QMK

Postby TnF » Thu May 30, 2019 1:01 pm

You are apparently right because (after removing gcc-arm-none-eabi, binutils-arm-none-eabi, and gcc-avr and installing gcc-arm-embedded from PPA) i managed to get ChibiOS 17.6.4 to compile successfully for stm32_f072. Then i've tried to compile for the teensy 3.2 but it seems this is an old enough version of ChibiOS that it doesn't work. It looks for hal_lld.h and if i include the K20x from the latest build (of which i assume is the correct one for MK20DX256VLH7) it then wants kinetis_registry.h and i haven't gone down this route. For now i should find a version higher that has support for it but still compiles i guess? 18.2.1 doesn't work.

mikeprotts
Posts: 42
Joined: Wed Jan 09, 2019 12:37 pm
Has thanked: 4 times
Been thanked: 7 times

Re: Problem compiling ChibiOS for QMK

Postby mikeprotts » Fri May 31, 2019 12:44 pm

My suggestion would be to get the build environment set up for whichever version of ChibiOS was used last time (probably ChibiOS 3 - https://sourceforge.net/projects/chibio ... n%203.0.5/) and make sure that builds cleanly.

Then you can try with the current ChibiOS using a new copy of chconf.h (taken from a current ChibiOS demo/test directory) and reapply changes from your old chconf.h.

Mike


Return to “ChibiOS/RT”

Who is online

Users browsing this forum: No registered users and 1 guest