Hi
I am working on MK22 kinetis board.I am using SDK 1.3 USB stack for MSD.
MSD is not getting detected when i connect it to hub. After debugging i got to know that "USBERR_TR_FAILED" is coming.
Can somebody please help me out understanding, why this error is coming?
Thank you in advance.
Regards.
Hi,
NXP provides the MCUXpresso SDK package v2.2 for K22 product with updated USB stack.
Please check and download related software package from here.
Wish it helps.
Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Hui_Ma,
I was debugging and found that USBERR_TR_FAILED is coming due to ERROR_PIDERR in _usb_khci_tr_done() function.
Can i know when PID error might happen?
Also one strange thing, when i run code in bootloader code, stack works fine but in application it gives above mentioned error.
Kindly suggest some idea to make my code work. Thank you.
Regards,
Aniket
Hi,
The ERROR_PIDERR is happen when the PID check field fails.
The PID field in token packets uses a simpler form of error checking. The lower four bits in the field are the PID, and the upper four bits are its complement. The receiver can check the integrity of the PID by complementing the upper four bits and ensuring that they match the PID. If not, the packet is corrupted and is ignored.
Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Hui_Ma,
thank you for the explanation.
but why the error is only coming in application code and not in the bootloader code, this is where i am wondering.
Regards,
Aniket
Hi Aniket,
Do you have re-initialization USB module at application code?
For you are using the old version SDK software, there with very limited support resource.
Could you try to use the latest MCUXpresso SDK v2.2 software for K22 product? Thanks.
Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Hui_Ma,
okay. I will integrate the MCUXpresso SDK v2.2 software for USB stack.
I have to run 2 Mass storage device and 1 speaker, in boot loader and application code.
i will keep updating here if i get any doubts or problem.
Thank you
Regards
Hi Hui_Ma,
i have integrated the latest USB stack in my code.
i have mounted 1 MSD on 0: and another on 1: , is this correct (as a two physical drives)?
Also when i am trying to change drive using f_chdrive(), its changing the drive variable CurrVol in code. But when i perform any operation it is performed on last drive which i have mounted.
please guide me on how to mount two MSD devices and access them simultaneously using FATfs.
Thank you.
Regards.
Hi,
Sorry, I have some confusion about your code/application.
There are two working mode for K22, which in bootloader mode and application mode.
During the bootloader mode, the K22 FS USB module works as one MSD device;
Then in application mode, the K22 FS USB module works with USB device composite as one MSD device and one USB speaker.
The two MSD device using the different memory range in RAM.
Please guide me if there with any misunderstanding about your code/application.
Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Hui_Ma,
in both application and bootloader mode, k22 works with 2 MSD and 1 speaker.
The two MSD device using the different memory range in RAM. how to check this? i have allocated the static memory in entire stack instead of dynamic memory.
Thank you.
Regards.
Hi,
Thank you. i am trying to integrate the new stack in my code now. but i dont see any function which will initialize the usb at the micro-controller level.
Aniket
Hi Aniket,
The <usb_device_khci.c> and related code located at [khci] folder is the driver implement the USB IP function.
Wish it helps.
Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------