Freescale USB stack v4.1.1

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Freescale USB stack v4.1.1

跳至解决方案
1,507 次查看
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

0 项奖励
1 解答
624 次查看
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 回复数
624 次查看
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!
-----------------------------------------------------------------------------------------------------------------------

624 次查看
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 项奖励
625 次查看
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 项奖励