|
|
View previous topic :: View next topic |
Author |
Message |
Charles Linquist
Joined: 07 May 2005 Posts: 28 Location: Campbell, CA
|
Newbie bootloader question |
Posted: Tue May 10, 2005 9:40 pm |
|
|
I'm a newbie to 'C'. I am good with PicBasic Pro, but need more functionality (e.g. good interrupt handling) than I can achieve with Basic. When programming in BASIC, I regularly use "MC Loader", an extremely good bootloader, but it is proprietary and can't be modified by the user. As part of my 'C' education, I downloaded the Byte Factory bootloader from the CCS Code Library. The bootloader was written for the 18F452. I compiled the un-modified source and programmed it into an 18F452 using my Microchip ICD2. Then I loaded my HEX file into the '452 over the serial port. All worked perfectly. My application ran!
But I also need the bootloader to work with the 18F8720. Because of the '8720s much larger memory space, I changed MAX_LOADABLE to 0xFD00 from 0x6820 (the value it was for the '452). Also, I changed the #include to <18F8720.h>
Because of the large amount of code I need to download, I upped the baud rate to 57,600. My 8720 is running 20Mhz, so I didn't think that would be a problem. I compiled without errors, and programmed the code into the chip using the ICD2.
To load the code into the PIC, I use TerraTerm Pro and set the end-of-line delay to 10mSec as suggested by the bootloader code's author.
All SEEMS to work fine, until I get near the end of the load. I get a bunch of messages such as "000000011BEC Skip,000000011BED Skip..."
I tried various values for MAX_LOADABLE, but nothing seems to work.
Can anyone tell me what I'm doing wrong? How can I get this bootloader to work for me?
TIA
Charles Linquist |
|
|
Ttelmah Guest
|
|
Posted: Wed May 11, 2005 3:54 am |
|
|
Try 0xE820 for max-loadable (the figure for the 452, +0x8000). I'd suspect that the compiler is failing to 'error' that the code does not fit, perhaps wrapping at the top of memory. The figure you are using sounds very much to high. 'Skip' errors are normal. The codeloader will not transfer values to the configuration register area, and normal .hex files will include these, but yours are occuring at the wrong place. I'd think you should change the line in the program:
else if (address <= 0x00007FFF) {
To read:
else if (address <=0x0000FFFF) {
This line tests code lines that are above 'max loadable', against the maximum memory address. I think what is happening, is that you are getting lines that overlap the loader area, but then do not get picked up by this test, because it has the wrong value for the top of memory, so accidentally drop through into the 'skip' warning.
Best Wishes |
|
|
Guest
|
|
Posted: Wed May 11, 2005 12:42 pm |
|
|
I did what you said, but now I get the following message:
00000000E820 Overlap
I don't think I should be getting this "Overlap", because the last few lines of my HEX file is
:10B420001F502120866F120033C134F132C133F135
:10B4300031C132F130C131F12FC130F1120030C1D0
:10B440002FF131C130F132C131F133C132F134C1A8
:10B4500033F10101FF0E346F000112000300FED72B
:020000040030CA
:04000000FFF9FFFF06
:02000600FBFFFE
:0200000400F00A
:020050000000AE
:00000001FF
I beleive that means that the highest memory segment I'm using is 0Xb450
Is that correct? |
|
|
Ttelmah Guest
|
|
Posted: Wed May 11, 2005 2:07 pm |
|
|
The records at the end, talk to a higher memory address. The records starting with '04', and '02', are extended address records. The values in these, are added to the address of subsequent records. These overlap the loader address.
Best Wishes |
|
|
Guest
|
|
Posted: Wed May 11, 2005 4:44 pm |
|
|
So I think that means that my compiler is adding the code in high memory, and the only way around this is to change the compiler settings such that it doesn't do this - is that correct? |
|
|
|
|
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
|