I have a test project using TinyUSB that fails to build when logging is enabled. The same source files build just fine withing CubeIDE and the same logging is enabled. The PIO project is here. The error I see is shown here:
In file included from src\tinyUSB\src/tusb_option.h:30:0,
from src\tinyUSB\src\device\usbd.c:27:
src\tinyUSB\src\device\usbd.c: In function 'tud_task_ext':
src\tinyUSB\src/common/tusb_debug.h:69:43: error: a label can only be part of a statement and a declaration is not a statement
#define TU_LOG_PTR(n, ...) TU_XSTRCAT3(TU_LOG, n, _PTR)(__VA_ARGS__)
^
src\tinyUSB\src/common/tusb_compiler.h:40:31: note: in definition of macro 'TU_STRCAT3'
#define TU_STRCAT3(a, b, c) a##b##c ///< concat without expand
^
src\tinyUSB\src/common/tusb_debug.h:69:31: note: in expansion of macro 'TU_XSTRCAT3'
#define TU_LOG_PTR(n, ...) TU_XSTRCAT3(TU_LOG, n, _PTR)(__VA_ARGS__)
^~~~~~~~~~~
src\tinyUSB\src\device\usbd.c:511:9: note: in expansion of macro 'TU_LOG_PTR'
TU_LOG_PTR(USBD_DBG, &event.setup_received);
^~~~~~~~~~
src\tinyUSB\src/common/tusb_debug.h:69:43: error: unknown type name 'TU_LOG2void'; did you mean 'TU_LOG2_PTR'?
Compiling .pio\build\nucleo_l452re\src\tinyUSB\src\portable\raspberrypi\rp2040\rp2040_usb.o
#define TU_LOG_PTR(n, ...) TU_XSTRCAT3(TU_LOG, n, _PTR)(__VA_ARGS__)
^
src\tinyUSB\src/common/tusb_compiler.h:40:31: note: in definition of macro 'TU_STRCAT3'
#define TU_STRCAT3(a, b, c) a##b##c ///< concat without expand
^
src\tinyUSB\src/common/tusb_debug.h:69:31: note: in expansion of macro 'TU_XSTRCAT3'
#define TU_LOG_PTR(n, ...) TU_XSTRCAT3(TU_LOG, n, _PTR)(__VA_ARGS__)
^~~~~~~~~~~
src\tinyUSB\src\device\usbd.c:511:9: note: in expansion of macro 'TU_LOG_PTR'
TU_LOG_PTR(USBD_DBG, &event.setup_received);
^~~~~~~~~~
In file included from src\tinyUSB\src/common/tusb_common.h:74:0,
from src\tinyUSB\src/device/dcd.h:30,
from src\tinyUSB\src\device\usbd.c:31:
src\tinyUSB\src\device\usbd.c:511:30: error: expected identifier or '(' before '&' token
TU_LOG_PTR(USBD_DBG, &event.setup_received);
^
src\tinyUSB\src/common/tusb_debug.h:69:60: note: in definition of macro 'TU_LOG_PTR'
#define TU_LOG_PTR(n, ...) TU_XSTRCAT3(TU_LOG, n, _PTR)(__VA_ARGS__)
^~~~~~~~~~~
Compiling .pio\build\nucleo_l452re\src\tinyUSB\src\portable\renesas\rusb2\dcd_rusb2.o
Compiling .pio\build\nucleo_l452re\src\tinyUSB\src\portable\renesas\rusb2\hcd_rusb2.o
Compiling .pio\build\nucleo_l452re\src\tinyUSB\src\portable\sony\cxd56\dcd_cxd56.o
Compiling .pio\build\nucleo_l452re\src\tinyUSB\src\portable\st\stm32_fsdev\dcd_stm32_fsdev.o
Compiling .pio\build\nucleo_l452re\src\tinyUSB\src\portable\st\synopsys\dcd_synopsys.o
Compiling .pio\build\nucleo_l452re\src\tinyUSB\src\portable\sunxi\dcd_sunxi_musb.o
Compiling .pio\build\nucleo_l452re\src\tinyUSB\src\portable\synopsys\dwc2\dcd_dwc2.o
*** [.pio\build\nucleo_l452re\src\tinyUSB\src\device\usbd.o] Error 1
Sid