Page 1 of 1

Issue compiling ChibiOS/testhal/STM32/STM32F0xx/USB_CDC

Posted: Fri Feb 15, 2019 5:21 pm
by charlesrwest
Hello.

I'm having some issues compiling my project which I've been trying to hunt down. Much to my surprise, I am getting the same issue when I try to compile the HAL test programs:

../../../../os/various/shell/shell_cmd.c: In function 'cmd_test':
../../../../os/various/shell/shell_cmd.c:182:8: warning: implicit declaration of function 'chThdCreateFromHeap' [-Wimplicit-function-declaration]
tp = chThdCreateFromHeap(NULL, SHELL_CMD_TEST_WA_SIZE,
^~~~~~~~~~~~~~~~~~~
../../../../os/various/shell/shell_cmd.c:182:6: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
tp = chThdCreateFromHeap(NULL, SHELL_CMD_TEST_WA_SIZE,
^
main.c: In function 'main':
main.c:153:27: warning: implicit declaration of function 'chThdCreateFromHeap' [-Wimplicit-function-declaration]
thread_t *shelltp = chThdCreateFromHeap(NULL, SHELL_WA_SIZE,
^~~~~~~~~~~~~~~~~~~
main.c:153:27: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
Linking build/ch.elf
/tmp/cc5triM9.ltrans0.ltrans.o: In function `cmd_test':
/home/charlesrwest/cpp/libraries/ChibiOS/testhal/STM32/STM32F0xx/USB_CDC/../../../../os/various/shell/shell_cmd.c:182: undefined reference to `chThdCreateFromHeap'
/tmp/cc5triM9.ltrans3.ltrans.o: In function `main':
/home/charlesrwest/cpp/libraries/ChibiOS/testhal/STM32/STM32F0xx/USB_CDC/main.c:153: undefined reference to `chThdCreateFromHeap'
collect2: error: ld returned 1 exit status
../../../../os/common/startup/ARMCMx/compilers/GCC/rules.mk:249: recipe for target 'build/ch.elf' failed
make: *** [build/ch.elf] Error 1


As far as I can tell, the demo's chconf.h has the "#define CH_CFG_USE_HEAP TRUE" line which should resolve this issue.

If I may ask, is anyone else having this problem?

P.S.
using https://sourceforge.net/projects/chibio ... Exception/ (ChibiOS_17.6.3_exception.7z) freshly downloaded this morning.

Re: Issue compiling ChibiOS/testhal/STM32/STM32F0xx/USB_CDC

Posted: Fri Feb 15, 2019 6:29 pm
by Giovanni
Hi,

The version with exception does not have dynamic threading, this is why you are getting that error, the option is reset to FALSE after the license check.

You could modify the demo to start the shell thread in static mode or download the GPL version for evaluation.

Giovanni

Re: Issue compiling ChibiOS/testhal/STM32/STM32F0xx/USB_CDC

Posted: Fri Feb 15, 2019 8:52 pm
by charlesrwest
Thank you. I am currently trying to get USB to work. Am I likely to run into other issues related to licensing with that? Also, are there any examples that can do USB read/write while using the exception version?

Thanks again,
Charlie West

Re: Issue compiling ChibiOS/testhal/STM32/STM32F0xx/USB_CDC

Posted: Fri Feb 15, 2019 9:51 pm
by Giovanni
Hi,

HAL is not affected by licensing problems, it is under Apache license and entirely free beer.

You need just to replace chThdCreateFromHeap() with chThdCreateStatic(), look at the blinker thread in the main(), you have an example right there.

Note that if GPL is not usable for you then you may ask for a free commercial license, have you evaluated that option?

Giovanni