Bcox
Joined: 09 Oct 2007 Posts: 17 Location: Windsor, CT
|
Running code with and without USB Bootloader |
Posted: Mon May 05, 2008 8:29 am |
|
|
Hello all,
I am a developing a USB HID system using a 18F4550. I have developed a LabView application that communicates with this device with no problems. A new requirement came along that has required me to use a bootloader for this system so I am attempting to use the ex_usb_bootloader.c as a starting place. I am able to install the bootloader no problem and download my code using SIOW.exe no problem.
Here is my problem:
When I run my system without a bootloader I have reliable communication back and forth from the PC and PIC. When I install my program with the bootloader it does not seem like I can send data from the PIC to the PC when requested. I know the PC and PIC are talking to each other since the computer recognizes the device and I can control the PIC from the PC (LabView program). I am trying to send data using the usb_put_packet command.
Code: | sprintf(out_data,"%fR",pressure_value);
usb_put_packet(1, out_data, strlen(out_data), USB_DTS_TOGGLE); |
This code runs fine when I don't have a bootloader installed. When the bootloader is installed, the PIC does not freeze up and the usb_put_packet returns TRUE so i know it is running the code.
Are the pointer locations getting lost due to the offset of code from the bootloader? I am not sure what else might cause this problem. This is my first project using USB and a bootloader so my knowledge of both is rather lacking. Could it be the size of my program that is causing the probem? The software I am installing after the bootloader uses 44% of rom and 59%-65% of RAM. Any help would be greatly appreciated. Thanks! |
|