USB_Serial problem receiving
Posted: Tue Aug 08, 2017 10:36 am
Hi everyone,
I'm trying to get implemented the USB to Serial bridge (based on UART_bridge example). I replaced the UARTB with the USB_serial. However i have a major issue with simulation and with target hardware (PIC18LF45K50):
in simulation mode it appears that none of interrupts or timers are running inside the Flowcode 7 (it is 7.2.1.4 + I copied the fix Flowcode_7_Latest_170717) so i can not use the UART interupt call. I modified the receiving routine a bit so it is not use only an interrupt but similar to USB data is read from the main loop.
When i program the hardware, i get working USB send (to test it i was simply sending the string with "Hello world"). This proved me that the USB initialized correctly, i also get the USB Tx LED flashing as it passing trough the loop.
It appears that i do not get any USB receiving data. The compiler is showing this "unreachable code (warning)" which i believe is the source of the problem:
=================================================
C:\Program Files (x86)\Flowcode 7\compilers\pic\bin\xc8.exe --chip=18LF45K50 "UART_Bridge.c" --MSGDISABLE=359,1273,1388
Microchip MPLAB XC8 C Compiler (Free Mode) V1.41
Build date: Jan 24 2017
Part Support Version: 1.41
Copyright (C) 2017 Microchip Technology Inc.
License type: Node Configuration
UART_Bridge.c: FCD_056e1_USB_SerialB__ReadByte()
865: return (FCR_RETVAL);
^ (345) unreachable code (warning)
UART_Bridge.c: 2056: (764) mismatched comparison (warning)
C:\PROGRA~2\FLOWCO~1\COMPIL~1\pic\include\../../../CAL/PIC/USB/usb_device.c: 295: non-reentrant function "_USBDeviceInit" appears in multiple call graphs and has been duplicated by the compiler
C:\PROGRA~2\FLOWCO~1\COMPIL~1\pic\include\../../../CAL/PIC/USB/usb_device.c: 1013: non-reentrant function "_USBTransferOnePacket" appears in multiple call graphs and has been duplicated by the compiler
C:\Program Files (x86)\Flowcode 7\CAL\PIC\PIC_CAL_UART.c: 481: non-reentrant function "_FC_CAL_UART_Receive_1" appears in multiple call graphs and has been duplicated by the compiler
UART_Bridge.c: 1695: non-reentrant function "_FCD_01211_CircularBufferA__PutByte" appears in multiple call graphs and has been duplicated by the compiler
UART_Bridge.c: 1982: non-reentrant function "_FCD_047b1_RS232A__ReceiveChar" appears in multiple call graphs and has been duplicated by the compiler
UART_Bridge.c: 2039: non-reentrant function "_FCM_RXD_A" appears in multiple call graphs and has been duplicated by the compiler
C:\PROGRA~2\FLOWCO~1\COMPIL~1\pic\sources\common\Umul16.c: 15: non-reentrant function "___wmul" appears in multiple call graphs and has been duplicated by the compiler
C:\PROGRA~2\FLOWCO~1\COMPIL~1\pic\sources\common\memset.c: 8: non-reentrant function "_memset" appears in multiple call graphs and has been duplicated by the compiler
===============================================
Do you have any idea what may be wrong?
I may also have a problem with UART, but let do USB first.
Thanks in advance.
I'm trying to get implemented the USB to Serial bridge (based on UART_bridge example). I replaced the UARTB with the USB_serial. However i have a major issue with simulation and with target hardware (PIC18LF45K50):
in simulation mode it appears that none of interrupts or timers are running inside the Flowcode 7 (it is 7.2.1.4 + I copied the fix Flowcode_7_Latest_170717) so i can not use the UART interupt call. I modified the receiving routine a bit so it is not use only an interrupt but similar to USB data is read from the main loop.
When i program the hardware, i get working USB send (to test it i was simply sending the string with "Hello world"). This proved me that the USB initialized correctly, i also get the USB Tx LED flashing as it passing trough the loop.
It appears that i do not get any USB receiving data. The compiler is showing this "unreachable code (warning)" which i believe is the source of the problem:
=================================================
C:\Program Files (x86)\Flowcode 7\compilers\pic\bin\xc8.exe --chip=18LF45K50 "UART_Bridge.c" --MSGDISABLE=359,1273,1388
Microchip MPLAB XC8 C Compiler (Free Mode) V1.41
Build date: Jan 24 2017
Part Support Version: 1.41
Copyright (C) 2017 Microchip Technology Inc.
License type: Node Configuration
UART_Bridge.c: FCD_056e1_USB_SerialB__ReadByte()
865: return (FCR_RETVAL);
^ (345) unreachable code (warning)
UART_Bridge.c: 2056: (764) mismatched comparison (warning)
C:\PROGRA~2\FLOWCO~1\COMPIL~1\pic\include\../../../CAL/PIC/USB/usb_device.c: 295: non-reentrant function "_USBDeviceInit" appears in multiple call graphs and has been duplicated by the compiler
C:\PROGRA~2\FLOWCO~1\COMPIL~1\pic\include\../../../CAL/PIC/USB/usb_device.c: 1013: non-reentrant function "_USBTransferOnePacket" appears in multiple call graphs and has been duplicated by the compiler
C:\Program Files (x86)\Flowcode 7\CAL\PIC\PIC_CAL_UART.c: 481: non-reentrant function "_FC_CAL_UART_Receive_1" appears in multiple call graphs and has been duplicated by the compiler
UART_Bridge.c: 1695: non-reentrant function "_FCD_01211_CircularBufferA__PutByte" appears in multiple call graphs and has been duplicated by the compiler
UART_Bridge.c: 1982: non-reentrant function "_FCD_047b1_RS232A__ReceiveChar" appears in multiple call graphs and has been duplicated by the compiler
UART_Bridge.c: 2039: non-reentrant function "_FCM_RXD_A" appears in multiple call graphs and has been duplicated by the compiler
C:\PROGRA~2\FLOWCO~1\COMPIL~1\pic\sources\common\Umul16.c: 15: non-reentrant function "___wmul" appears in multiple call graphs and has been duplicated by the compiler
C:\PROGRA~2\FLOWCO~1\COMPIL~1\pic\sources\common\memset.c: 8: non-reentrant function "_memset" appears in multiple call graphs and has been duplicated by the compiler
===============================================
Do you have any idea what may be wrong?
I may also have a problem with UART, but let do USB first.
Thanks in advance.