56F83xxx memory read/write

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

56F83xxx memory read/write

ソリューションへジャンプ
2,570件の閲覧回数
Ben
Senior Contributor I

Hello

anyone can explain the fact that when I write data to the 56F83783 chip's flash address 20000, I see in  the debug window that my data is actually written to 30000. I have to read it from 30000 to get the written data. all written data has the same offset. please explain the logic and the correct writing process. Thanks.

タグ(2)
0 件の賞賛
返信
1 解決策
2,465件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I come to know your question. I run the PFlash example in SDK. This is the screenshot of PUTTY menu:

xiangjun_rong_0-1733383301051.png

The address P:0x3_F800->0x4_0000 are Byte address, the real P flash address should be right shift by 1 bit. Or the real address is 0x1_FC00 to 0x2_0000

I checked the address of P:0x1_FC00

xiangjun_rong_1-1733383512517.png

You can see that the P:0x1_FC00 has changed

xiangjun_rong_2-1733383586858.png

You can see that X:3_FC00 also changed.

If it can not answer your question, pls update the ticket.

Hope it can help you

BR

XiangJun Rong

 

元の投稿で解決策を見る

0 件の賞賛
返信
8 返答(返信)
2,550件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I suggest you refer to the application note:

https://www.nxp.com.cn/docs/en/application-note/AN1952.pdf

But it is based on DSP56800 core, the MC56F83xxx use DSP56800EX core, so the assembly language has to be modified to adapt to the DSP56800EX core.

for reading P memory:

asm short pmemreadns(void * addressFrom,void * addressTo,unsigned short nelem)
{
do Y0,endr
move.w P:(R2)+,y0//addressFrom
move.w y0,x:(R3)+//addressTo
endr:
rts
}

Hope it can help you

BR

Xiangjun Rong

 

0 件の賞賛
返信
2,541件の閲覧回数
Ben
Senior Contributor I

Hi Rong, thank you for the fast reply. So actually you say that by using the library functions I will not see the address offset I wrote about?

0 件の賞賛
返信
2,531件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

The AN gives source code based on DSP56800 core instead of library.

You should modify the source code to adapt to the DSP56800EX core because the MC56F83xxx use DSP56800EX core. BTW, the calling convention is the same for the CW compiler.

Hope it can help you

BR

XiangJun Rong

0 件の賞賛
返信
2,518件の閲覧回数
Ben
Senior Contributor I

sorry, I appreciate your help, but it did not help. I am using the flash space, and is not working with routines like pmemwrite.

anyhow, after investigation where my data is written, I bypassed the problem by adding the address offset while reading my data. I just wanted to understand the reason to the offset.why writing to address 20000... data is written to 30000...

thanks Rong

BR

benny

0 件の賞賛
返信
2,516件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Can you clarify your question?

This is the program memory map of 56F83xxx.

The same memory space are mapped to both Program space P: and data space X:

Furthermore, the 128KW memory are classified as bank 0 and bank 1.

for example the 64KW memory(bank0) is located at P:0x0000 to 0x FFFF, meanwhile, it is also mapped to X:2_0000 to 0x2_FFFF

another 64KW memory(bank1) is located at P:0x1_0000 to 0x1_ FFFF, meanwhile, it is also mapped to X:3_0000 to 0x3_FFFF

xiangjun_rong_0-1733303520740.png

If it does not answer your question, I am sorry, pls clarify your question.

 

BR

XiangJun Rong

 

0 件の賞賛
返信
2,502件の閲覧回数
Ben
Senior Contributor I

sorry rong, probably I did not explain myself and cause a confusion:

56F83783

I am writing and reading to the data memory, NOT program memory. when I write data to 2A000 I can see the written data in the debug window at address 35000. if I want to read it - I can read from 35000 and get the data. I am working with it, but do not understand the reason to this offset. (constant B000). it is very strange. both addresses are used by X databus, so writing data to an address should be read at the same address.

I am working with this offset for writing and reading data, and my application works good....

ben

0 件の賞賛
返信
2,466件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I come to know your question. I run the PFlash example in SDK. This is the screenshot of PUTTY menu:

xiangjun_rong_0-1733383301051.png

The address P:0x3_F800->0x4_0000 are Byte address, the real P flash address should be right shift by 1 bit. Or the real address is 0x1_FC00 to 0x2_0000

I checked the address of P:0x1_FC00

xiangjun_rong_1-1733383512517.png

You can see that the P:0x1_FC00 has changed

xiangjun_rong_2-1733383586858.png

You can see that X:3_FC00 also changed.

If it can not answer your question, pls update the ticket.

Hope it can help you

BR

XiangJun Rong

 

0 件の賞賛
返信
2,461件の閲覧回数
Ben
Senior Contributor I

Hi rong

saw your example. you wrote to P:1FC00 and saw the data at X:3FC00. it is normal as in the manual it is written that x:20000-3ffff is mapped from p:0-1ffff.

in my case, I am writing data to x:2A000 and see it at x:35000. reading x:2A000 gives 0.

anyhow, I hope that this is my last project with this old family. I am checking the A153. hope it will be good for industrial / motor applications.

Thank you

you gave me good support for the last several years, with this family components.

BR

ben 

0 件の賞賛
返信