PIC32MX + USB HID + CAN Doesn't Compile
Posted: Tue Sep 22, 2020 10:13 pm
I've got a simple program with both USB HID and CAN Bus (Internal) Component on PIC32MX530F128H.
The program compiles fine with just USB HID component.
The program compiles also fine with just CAN (Internal) component.
But it gives an error when both components are present in the program.
I am using the updated batch files that Ben provided in a past post https://www.matrixtsl.com/temp/pic32_USB.zip
Could you have a look please? Cheers,
R
The program compiles fine with just USB HID component.
The program compiles also fine with just CAN (Internal) component.
But it gives an error when both components are present in the program.
Code: Select all
D:\Projects\Apora\Products\BEHEMO~1\v5.0\FC8\PIC0_U~1>xc32-gcc -mprocessor=32MX530F128H -DMX_USBFS -ID:\Projects\Apora\Products\BEHEMO~1\v5.0\FC8\PIC0_U~1\. -I"C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\PIC32BIT\USB\HID" -I"C:\PROGRA~2\Flowcode\COMPIL~1\pic32\batch\..\harmony" -I"C:\PROGRA~2\Flowcode\COMPIL~1\pic32\batch\..\harmony\framework" -w -c -ffunction-sections -O1 -o "PIC0_USB_MIDI_FLASH_V1_PIC32MX_32MX530F128H\PIC0_USB_MIDI_FLASH_V1_PIC32MX.o" "PIC0_USB_MIDI_FLASH_V1_PIC32MX.c"
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\PIC32BIT\PIC32BIT_CAL_CAN.c: In function 'FC_CAL_Internal_CAN_SendBuffer_1':
PIC0_USB_MIDI_FLASH_V1_PIC32MX.c:117:17: error: expected identifier or '(' before numeric constant
#define timeout 10
^
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\PIC32BIT\PIC32BIT_CAL_CAN.c:376:12: note: in expansion of macro 'timeout'
MX_UINT32 timeout = 0xFFFF;
^
In file included from C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\includes.c:238:0,
from PIC0_USB_MIDI_FLASH_V1_PIC32MX.c:715:
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\PIC32BIT\PIC32BIT_CAL_CAN.c:383:44: error: lvalue required as decrement operand
while (C1FIFOCON0bits.TXREQ && timeout--);
^
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\PIC32BIT\PIC32BIT_CAL_CAN.c:387:44: error: lvalue required as decrement operand
while (C1FIFOCON1bits.TXREQ && timeout--);
^
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\PIC32BIT\PIC32BIT_CAL_CAN.c:391:44: error: lvalue required as decrement operand
while (C1FIFOCON2bits.TXREQ && timeout--);
^
Error(s) in build
C:\Program Files (x86)\Flowcode\Compilers\pic32\batch\PIC32compHID.bat reported error code 1
Could you have a look please? Cheers,
R