stacksmashing / tamarin-firmware

GNU General Public License v3.0
458 stars 54 forks source link

Build error implicit declaration of function 'tud_vendor_flush' #23

Closed PatriceBlin closed 6 months ago

PatriceBlin commented 6 months ago

Hi

I'm unable to build the firmware with the following error

[...]

[ 91%] Linking CXX executable tamarin_firmware.elf
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: CMakeFiles/tamarin_firmware.dir/main.c.obj: in function `main':
main.c:(.text.startup.main+0x68): undefined reference to `tud_vendor_flush'
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: main.c:(.text.startup.main+0x90): undefined reference to `tud_vendor_flush'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/tamarin_firmware.dir/build.make:1191: tamarin_firmware.elf] Error 1
make[1]: *** [CMakeFiles/Makefile2:1283: CMakeFiles/tamarin_firmware.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

pico-sdk is on 4fe995d0ec984833a7ea9c33bac5c67a53c04178 tamarin-firmware is on 5d4a559a6bd34781ab21a38bf5dc151e61749f37

I checked in pico-sdk's and tamarin's repo history but I have not found the definition of this fonction.

Looks like it's from tiny-usb but pico-sdk is using raspberry's fork tiny-usb (branch "pico") that doesn't have this function.

raspberrypi/debugprobe did some workarround https://github.com/raspberrypi/debugprobe/blob/2bbe900d680b603a9165cc58384a2acd62530ece/src/main.c#L77

// Workaround API change in 0.13
#if (TUSB_VERSION_MAJOR == 0) && (TUSB_VERSION_MINOR <= 12)
#define tud_vendor_flush(x) ((void)0)
#endif

@nezza Do you remember how #19 was built ?

Should we use a different pico-sdk with upstream tiny-usb or just workarround with tud_vendor_flush ?

Thanks

ElectroBoy404NotFound commented 6 months ago

tud_vendor_flush

Hmm, last time I compiled it, I used the latest versions. You could try cloning the newest version and recompiling it.

PatriceBlin commented 6 months ago

I upgraded the pico-sdk to master 6a7db34ff63345a7badec79ebea3aaef1712f374 (1.5.1) and it compile fine now.

Thanks and my bad.

If the USB issue was fixed you probably can drop the pico-sdk version suggested in the Readme

ElectroBoy404NotFound commented 6 months ago

I upgraded the pico-sdk to master 6a7db34ff63345a7badec79ebea3aaef1712f374 (1.5.1) and it compile fine now.

Thanks and my bad.

If the USB issue was fixed you probably can drop the pico-sdk version suggested in the Readme

Yea, I think it is fixed; I never faced issues which the latest (master) version