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 CCS Technical Support

PIC24E and write_program_memory

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



Joined: 28 Feb 2006
Posts: 151

View user's profile Send private message

PIC24E and write_program_memory
PostPosted: Fri Aug 29, 2014 12:46 pm     Reply with quote

Hi, im trying to use the function write_program_memory in a 24EP512GP806. But it seems that it doesnt make anything.

I have used this function on other pic16 and pic18, but never on this one.

Code:
for(address_erase=0;address_erase<0x557ff;address_erase+=(getenv("FLASH_ERASE_SIZE")/2))
      {
      write_program_memory(address_erase, data, 16);
      }


This should "destroy" the pic program... but it doesnt do anything... the pic keeps running normally.

Is there anything that im missing?
Ttelmah



Joined: 11 Mar 2010
Posts: 19529

View user's profile Send private message

PostPosted: Fri Aug 29, 2014 1:07 pm     Reply with quote

Obvious first thing, fuses?.
Second compiler version?.

Then the memory organisation is very different. Each word, is programmed as 32bits, but only holds 24bits. So you have three bytes holding data, then missing byte, then the next three etc..
The page is 1024bytes long, holding 768 bytes of useable data.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Aug 29, 2014 7:44 pm     Reply with quote

The OP said in a PM that he solved the problem by upgrading from
compiler vs. 5.008 to 5.026.
Ttelmah



Joined: 11 Mar 2010
Posts: 19529

View user's profile Send private message

PostPosted: Fri Aug 29, 2014 11:43 pm     Reply with quote

As I said, 'compiler version'?.

5.008, is very much a 'beta' version, so not surprised....
asmallri



Joined: 12 Aug 2004
Posts: 1635
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri Aug 29, 2014 11:49 pm     Reply with quote

Ttelmah wrote:
Obvious first thing, fuses?.
Second compiler version?.

Then the memory organisation is very different. Each word, is programmed as 32bits, but only holds 24bits. So you have three bytes holding data, then missing byte, then the next three etc..
The page is 1024bytes long, holding 768 bytes of useable data.


The "...("FLASH_ERASE_SIZE")/2" does not look right at all for this class of PIC.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
Ttelmah



Joined: 11 Mar 2010
Posts: 19529

View user's profile Send private message

PostPosted: Sat Aug 30, 2014 12:35 am     Reply with quote

Agreed, but it would still give the 'crash' expected from this code....
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