migrating from v2 to v3

Discussions and support about ChibiOS/RT, the free embedded RTOS.
User avatar
Giovanni
Site Admin
Posts: 11386
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 430 times
Been thanked: 363 times
Contact:

Re: migrating from v2 to v3

Postby Giovanni » Mon Nov 26, 2018 9:12 pm

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

Postby ralph » Wed Nov 28, 2018 5:33 pm

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

Postby ralph » Wed Nov 28, 2018 5:34 pm

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: 558
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 4 times
Been thanked: 61 times

Re: migrating from v2 to v3

Postby steved » Wed Nov 28, 2018 6:36 pm

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

Postby ralph » Thu Nov 29, 2018 7:46 pm

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

Postby ralph » Thu Nov 29, 2018 8:14 pm

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

Re: migrating from v2 to v3

Postby Giovanni » Thu Nov 29, 2018 10:16 pm

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

Postby ralph » Thu Nov 29, 2018 10:28 pm

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: 558
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 4 times
Been thanked: 61 times

Re: migrating from v2 to v3

Postby steved » Thu Nov 29, 2018 11:55 pm

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

Postby ralph » Fri Nov 30, 2018 2:48 pm

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.


Return to “ChibiOS/RT”

Who is online

Users browsing this forum: No registered users and 1 guest