Freescale USB stack v4.1.1

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Freescale USB stack v4.1.1

Jump to solution
1,481 Views
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 Kudos
1 Solution
598 Views
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


View solution in original post

0 Kudos
3 Replies
598 Views
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!
-----------------------------------------------------------------------------------------------------------------------

598 Views
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 Kudos
599 Views
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 Kudos