|
|
View previous topic :: View next topic |
Author |
Message |
naughty_mark
Joined: 29 Aug 2012 Posts: 97
|
Bootloader again, manually change hex file |
Posted: Wed Apr 17, 2013 6:17 pm |
|
|
Hi, everyone,
Sorry to bother you guys again, it is also about bootloader.
As we know CCS currently doesn't support auxiliary flash program of dsPIC33EP series micochip, and I tried to avoid using MPLAB compiler, because it is a little tough for me to change a compiler at this stage. So what I am trying to do is generate the bootloader code hex file which using main flash program memory address, then change the address and other settings manually to get a new hex file!
I am using dsPIC33EP256MU814 and CCS compiler 4.133.
I changed EVERYTHING that including:
1. address bytes in hex file. I move all address which originally locates from 0x200 to auxiliary address which from 0x7FC000.
2. I also change the content in GOTO instruction in Auxiliary GOTO address (0x7FFFC), I found the address of main function which indicates in main GOTO instruction address, and found where it should be in my auxiliary flash address, then put that new address into auxiliary GOTO instruction address.
3. I made c program to help me generate crc after I changed address in hex file, so crc is not a problem
4. I change the device configuration to make sure micochip reset on Auxiliary reset address
After all of those, I program my new hex file in, but nothing happened. I read out the content in microchip, and compare it with my new hex file. Everything exactly same except the device configuration part. The part in read out hex file is all 0. I tried my other program which is normally locate in main flash memory, downloaded and read out, they have some problem that only device config part are not the same. But the program works fine indeed.
Does anyone know where I forget to change in the hex file? Anything I did wrong?
Thanks a lot~~~
Mark |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19494
|
|
Posted: Thu Apr 18, 2013 3:22 am |
|
|
7FFFFC not 7FFFC
Best Wishes |
|
|
naughty_mark
Joined: 29 Aug 2012 Posts: 97
|
|
Posted: Thu Apr 18, 2013 4:11 pm |
|
|
Ttelmah wrote: | 7FFFFC not 7FFFC
Best Wishes |
Sorry Ttelmah,
I typed it wrongly in the topic, in my new hex file, it is 0x7FFFFC (virtual address, 0xFFFFF8). |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19494
|
|
Posted: Fri Apr 19, 2013 12:39 am |
|
|
OK.
The fact you are changing a config (entry 4 in your list), and then it is the config that is empty, suggests a problem here. Remember you need to read the whole page, modify just the bit you want, and then erase/write back the whole page. I'd suggest you are not writing back the other config fuses, and since the one you are changing is set to zero, the result is zero for the entire block....
Best Wishes |
|
|
|
|
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
|