PICmicro & dsPIC >> Source Share for PICmicro & dsPIC

Pages: 1 | 2 | >> (show all)
luckyAdministrator
Microchip staff
*****

Reged: Oct 06 2003
Posts: 1212
Loc: Brisbane, Australia
Bootloader for 16F and 18F PICs
      #26726 - Fri Mar 23 2007 12:08 AM Attachment (1893 downloads)

We include bootloaders for 16F and 18F pics with the compiler (they're in the compiler's samples directory), however it seems many people aren't aware of this. Because of this, I'm attaching them here.

Included in the attachment are all the different revisions of the 16F bootloader we have used over the years (about 4 different versions) and the 18F version. It is still probably best to check the version that came with your compiler as it may be newer.

You may use these at your own risk for any purpose.

A discussion about the implementation of the 16F bootloader can be found here.

--------------------
Matt Luckman
Microchip Technology Inc.


Post Extras: Print Post   Remind Me!   Notify Moderator  
TrieuP



Reged: Sep 23 2004
Posts: 10
Loc: CA, US
Re: Bootloader for 16F and 18F PICs [Re: lucky]
      #26771 - Tue Mar 27 2007 04:30 AM

I downloaded the attachment and tried to recompile it with the PIC18F67J10 target. The code did not compile. I have attached here the error log for you to review.

Error log =======================================
Executing: "C:\HTSOFT\PIC18\bin\picc18.exe" -C -E"bootldr.cce" "bootldr.c" -O"bootldr.obj" -Zg9 -O -DVERBOSE -ASMLIST -Q -MPLAB -18F67J10
Error[000] C:\projects\PIC\bootldr-V1\bootldr.c 104 : undefined identifier: EEDATA
Warning[000] C:\projects\PIC\bootldr-V1\bootldr.c 109 : implicit signed to unsigned conversion
Error[000] C:\projects\PIC\bootldr-V1\bootldr.c 126 : undefined identifier: WREN
Error[000] C:\projects\PIC\bootldr-V1\bootldr.c 127 : undefined identifier: EECON2
Error[000] C:\projects\PIC\bootldr-V1\bootldr.c 129 : undefined identifier: WR
Error[000] C:\projects\PIC\bootldr-V1\bootldr.c 173 : undefined identifier: SPBRG
Error[000] C:\projects\PIC\bootldr-V1\bootldr.c 173 : undefined identifier: TXSTA
Error[000] C:\projects\PIC\bootldr-V1\bootldr.c 173 : undefined identifier: RCSTA
Error[000] C:\projects\PIC\bootldr-V1\bootldr.c 220 : undefined identifier: EECON1
Error[000] C:\projects\PIC\bootldr-V1\bootldr.c 229 : undefined identifier: _ROMSIZE
Error[000] C:\projects\PIC\bootldr-V1\bootldr.c 250 : undefined identifier: EEADR
Error[000] C:\projects\PIC\bootldr-V1\bootldr.c 259 : undefined identifier: EEPGD
Error[000] C:\projects\PIC\bootldr-V1\bootldr.c 265 : undefined identifier: EEDATA
Error[000] C:\projects\PIC\bootldr-V1\bootldr.c 267 : undefined identifier: CFGS
Error[000] C:\projects\PIC\bootldr-V1\bootldr.c 303 : undefined identifier: CFGS
Halting build on first failure as requested.
BUILD FAILED: Tue Mar 27 01:03:08 2007

--------------------
Developer


Post Extras: Print Post   Remind Me!   Notify Moderator  
luckyAdministrator
Microchip staff
*****

Reged: Oct 06 2003
Posts: 1212
Loc: Brisbane, Australia
Re: Bootloader for 16F and 18F PICs [Re: TrieuP]
      #26783 - Tue Mar 27 2007 05:00 PM

Quote:

I downloaded the attachment and tried to recompile it with the PIC18F67J10 target. The code did not compile




That chip is not supported - it doesn't have the SFRs that the bootloader is using (the chip has a different method of writing to flash).

--------------------
Matt Luckman
Microchip Technology Inc.


Post Extras: Print Post   Remind Me!   Notify Moderator  
TrieuP



Reged: Sep 23 2004
Posts: 10
Loc: CA, US
Re: Bootloader for 16F and 18F PICs [Re: lucky]
      #26784 - Tue Mar 27 2007 10:59 PM

DO you have anything that can make it work for that chip bootloader?

--------------------
Developer


Post Extras: Print Post   Remind Me!   Notify Moderator  
luckyAdministrator
Microchip staff
*****

Reged: Oct 06 2003
Posts: 1212
Loc: Brisbane, Australia
Re: Bootloader for 16F and 18F PICs [Re: TrieuP]
      #26901 - Tue Apr 03 2007 05:39 PM

Quote:

DO you have anything that can make it work for that chip bootloader?




No, not yet.

--------------------
Matt Luckman
Microchip Technology Inc.


Post Extras: Print Post   Remind Me!   Notify Moderator  
TrieuP



Reged: Sep 23 2004
Posts: 10
Loc: CA, US
Re: Bootloader for 16F and 18F PICs [Re: lucky]
      #26902 - Tue Apr 03 2007 06:27 PM Attachment (593 downloads)

I have attached here is the code bootloader code modified for the PIC18F67J10. It is WIP but will compiled and run. However, I tested and nothing written to the flash. I am not sure why. I have check many time with the flash spec and very sure all steps are followed precisely.
If you can give it a try and let me know if you can help me figure out the problem.

-Thanks

--------------------
Developer


Post Extras: Print Post   Remind Me!   Notify Moderator  
Nick chen



Reged: Mar 28 2007
Posts: 37
Re: Bootloader for 16F and 18F PICs [Re: lucky]
      #27989 - Tue Jun 12 2007 01:19 AM

Dear sir,

I compile the bootloader v3.11,but have some error as followings,

Error[192] D:\BOOTLOADER V3.11\bootldr.c 251 : undefined identifier "_ROMSIZE"
Error[192] D:\BOOTLOADER V3.11\bootldr.c 295 : undefined identifier "_ROMSIZE"
Error[192] D:\BOOTLOADER V3.11\bootldr.c 251 : undefined identifier "_ROMSIZE"
Error[192] D:\BOOTLOADER V3.11\bootldr.c 295 : undefined identifier "_ROMSIZE"

How do I solve this?
Thanks very much.


Post Extras: Print Post   Remind Me!   Notify Moderator  
garth

****

Reged: Oct 16 2003
Posts: 482
Loc: Brisbane, Australia
Re: Bootloader for 16F and 18F PICs [Re: Nick chen]
      #27999 - Tue Jun 12 2007 07:10 PM

If you're using a PICC or PICC-Lite compiler older than version 9.60, you'll need to define this symbol yourself. The best place to do this would be on the compiler's command line with a -D option. For example, -D_ROMSIZE=8192. This value corresponds to the number of words of program memory on your device. From version 9.60 onward, this symbol is defined automatically by the compiler.

Post Extras: Print Post   Remind Me!   Notify Moderator  
rpp



Reged: Jun 25 2007
Posts: 5
Re: ROMSIZE define error [Re: garth]
      #28440 - Thu Jul 12 2007 05:07 PM

Hi, Last week I was using PICC-18 8.35PL3, MPLAB 7.6, developing for the PIC18F87J10. My project was based on the bootloader code in the "samples" directory, which used "ROMSIZE" in bootldr.h. The .h file referenced a chip specific header file, which I thought was the "picc-18.ini" file located in the "lib" directory. So I didn't define it. Everything compiled fine, and I assumed the picc-18.ini file handled it.

I'm now using PICC-18 9.50PL3 with MPLAB 7.6, and I'm getting the "undefined identifier" error for "ROMSIZE", which surprises me because the "picc-18.ini" file exists, albeit, in the "dat" directory for 9.5PL3.

Does PICC-18 9.5PL3 use the ROMSIZE define in the picc-18.ini file ? Does it use any of the chip info in that file ?

Thanks, mm


Post Extras: Print Post   Remind Me!   Notify Moderator  
garth

****

Reged: Oct 16 2003
Posts: 482
Loc: Brisbane, Australia
Re: ROMSIZE define error [Re: rpp]
      #28869 - Fri Jul 27 2007 01:54 AM

To quote the release notes:
Quote:

Memory symbols (9.10) New preprocessor symbols are defined by the driver to de-
fine the ammount of program memory, RAM and EEPROM memory. These
symbols are named _ROMSIZE, _RAMSIZE, _EEPROMSIZE respectively.





The old ROMSIZE definition had to go because it was in the user's name-space. You can get the same value by reading _ROMSIZE instead.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1 | 2 | >> (show all)



Extra information
0 registered and 2 anonymous users are browsing this forum.

Moderator:  jtemples, Dan Henry, Andrew L, mikerj 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is enabled
      UBBCode is enabled

Rating:
Topic views: 39118

Rate this topic

Jump to

Contact Us | Privacy statement HI-TECH Software

Powered by UBB.threads™ 6.5.5