vectorgrp / XCPlite

Simple implementation of the ASAM XCP on Ethernet protocol
MIT License
171 stars 93 forks source link

Compile xcpLite under Ubuntu #10

Closed ayoubziat closed 2 years ago

ayoubziat commented 2 years ago

Hello,

I tried to compile the CMake project, but got several errors. Could you please fix this?

I will attach later on the errors.

Thanks

frederich commented 2 years ago

Which errors occurred, details please?

ayoubziat commented 2 years ago

Hi, sorry for my late reply.

Following errors occur when compiling the cmake project under Ubuntu /WSL.

~/xcpTl.c:421:46: error: invalid conversion from ‘char*’ to ‘uint8_t*’ {aka ‘unsigned char*’} [-fpermissive]
  421 |         n = socketRecv(gXcpTl.MulticastSock, (char*) buffer, (uint16_t)sizeof(buffer));
/usr/bin/ld: CMakeFiles/xcpLite.dir/xcpLite.c.o: in function `XcpCommand':
~/xcpLite.c:1116: undefined reference to `XcpTlSetClusterId'
/usr/bin/ld: CMakeFiles/xcpLite.dir/xcpLite.c.o: in function `XcpInit':
~/xcpLite.c:1349: undefined reference to `XcpTlSetClusterId'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/xcpLite.dir/build.make:219: xcpLite] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/xcpLite.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

Thank you!

frederich commented 2 years ago

Hi, sorry for my late reply.

Following errors occur when compiling the cmake project under Ubuntu /WSL.

~/xcpTl.c:421:46: error: invalid conversion from ‘char*’ to ‘uint8_t*’ {aka ‘unsigned char*’} [-fpermissive]
  421 |         n = socketRecv(gXcpTl.MulticastSock, (char*) buffer, (uint16_t)sizeof(buffer));
/usr/bin/ld: CMakeFiles/xcpLite.dir/xcpLite.c.o: in function `XcpCommand':
~/xcpLite.c:1116: undefined reference to `XcpTlSetClusterId'
/usr/bin/ld: CMakeFiles/xcpLite.dir/xcpLite.c.o: in function `XcpInit':
~/xcpLite.c:1349: undefined reference to `XcpTlSetClusterId'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/xcpLite.dir/build.make:219: xcpLite] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/xcpLite.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

Thank you!

You can use the patch from the pull-request.

mzurawski commented 2 years ago

Similarly on the Raspberry PI4 I used cmake and compiled it I made a few small modifications first due to the compilation errors.

xcpTl.h added: extern void XcpTlSetClusterId(uint16_t clusterId); xcpAppl.c changed line 222: p = (char) APP_NAME; xcpTl.c changed line 421: n = socketRecv(gXcpTl.MulticastSock, (char*)&buffer, (uint16_t)sizeof(buffer));

Afterwards I ran it up to about 40 MB/s on the DAQ rate with a few missing ODTs.