PIC18 app firmware execution issue after firmware upgrade
MPLAB-X v5.15 IDE
Problem: After firmware flashed using on-chip bootloader (0x0000 - 0x07FF flash area), it seems that loaded app firmware doesn't work.
We have made first bootloader which contains I2C slave functionality to get app hex file from host based I2C master, and loaded first into PIC flash memory boot block. Then just made very small sample app to blink RA5 output, loaded this hex file successfully uisng i2c communication and at last reset it using RESET statement. But when we verify using DMM at RA5, no toggle occurs as we implement in app code like 3 sec high and 3 sec low in while(1) loop.
We are flashing bootcode in 0x0000 - 0x07FF area of flash memory.
For app firmware, we have given code offset as 0x0800 and ROM range as 800-1FFFF, in linker options.
Since PIC18F27k40 has 128 bytes write-block needed, we have modified application hex file to make full (16 bytes) line data and to align with 128 bytes block write. We added some padded data. Finally, by reading back flashed app code, we could verify that original hex file data is correctly written. But somehow after reset, app firmware doesn't seem to work. For this simple app, we are not flashing config word since it is same as what is flashed while bootloader flashed. Also let me attach our app hex file ( actual and padded) for let you know that how we padded extra bytes and lines to make 128 bytes block wise writing.
If anyone has idea, what could be wrong, please let me know.