Freescale USB stack v4.1.1

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

Freescale USB stack v4.1.1

ソリューションへジャンプ
1,624件の閲覧回数
izmile
Contributor III

Hi,

I am using Freescale USB stack v4.1.1 on K22 processor. I am defining my device descriptors on RAM memory as shown below.

uint_8 g_device_descriptor[DEVICE_DESCRIPTOR_SIZE]=

{

DEVICE_DESCRIPTOR_SIZE,                /*  Device Descriptor Size         */

USB_DEVICE_DESCRIPTOR,                 /*  Device Type of descriptor      */

...

}

If I change the device descriptor (or any other descriptor) to FLASH area (as shown below) then I don't get proper USB enumeration.. Does Freescale USB stack work only with descriptors defined in RAM memory? I checked the K22 datasheet/reference, there is no restriction on the address in the BDT entry.

uint_8 const g_device_descriptor[DEVICE_DESCRIPTOR_SIZE]=

{

DEVICE_DESCRIPTOR_SIZE,                /*  Device Descriptor Size         */

USB_DEVICE_DESCRIPTOR,                 /*  Device Type of descriptor      */

...

}

Could any one shed some light on this please?

Thanks,

-Ismail

ラベル(3)
0 件の賞賛
返信
1 解決策
741件の閲覧回数
mjbcswitzerland
Specialist V

Hi Ismail

The USB controller can't access Flash by default so you need to enable its rights in the flash access protection register:

FMC_PFAPR |= FMC_FPAPR_USB_FS;

The USB FS is bus master 4 in the K22 so

#define FMC_FPAPR_USB_FS           

FMC_PFAPR_M4AP_RD

(which is 0x00000100)

Regards

Mark

Kinetis: µTasker Kinetis support

K22F: µTasker Kinetis FRDM-K22F support / µTasker Kinetis TWR-K22F120M support

For the complete "out-of-the-box" Kinetis experience and faster time to market


元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
741件の閲覧回数
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Ismail,

If you put code running in flash as well, you might have to reconfigure the Crossbar Switch to let USB has higher priority than ARM core, please kindly refer to Priority Registers Slave(AXBS_PRSn) for more details.


Have a great day,
Kan

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

741件の閲覧回数
izmile
Contributor III

Hi Mark and Li,

You both are correct. Now, I could make the USB working from flash.

Thanks a lot.

-Ismail

0 件の賞賛
返信
742件の閲覧回数
mjbcswitzerland
Specialist V

Hi Ismail

The USB controller can't access Flash by default so you need to enable its rights in the flash access protection register:

FMC_PFAPR |= FMC_FPAPR_USB_FS;

The USB FS is bus master 4 in the K22 so

#define FMC_FPAPR_USB_FS           

FMC_PFAPR_M4AP_RD

(which is 0x00000100)

Regards

Mark

Kinetis: µTasker Kinetis support

K22F: µTasker Kinetis FRDM-K22F support / µTasker Kinetis TWR-K22F120M support

For the complete "out-of-the-box" Kinetis experience and faster time to market


0 件の賞賛
返信