lucky
Microchip staff
   
Reged: Oct 06 2003
Posts: 1212
Loc: Brisbane, Australia
|
|
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.
|
TrieuP
Reged: Sep 23 2004
Posts: 10
Loc: CA, US
|
|
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
|
lucky
Microchip staff
   
Reged: Oct 06 2003
Posts: 1212
Loc: Brisbane, Australia
|
|
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.
|
TrieuP
Reged: Sep 23 2004
Posts: 10
Loc: CA, US
|
|
DO you have anything that can make it work for that chip bootloader?
-------------------- Developer
|
lucky
Microchip staff
   
Reged: Oct 06 2003
Posts: 1212
Loc: Brisbane, Australia
|
|
Quote:
DO you have anything that can make it work for that chip bootloader?
No, not yet.
-------------------- Matt Luckman
Microchip Technology Inc.
|
TrieuP
Reged: Sep 23 2004
Posts: 10
Loc: CA, US
|
|
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
|
Nick chen
Reged: Mar 28 2007
Posts: 37
|
|
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.
|
garth
  
Reged: Oct 16 2003
Posts: 482
Loc: Brisbane, Australia
|
|
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.
|
rpp
Reged: Jun 25 2007
Posts: 5
|
|
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
|
garth
  
Reged: Oct 16 2003
Posts: 482
Loc: Brisbane, Australia
|
|
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.
|