Skip to main content
Topic: trouble compiling (Read 6108 times) previous topic - next topic

trouble compiling

My aim here is to compile the code for a 18F2455, as it is so similar to the 2550 i expected this to be 'easy'
after installing the latest MPLAB IDE, C18 lite compiler and the sources for USB (from 'Microchip Application Libraries v2010-08-04 Installer.exe') and copying the usb_descriptors.c source to the project directory...
The files for USB don't seem to be in the same directory hierarchy as expected.. the compiler looks for files in ./USBStack
i found the files it was looking for in J:Microchip Solutions v2010-08-04MicrochipUSB
so i renamed the folder to USBStack and moved it into the project directory.
now it gets stuck at linking

and yes i did modify the 'library search path' to the correct MCC18 directory

Code: [Select]
----------------------------------------------------------------------
Release build of project `J:Microchip Solutions v2010-08-04IRtoy-firmwareUSBIRToy.mcp' started.
Language tool versions: mpasmwin.exe v5.37, mplink.exe v4.37, mcc18.exe v3.36, mplib.exe v4.37
Tue Sep 21 19:30:12 2010
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "J:MCC18binmcc18.exe" -p=18F2550 /i"c:mcc18h" -I"..microchipinclude" -I"C:Microchip SolutionsUSBIRr" "..MicrochipUsbusb_device.c" -fo="usb_device.o" -Om- -On- -Ou- -Os- -Ot- -Ob- -Ow- -Op- -Or- -Od- -Opa-
Executing: "J:MCC18binmcc18.exe" -p=18F2550 /i"c:mcc18h" -I"..microchipinclude" -I"C:Microchip SolutionsUSBIRr" "..MicrochipUsbCDC Device Driverusb_function_cdc.c" -fo="usb_function_cdc.o" -Om- -On- -Ou- -Os- -Ot- -Ob- -Ow- -Op- -Or- -Od- -Opa-
Executing: "J:MCC18binmcc18.exe" -p=18F2550 /i"c:mcc18h" -I"..microchipinclude" -I"C:Microchip SolutionsUSBIRr" "usb_descriptors.c" -fo="usb_descriptors.o" -Om- -On- -Ou- -Os- -Ot- -Ob- -Ow- -Op- -Or- -Od- -Opa-
Executing: "J:MCC18binmcc18.exe" -p=18F2550 /i"c:mcc18h" -I"..microchipinclude" -I"C:Microchip SolutionsUSBIRr" "main.c" -fo="main.o" -Om- -On- -Ou- -Os- -Ot- -Ob- -Ow- -Op- -Or- -Od- -Opa-
J:Microchip Solutions v2010-08-04IRtoy-firmwaremain.c:226:Warning [2054] suspicious pointer conversion
J:Microchip Solutions v2010-08-04IRtoy-firmwaremain.c:410:Warning [2054] suspicious pointer conversion
Executing: "J:MCC18binmcc18.exe" -p=18F2550 /i"c:mcc18h" -I"..microchipinclude" -I"C:Microchip SolutionsUSBIRr" "SUMP.c" -fo="SUMP.o" -Om- -On- -Ou- -Os- -Ot- -Ob- -Ow- -Op- -Or- -Od- -Opa-
J:Microchip Solutions v2010-08-04IRtoy-firmwareSUMP.c:71:Warning [2054] suspicious pointer conversion
J:Microchip Solutions v2010-08-04IRtoy-firmwareSUMP.c:136:Warning [2054] suspicious pointer conversion
Executing: "J:MCC18binmcc18.exe" -p=18F2550 /i"c:mcc18h" -I"..microchipinclude" -I"C:Microchip SolutionsUSBIRr" "IRIO.c" -fo="IRIO.o" -Om- -On- -Ou- -Os- -Ot- -Ob- -Ow- -Op- -Or- -Od- -Opa-
J:Microchip Solutions v2010-08-04IRtoy-firmwareIRIO.c:46:Warning [2054] suspicious pointer conversion
J:Microchip Solutions v2010-08-04IRtoy-firmwareIRIO.c:117:Warning [2054] suspicious pointer conversion
J:Microchip Solutions v2010-08-04IRtoy-firmwareIRIO.c:233:Warning [2054] suspicious pointer conversion
Executing: "J:MCC18binmcc18.exe" -p=18F2550 /i"c:mcc18h" -I"..microchipinclude" -I"C:Microchip SolutionsUSBIRr" "RCdecoder.c" -fo="RCdecoder.o" -Om- -On- -Ou- -Os- -Ot- -Ob- -Ow- -Op- -Or- -Od- -Opa-
J:Microchip Solutions v2010-08-04IRtoy-firmwareRCdecoder.c:55:Warning [2054] suspicious pointer conversion
J:Microchip Solutions v2010-08-04IRtoy-firmwareRCdecoder.c:106:Warning [2054] suspicious pointer conversion
Executing: "J:MCC18binmcc18.exe" -p=18F2550 /i"c:mcc18h" -I"..microchipinclude" -I"C:Microchip SolutionsUSBIRr" "USBbuf.c" -fo="USBbuf.o" -Om- -On- -Ou- -Os- -Ot- -Ob- -Ow- -Op- -Or- -Od- -Opa-
J:Microchip Solutions v2010-08-04IRtoy-firmwareUSBbuf.c:25:Warning [2054] suspicious pointer conversion
Executing: "J:MCC18binmcc18.exe" -p=18F2550 /i"c:mcc18h" -I"..microchipinclude" -I"C:Microchip SolutionsUSBIRr" "IRs.c" -fo="IRs.o" -Om- -On- -Ou- -Os- -Ot- -Ob- -Ow- -Op- -Or- -Od- -Opa-
J:Microchip Solutions v2010-08-04IRtoy-firmwareIRs.c:59:Warning [2054] suspicious pointer conversion
J:Microchip Solutions v2010-08-04IRtoy-firmwareIRs.c:165:Warning [2054] suspicious pointer conversion
J:Microchip Solutions v2010-08-04IRtoy-firmwareIRs.c:197:Warning [2054] suspicious pointer conversion
J:Microchip Solutions v2010-08-04IRtoy-firmwareIRs.c:360:Warning [2054] suspicious pointer conversion
J:Microchip Solutions v2010-08-04IRtoy-firmwareIRs.c:374:Warning [2054] suspicious pointer conversion
Executing: "J:MCC18binmplink.exe" /l"j:mcc18lib" "rm18f2550 - HID Bootload.lkr" "usb_device.o" "usb_function_cdc.o" "usb_descriptors.o" "main.o" "SUMP.o" "IRIO.o" "RCdecoder.o" "USBbuf.o" "IRs.o" /u_CRUNTIME /z__MPLAB_BUILD=1 /m"J:Documents and SettingsjarrodDesktopusbirtoyIRtoy-firmwarebuildUSBIRToy.map" /w /o"J:Documents and SettingsjarrodDesktopusbirtoyIRtoy-firmwarebuildUSBIRToy.cof"
MPLINK 4.37, Linker
Copyright (c) 1998-2010 Microchip Technology Inc.
Error - could not find definition of symbol 'mySetLineCodingHandler' in file './usb_function_cdc.o'.
Errors    : 1

Link step failed.
----------------------------------------------------------------------
Release build of project `J:Microchip Solutions v2010-08-04IRtoy-firmwareUSBIRToy.mcp' failed.
Language tool versions: mpasmwin.exe v5.37, mplink.exe v4.37, mcc18.exe v3.36, mplib.exe v4.37
Tue Sep 21 19:30:15 2010
----------------------------------------------------------------------
BUILD FAILED

Re: trouble compiling

Reply #1
It looks like something is still missing from the USB stack paths, or maybe Microchip changed the latest USB stack and I need to do some fix3es.
Got a question? Please ask in the forum for the fastest answers.

Re: trouble compiling

Reply #2
well not sure if this will help, but here is the directory tree for the project folder
Code: [Select]
J:Microchip Solutions v2010-08-04IRtoy-firmware>tree /f
Folder PATH listing
Volume serial number is 00650072 FCF5:AF5E
J:.
│   clean.bat
│   config.h
│   globals.h
│   HardwareProfile.h
│   IRIO.c
│   IRIO.err
│   IRIO.h
│   IRIO.o
│   IrReflect.c
│   IrReflect.h
│   IRs.c
│   IRs.err
│   IRs.h
│   IRs.o
│   main.c
│   main.err
│   main.h
│   main.o
│   RCdecoder.c
│   RCdecoder.err
│   RCdecoder.h
│   RCdecoder.o
│   README.TXT
│   rm18f2550 - HID Bootload.lkr
│   SUMP.c
│   SUMP.err
│   SUMP.h
│   SUMP.o
│   usb2uart.c
│   usb2uart.h
│   USBbuf.c
│   USBbuf.err
│   USBbuf.h
│   USBbuf.o
│   USBIRToy.hex
│   USBIRToy.mcp
│   USBIRToy.mcw
│   usb_config.h
│   usb_descriptors.c
│   usb_descriptors.o
│   usb_device.o
│   usb_function_cdc.o
│
├───build
└───USBStack
        usb.h
        usb_ch9.h
        usb_common.h
        usb_device.h
        usb_function_audio.h
        usb_function_ccid.h
        usb_function_cdc.h
        usb_function_generic.h
        usb_function_hid.h
        usb_function_midi.h
        usb_function_msd.h
        usb_hal.h
        usb_hal_pic18.h
        usb_hal_pic24.h
        usb_hal_pic32.h
        usb_host.h
        usb_host_audio_v1.h
        usb_host_cdc.h
        usb_host_cdc_interface.h
        usb_host_charger.h
        usb_host_generic.h
        usb_host_hid.h
        usb_host_hid_parser.h
        usb_host_msd.h
        usb_host_msd_scsi.h
        usb_host_printer.h
        usb_host_printer_esc_pos.h
        usb_host_printer_pcl_5.h
        usb_host_printer_postscript.h
        usb_host_printer_primitives.h
        usb_otg.h
        usb_printer_pos_bixolon_srp_270.h
        usb_printer_pos_epson_tm_t88iv.h
        usb_printer_pos_seiko_dpu_v445.h
        usb_printer_pos_seiko_mpu_l465.h


and the tree of the entire library folder (J:Microchip Solutions v2010-08-04).. this one is long, so i put it in a txt file (J: instead of "C:" is my root drive for some stupid reason)

Re: trouble compiling

Reply #3
Just comment out

Code: [Select]
//#define USB_CDC_SET_LINE_CODING_HANDLER mySetLineCodingHandler

And it should compile.
Got a question? Please ask in the forum for the fastest answers.

Re: trouble compiling

Reply #4
That was the wrong answer :) There are some new files (usb2uart, irreflect, hal_lin_m) that need to be added to the project. Then it seems to compile fine.
Got a question? Please ask in the forum for the fastest answers.

Re: trouble compiling

Reply #5
so comment out that line in usb_config.h?
These new files you mention are already in the project folder, except for hal_lin_m which I can not find.
unless you mean they actually need to be included in the source

anyway after commenting out that line i get this error
Code: [Select]
Executing: "J:MCC18binmplink.exe" /l"j:mcc18lib" "rm18f2550 - HID Bootload.lkr" "usb_device.o" "usb_function_cdc.o" "usb_descriptors.o" "main.o" "SUMP.o" "IRIO.o" "RCdecoder.o" "USBbuf.o" "IRs.o" /u_CRUNTIME /z__MPLAB_BUILD=1 /m"USBIRToy.map" /w /o"USBIRToy.cof"
MPLINK 4.37, Linker
Copyright (c) 1998-2010 Microchip Technology Inc.
Error - could not find definition of symbol 'Usb2UartSetup' in file './main.o'.
Errors    : 1

Link step failed.

Re: trouble compiling

Reply #6
That's what happened to make me retracted my first solution :)

Try updating to the latest source in SVN, I committed a new project file with the latest source included. You may have to update the include paths again.
Got a question? Please ask in the forum for the fastest answers.

Re: trouble compiling

Reply #7
Thanks Ian. that fixed it.
now i just need to work out how to compile for the 2455. I noticed in hardwareprofile.h you have some modifications to work with HAD_USBIRC to change interrupts.. so i suppose you are working on it.
simply changing the chip type in the compiler wont work i see (complains about chip type being different in source files, yet i don't know where this is defined). maybe I'll leave it to you :P im not much good with "low-level" pic stuff.

Re: trouble compiling

Reply #8
hi yaywoop

at the "rm18f2550 - HID Bootload.lkr" file there is this line:

FILES p18f2550.lib

I just changed it to

FILES p18f2455.lib

and it compiled successfully for PIC18F2455.. however, I wasn't able to test it in actual since I don't have 18f2455.

Re: trouble compiling

Reply #9
The new version with the 2455 compile is out. It's untested, if you use it please let me know if it works.
Got a question? Please ask in the forum for the fastest answers.