moutinho
Joined: 12 May 2005 Posts: 31 Location: BRAZIL
|
Bootloader Problem |
Posted: Tue Nov 28, 2006 1:15 pm |
|
|
Hi,
I am implementing a bootloader using PIC18F8520 and MPLAB 7.21/CCS 3.206. The bootloader receives the application HEX code using UART.
The application code and bootloader are implemented in the SAME project and sent to the PIC using a ICD 2.
The bootoloader area is locate at memory range defined by the folowing defines:
#define LOADER_END getenv("PROGRAM_MEMORY")-1
#define LOADER_SIZE 0x1000
#define LOADER_ADDR (LOADER_END-LOADER_SIZE)
The main() function is also located at the bootloader area and calls the true main application (_main()).
The application code is located in the section (0, LOADER_ADDR-1)
I have the following doubts:
1) When I do the bootloader process using the same code that is currenctly running (e.g from version 0.9 to version 0.9) the application runs without problems after restarting the application.
If I update from one version to another (e.g 0.9 to 1.0), the newer application does not run properly. It seems to start correctly but blocks after some time.
I have read the device memory after the bootloader process and compared to the original HEX file. The application memory are identical. The only difference was located at bootloader section.
Does anyone know what may be going on ?
2) Can I put the bootloader and application on the same project ? In other words, can I program the application and bootloader at the same time or I do need to program first the bootloader and them the application. Is it possible using ICD2?
3) Can I use ICD2 to program the bootloader ?
4) Do I have to set another reset/interrupt vector addresses despite having the bootloader located at the end of the memory ?
5) I also have notice that the assembler code generated for the bootloader is different between two version where the difference is only located at application program code. Does anyone can explain this?
Thanks in advance,
André Moutinho |
|