migrating from v2 to v3

Discussions and support about ChibiOS/RT, the free embedded RTOS.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: migrating from v2 to v3

Post by Giovanni »

Hi,

The wrapper received updates but not all the changes were accepted and committed, right now is an hybrid between the old and new ones.

It is possible something is missing causing that error but I am not sure what exactly.

Giovanni
ralph
Posts: 12
Joined: Tue Nov 13, 2018 4:41 pm

Re: migrating from v2 to v3

Post by ralph »

To fix this I added explicit library includes to the compile options:

Code: Select all

-lgcc -lc -lrdimon  -lstdc++
ralph
Posts: 12
Joined: Tue Nov 13, 2018 4:41 pm

Re: migrating from v2 to v3

Post by ralph »

I'm getting close, but now it is not finding main. Main is defined in main.cpp:

Code: Select all

build/obj/crt0_v7m.o: In function `endinitloop':
/home/ralph/hebi-firmware/ext/ChibiOS_18.2.1/os/common/startup/ARMCMx/compilers/GCC/crt0_v7m.S:330: undefined reference to `main'
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Re: migrating from v2 to v3

Post by steved »

In the makefile, have you deleted main.c from the list of C files, and added main.cpp to the list of C++ files?
(And sometimes a clean helps after such changes)
ralph
Posts: 12
Joined: Tue Nov 13, 2018 4:41 pm

Re: migrating from v2 to v3

Post by ralph »

Somehow the old makefile was picking up main.cpp but the new one was not. Adding main.cpp to the source list fixed that.

Getting close, now just a few link error related to Chibios:

Code: Select all

build/obj/lwipthread.o: In function `lwip_thread':
/ChibiOS_18.2.1/os/various/lwip_bindings/lwipthread.c:351: undefined reference to `evtObjectInit'
/ChibiOS_18.2.1/os/various/lwip_bindings/lwipthread.c:352: undefined reference to `evtStart'
build/obj/sys_arch.o: In function `sys_thread_new':
/ChibiOS_18.2.1/os/various/lwip_bindings/arch/sys_arch.c:213: undefined reference to `chThdCreateFromHeap'


Probably missing an include file or something simple like that, but I did start with the demo Makefile and it was building, so I am not sure what is going on. Maybe a setting in halconf.h is still wrong so the files are not getting selected?

Suggestions welcome of course.

Thanks.
ralph
Posts: 12
Joined: Tue Nov 13, 2018 4:41 pm

Re: migrating from v2 to v3

Post by ralph »

This is curious:
evtimer.c is listed in the makefile:

Code: Select all

CHIBI_CSRC = $(STARTUPSRC) \
             $(KERNSRC) \
             $(PORTSRC) \
             $(OSALSRC) \
             $(HALSRC) \
             $(PLATFORMSRC) \
             $(LWSRC) \
             $(CHIBIOS)/os/various/evtimer.c \
             $(CHIBIOS)/os/various/syscalls.c \
             $(BOARDSRC) \
             $(TESTSRC) \
   


and I verified it is there.

I checked the variable in remake, and it there, so it should compile evtimer.c, However, it does not, evtimer.o is not in the object directory

I also found a warning earlier in the process:

Code: Select all

/home/ralph/hebi-firmware/ext/ChibiOS_18.2.1/os/various/shell/shell_cmd.c: In function 'cmd_test':
/home/ralph/hebi-firmware/ext/ChibiOS_18.2.1/os/various/shell/shell_cmd.c:204:8: warning: implicit declaration of function 'chThdCreateFromHeap' [-Wimplicit-function-declaration]
   tp = chThdCreateFromHeap(NULL, SHELL_CMD_TEST_WA_SIZE,
        ^
/home/ralph/hebi-firmware/ext/ChibiOS_18.2.1/os/various/shell/shell_cmd.c:204:6: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
   tp = chThdCreateFromHeap(NULL, SHELL_CMD_TEST_WA_SIZE,
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: migrating from v2 to v3

Post by Giovanni »

I think you need to enable dynamic threads in your chconf.h.

Giovanni
ralph
Posts: 12
Joined: Tue Nov 13, 2018 4:41 pm

Re: migrating from v2 to v3

Post by ralph »

Thanks, I did not have that enabled and enabling it fixed the thread issue.

Any thoughts on the lwip issues:

Code: Select all

ChibiOS_18.2.1/os/various/lwip_bindings/lwipthread.c:351: undefined reference to `evtObjectInit'
ChibiOS_18.2.1/os/various/lwip_bindings/lwipthread.c:352: undefined reference to `evtStart'
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

Re: migrating from v2 to v3

Post by steved »

Seem to remember something like that was due to a subtle problem in the makefile; can't remember exactly what, but perhaps a space character after the '\' at the end of a line, or something like that.
ralph
Posts: 12
Joined: Tue Nov 13, 2018 4:41 pm

Re: migrating from v2 to v3

Post by ralph »

Thanks, checked for stray spaces but did not find anything amiss.

The evtimer.c file is in the list but is not getting built. I worked around the issue by adding the file to the board list, and it builds now.
Post Reply