USB K22 flash

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

USB K22 flash

848件の閲覧回数
martindusek
Contributor V

Hi,

I'm sending some data via USB on MK22FN512 by:

USB_DeviceSendRequest(handle, ep, buffer, length);

If buffer is pointing to chip's flash area then the other doesn't receive correct data. If I move buffer to SRAM, then correct data passes through.

Is there anything I have to do to be able to send data from flash via USB?

ラベル(2)
0 件の賞賛
5 返答(返信)

687件の閲覧回数
mjbcswitzerland
Specialist V

Martin

You must give the USB master the correct Flash access privilege - see the FMC_PFAPR ( Flash Access Protection Register) .

Regards

Mark


uTasker developer and supporter (+5'000 hours experience on +60 Kinetis derivatives in +80 product developments)
Kinetis: http://www.utasker.com/kinetis.html

0 件の賞賛

687件の閲覧回数
martindusek
Contributor V

Hi Mark,

thanks. I can see that privileges can be set for Master 0, 1 and 2 in PFAPR on MK22FN512. But USB is Master 4. So it is still unclear for me what to set...

0 件の賞賛

687件の閲覧回数
mjbcswitzerland
Specialist V

Martin

For your device you need

FMC_PFAPR |= FMC_PFAPR_M4AP_RD;
which is

FMC_PFAPR |= 0x00000100;

Regards

Mark

0 件の賞賛

687件の閲覧回数
martindusek
Contributor V

OK, thanks. Then, there is a mistake in https://www.nxp.com/docs/en/reference-manual/K22P121M120SF7RM.pdf , page 600. M4AP field is not there.

0 件の賞賛

689件の閲覧回数
mjbcswitzerland
Specialist V

Martin

I have always worked with Rev. 3, 7/2014 version which shows it:

pastedImage_1.png

The NXP version Rev. 4, 8/2016

pastedImage_2.png

removes the fields to control masters 3 and above.

There are masters 0, 1, 2 and 4 according to the latest Crossbar switch diagram:

pastedImage_3.png

and so I believe that it is a documentation error. Probably the flags were cleaned up since there are no M3, M5, M6 or M7 masters but the M4 master was also deleted by mistake....

Regards

Mark

0 件の賞賛