Difficulty in Programming  the Internal flash of MCF52259

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Difficulty in Programming  the Internal flash of MCF52259

546 次查看
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

标签 (1)
0 项奖励
回复
1 回复

375 次查看
payyans4u
Contributor I

s

0 项奖励
回复