Difficulty in Programming  the Internal flash of MCF52259

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Difficulty in Programming  the Internal flash of MCF52259

568 Views
payyans4u
Contributor I

Hi,

I am trying to program the internal Flash of MCF52259..i am using MQX 3.7 and CW v7.2....as i understand the internal flash size is of 512 Kb and it can be divided into sectors of 16 Kb each,giving 32 sectors in total...Now i want to hard code certain configuration parameters onto the flash which may take around 1Kb of space and want it to be protected..i tried doing the same by refering to the data sheet,but without success...Below is a sample code

 

 

flash_hdl = fopen("flashx:",NULL);
          /* Enable sector cache */
    _io_ioctl(flash_hdl, FLASH_IOCTL_DISABLE_SECTOR_CACHE, NULL);    
     fseek(flash_hdl,ROM_SETUP,IO_SEEK_SET);
    read(flash_hdl,&flash_data, sizeof(flash_data));
..........

             fseek(flash_hdl,ROM_SETUP,IO_SEEK_SET);
            i=write(flash_hdl, &flash_data, sizeof(flash_data));
            _time_delay(2000);
            fclose(flash_hdl);

 

and more importantly i want to specify the base address and end address where i want to write into...how can i do that....Your response is highly apppreciated

Labels (1)
0 Kudos
Reply
1 Reply

397 Views
payyans4u
Contributor I

s

0 Kudos
Reply