How can I read out the Program Flash frdm-kl27z

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

How can I read out the Program Flash frdm-kl27z

ソリューションへジャンプ
1,291件の閲覧回数
lorismichielutt
Contributor I

Hi,

 

I would like to read out the Program Flash.

The erase and write operations are OK!

 

in attach the example with KSD-3.0 and SDK 1.3

 

Any suggestions, thank.

 

B.R.

 

Loris

Original Attachment has been moved to: prjFrdmkl27z_deb_ledRGB_tim1_tpm_flash.zip

ラベル(1)
0 件の賞賛
返信
1 解決策
1,037件の閲覧回数
DavidS
NXP Employee
NXP Employee

Hi Loris,

Are you only trying to access the Flash program space?

If yes, then you can do one of the following as you do not need any special flash read function call:

#define READ8(address)              ((uint8_t)(*(vuint8_t*)(address)))
#define READ16(address)            ((uint16_t)(*(vuint16_t*)(address)))
#define READ32(address)            ((uint32_t)(*(vuint32_t*)(address)))

for example, you can use the following code to access flash no matter whether the flash save data or code.

uint16_t value, i, *pSrc, *pDest;

pSrc=0xxxxxxxx;

value=READ16(pSrc);

pSrc++;

OR

   unsigned int *read_flash;
   volatile unsigned int temp;
  
   read_flash = *((unsigned int *)0x0003FFE0);
   temp = ((unsigned int *)read_flash);

Regards,

David

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,037件の閲覧回数
lorismichielutt
Contributor I

Thank so much.

B.R.

Loris

0 件の賞賛
返信
1,038件の閲覧回数
DavidS
NXP Employee
NXP Employee

Hi Loris,

Are you only trying to access the Flash program space?

If yes, then you can do one of the following as you do not need any special flash read function call:

#define READ8(address)              ((uint8_t)(*(vuint8_t*)(address)))
#define READ16(address)            ((uint16_t)(*(vuint16_t*)(address)))
#define READ32(address)            ((uint32_t)(*(vuint32_t*)(address)))

for example, you can use the following code to access flash no matter whether the flash save data or code.

uint16_t value, i, *pSrc, *pDest;

pSrc=0xxxxxxxx;

value=READ16(pSrc);

pSrc++;

OR

   unsigned int *read_flash;
   volatile unsigned int temp;
  
   read_flash = *((unsigned int *)0x0003FFE0);
   temp = ((unsigned int *)read_flash);

Regards,

David

0 件の賞賛
返信