CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Bootloader again, manually change hex file

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
naughty_mark



Joined: 29 Aug 2012
Posts: 97

View user's profile Send private message

Bootloader again, manually change hex file
PostPosted: Wed Apr 17, 2013 6:17 pm     Reply with quote

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~~~ Embarassed
Mark
Ttelmah



Joined: 11 Mar 2010
Posts: 19452

View user's profile Send private message

PostPosted: Thu Apr 18, 2013 3:22 am     Reply with quote

7FFFFC not 7FFFC

Best Wishes
naughty_mark



Joined: 29 Aug 2012
Posts: 97

View user's profile Send private message

PostPosted: Thu Apr 18, 2013 4:11 pm     Reply with quote

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). Embarassed
Ttelmah



Joined: 11 Mar 2010
Posts: 19452

View user's profile Send private message

PostPosted: Fri Apr 19, 2013 12:39 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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