Difficulty in Programming  the Internal flash of MCF52259

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Difficulty in Programming  the Internal flash of MCF52259

545件の閲覧回数
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 返信

374件の閲覧回数
payyans4u
Contributor I

s

0 件の賞賛
返信