CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Original CDC USB bootloader will not compile PIC16F1459

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Rogier



Joined: 25 Feb 2012
Posts: 12
Location: NL

View user's profile Send private message

Original CDC USB bootloader will not compile PIC16F1459
PostPosted: Wed Mar 22, 2017 7:24 pm     Reply with quote

Hi,

I use the USB CDC Bootloader a lot on PIC18, but I'm new to the PIC16F1459. I wanted to compile the USB CDC bootloader for it, so I started to compile it for a development kit (USB_HW_CCS_16F1459) for PIC16F1459 first, as a starting point, which is listed in the ex_usb_common.h. Also tried the USB_HW_MCHP_16F1459

MPLAB 8.92
CCS 5.021 (Also tried on 5.049)
selected device in MPLAB device: PIC16F1459 (prog mem: 8192)

standard ex_usb_common.h
Code:

////// Begin User Configuration

//#define USB_HW_CCS_PIC18F4550     //CCS PIC18F4550 USB Development kit
//#define USB_HW_CCS_PIC18F45K50     //CCS PIC18F45K50 USB Development kit
#define USB_HW_CCS_16F1459        //CCS Rapid USB devleopment kit.  16F1459 with no oscillator
//#define USB_HW_CCS_PIC24F           //CCS 24FJ256GB206 USB Development kit
//#define USB_HW_CCS_PIC33EP           //CCS PIC24 USB Development kit, PIC replaced with a 33EP256MU806
//#define USB_HW_CCS_USBN9604       //CCS National USBN9604 USB development kit (external USB peripheral)
//#define USB_HW_MCHP_18F14K50      //Microchip low-pin count USB development kit (PIC18F14K50)
//#define USB_HW_MCHP_18F46J50      //Microchip USB PIM Demo Board (PIC18F46J50)
//#define USB_HW_GENERIC_18F67J50   //Generic 18F67J50 example
//#define USB_HW_GENERIC_18F27J53   //Generic 18F27J53 example
//#define USB_HW_MCHP_EXPLORER16_24F   //Microchip Explorer16 with USB OTG PICTail+ & 24FJ256GB110
//#define USB_HW_MCHP_EXPLORER16_24E   //Microchip Explorer16 with USB OTG PICTail+
//#define USB_HW_MCHP_16F1459        //Microchip low-pin count USB development kit with a 16F1459, using internal oscillator with active clock tuning
//#define USB_HW_GENERIC_18F45K50     //Generic 18F45K50 example.  You can get this by taking a CCS 4550 board and replacing the PIC with a 45K50 and the crystal wiht a 12Mhz
//#define USB_HW_GENERIC_18F67J94   //Generic 18F67J94 example.
//#define USB_HW_GENERIC_24FJ128GC006
//#define USB_HW_CCS_18F4523          //The PIC16F1459 on the 18F4523 development kit

etc...


standard ex_usb_bootloader.c

Code:

#include <ex_usb_common.h>

/*
 Configure, then load the bootloader definitions
*/

#define _bootloader
#include "usb_bootloader.h"

// Includes all USB code and interrupts, as well as the CDC API
#include <usb_cdc.h>
etc...


After compiling, it gives following errors:

Code:

--- Info 300 "C:\Program Files (x86)\PICC5021\drivers\usb_bootloader.h" Line 85(43,46): More info:   Segment at 00000-007FF (0000 used)
--- Info 300 "C:\Program Files (x86)\PICC5021\drivers\usb_bootloader.h" Line 85(43,46): More info:   Segment at 00800-00FFF (0000 used)
--- Info 300 "C:\Program Files (x86)\PICC5021\drivers\usb_bootloader.h" Line 85(43,46): More info:   Segment at 01000-017FF (0000 used)
--- Info 300 "C:\Program Files (x86)\PICC5021\drivers\usb_bootloader.h" Line 85(43,46): More info:   Segment at 01800-01FFF (0000 used)
--- Info 300 "C:\Program Files (x86)\PICC5021\drivers\usb_bootloader.h" Line 85(43,46): More info:   Attempted to create: 02040-0204F  for #org
*** Error 126 "C:\Program Files (x86)\PICC5021\drivers\usb_bootloader.h" Line 85(43,46): Invalid ORG range
      1 Errors,  0 Warnings.


This is the line in usb_bootloader.h:

Code:

 /*
  Provide an empty application, so if you load this .HEX file into the pic
  without an application this will prevent the pic from executing unknown code.
 */
THIS ONE> #org APPLICATION_START,APPLICATION_START+0xF
 void BlankApplication(void)
 {
   while(TRUE);
 }


If I change the device in MPLAB and (un)comment for another processor like PIC18F14K50 then it works fine.

It's the standard files that came with the compiler, no changes made, should work I guess..What am I doing wrong?

I read something about #build instruction somewhere, maybe this must be added somewhere?

Thanks in advance for your help!


Last edited by Rogier on Thu Mar 23, 2017 4:57 pm; edited 2 times in total
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Mar 22, 2017 8:32 pm     Reply with quote

I compiled it with vs. 5.070 and it compiled OK.

1. I made a new project in MPLAB 8.92 for the 16F1459, and called
ex_usb_bootloader.

2. I assigned the file ex_usb_bootloader.c to the project as the main file.
Note: I did not use ex_bootloader.c as you have in your post.

3. I edited ex_usb_common.h to enable the following PIC:
Code:
#define USB_HW_CCS_16F1459

I commented out the line for the default PIC.

4. I compiled it and got this report on the build:

Quote:
Executing: "C:\Program files\Picc\CCSC.exe" +FM "ex_usb_bootloader.c" +DF +LN +T +A +M +Z +Y=9 +EA #__16F1459=TRUE
>>> Warning 203 "C:\Program Files\PICC\drivers\pic16f_usb.c" Line 441(1,1): Condition always TRUE
--- Info 300 "C:\Program Files\PICC\drivers\tick.h" Line 84(1,1): More info: Timer 1 tick time is 682.39 us
Memory usage: ROM=41% RAM=28% - 42%
0 Errors, 1 Warnings.
Build Successful.
Rogier



Joined: 25 Feb 2012
Posts: 12
Location: NL

View user's profile Send private message

PostPosted: Thu Mar 23, 2017 4:09 pm     Reply with quote

Thanks PCM programmer for testing.

Interesting... Does it mean that it's simply not possible to compile with earlier versions? So I have to upgrade to newest version?
Ttelmah



Joined: 11 Mar 2010
Posts: 19217

View user's profile Send private message

PostPosted: Fri Mar 24, 2017 1:37 am     Reply with quote

The nearest I have to 5.021, is 5.019, and 5.023.

I ran both. Edited just the two lines in ex_usb_common (put remarks on the default 4550 line, and removed the remarks on the 1459 line).
Compiled.

Fine on both compilers.

Go back to the original files from the compiler (re-install if you have lost them). Just do the minimum changes, and see what happens.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group