PIC18f4550 + tinybootloader

(instructions, reset, WDT, specifications...) PIC17Cxx, PIC18Fxxx

PIC18f4550 + tinybootloader

Postby i.ddespot » Mon Mar 07, 2016 3:28 pm

Hi,

I'm using XC8 and PIC18f4550 with tinybootloader on it.
Since I'm just learning some basic stuff, I'm trying to compile and upload some sample projects (simple led blinking) that I've found online. Below is the code I'm trying to build and upload via tinybootloader. However when I build and try to upload the hex file, I'm getting the following error:

Searching for PIC ...
Found:18F 2550/4550
Overwriting bootloader denied
ERROR!


While I was searching online for some similar cases I found that the problem occurs because the hex file is trying to occupy bootloaders place (my understanding of tinybootloader is that it stores GOTO at the beginning and points to the end of the PIC memory so it leaves the rest for any other application). I've tried to add an offset in the project properties->XC8 linker->memory model under RAM ranges. After that the error message changes to:

Searching for PIC ...
Found:18F 2550/4550
WARNING: GOTO not found in first 4 words
Overwriting bootloader denied
ERROR!


That tells me that I'm on a good track, but I'm not really sure how to proceed, I've tried some other examples of GOTO function but without any luck (although I've seen the changes in HEX files with and without it, but the error remains the same).

I would appreciate any sort of help or guidance regarding this. Thanks in advance.

Code: Select all
#include<p18f4550.h>
#pragma config PLLDIV = 5 , CPUDIV = OSC1_PLL2 , USBDIV = 2
/* *************** TIMER *************** */
       void delayzz(void)
        { int i, j;
                        for(i=0;i<5000;i++)
                {
                          for(j=0;j<2;j++)
                      { } } }
                           
                /* ****************** MAIN ****************** */

      void main(void)
         {
                        TRISB = 0 ;
     
           while(1)
                            {
                                LATBbits.LATB0 = 1; // RB-1 to High
                                LATBbits.LATB1 = 1; // RB-1 to High
                                 delayzz();
                                LATBbits.LATB0 = 0; // RB-0 to LOW
                                LATBbits.LATB1 = 0; // RB-0 to LOW
                                 delayzz();
                              }
        }
i.ddespot
 
Posts: 1
Joined: Mon Mar 07, 2016 3:24 pm

Re: PIC18f4550 + tinybootloader

Postby jtemples » Thu Mar 10, 2016 9:22 pm

I don't know anything about that particular bootloader, but if it lives at the end of program memory as you say, you need to tell the compiler not to use that area of flash when compiling the application. So you don't want to add an offset, you want to adjust the ROM ranges to exclude the bootloader area.
jtemples
Verified identity
 
Posts: 195
Joined: Sun May 25, 2014 2:23 am
Location: The 805
PIC experience: Professional 5+ years with MCHP products


Return to 16-Bit Core

Who is online

Users browsing this forum: No registered users and 9 guests

cron