overmindx
Joined: 06 Oct 2008 Posts: 43
|
bootloader with large code |
Posted: Sun Apr 22, 2012 10:00 pm |
|
|
Hi everyone, I want to implement a bootloading scheme to my code. I am using a pic18f46k20 and my code has used 68% of ram and 82% of rom. It is a large code that uses interrupts, adc, timers, serial, etc.
I found a bootloader code in this forum and I tested it to download a short piece of code and it works well. However, when I used it to download my large code, it just starts for a moment and then it stops.
I thought that if I just add this piece of code:
Code: |
#define LOADER_END 0x5FF
#define LOADER_SIZE 0x4FF
#define USE_STATEMENT_SIZE 0x100
#ifndef _bootloader
#if defined(__PCM__)
#build(reset=LOADER_END+1+USE_STATEMENT_SIZE, interrupt=LOADER_END+5+USE_STATEMENT_SIZE)
#elif defined(__PCH__)
#build(reset=LOADER_END+1+USE_STATEMENT_SIZE, interrupt=LOADER_END+9+USE_STATEMENT_SIZE)
#endif
#org 0, LOADER_END+USE_STATEMENT_SIZE {}
#endif
|
then it will run smoothly but it didn't. Please help. |
|