Error - UsbHidPeripheral() cannot open USB HID device while trying to use blhost on KBOOT

cancel
Showing results for 
Search instead for 
Did you mean: 

Error - UsbHidPeripheral() cannot open USB HID device while trying to use blhost on KBOOT

Jump to solution
2,200 Views
piotrcerba
Contributor III

I downloaded KBOOT package and uploaded the /apps/binaries/FRDM_KL43Z4.bin to my KL43Z board, while in BOOTLOADER mode.

While trying to ping the board within blhost directory (command: blhost --usb -- get-property 1) I am getting the following error:

"Error: UsbHidPeripheral() cannot open USB HID device (vid=0x15a2, pid=0x0073, sn=)."

The same goes with UART, no COM port is active.

Apparently the bootloader has changed, since it does not show up now as FRDM-KL43Z in My Computer, but somehow it does not work.

What am I doing wrong?

0 Kudos
1 Solution
1,147 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Piotr Cerba,

      If you want to check the 0X40D data, you can read the register FTFA_FOPT register in the debugger mode with the IDE after you download the code.

      Here I help you to create a KDS project, and modify the FTFA_FOPT to boot from the ROM, take care, the new create project is Booting from the Flash, this will cause you can't connect the blhost.

      The following is the test picture, you will find the FTFA_FOPT is 0XFD, this register is the data from 0X40D,.

9.jpg

  Actually, you can just download my code to your chip, then your chip must boot from ROM, and can connect to the blhost.

  Please download my code to your chip at first, then reconnect with the blhost again.

Wish it helps you!

If you still have question, please contact with me!
Have a great day,
Jingjing

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

View solution in original post

0 Kudos
12 Replies
1,147 Views
piotrcerba
Contributor III

Dear Alice_Yang​ and Jingjing Zhou​,

1. I use KBOOT 1.20 (FSL_Kinetis_Bootloader_1_2_0 folder after extracting the archive)

2. Yes, I have the PEMicro drivers installed, which were working correctly so far, so I assume they are not the problem.

3. Unfortunately I was not following the .pdf file you mentioned.

Now after reading it I can see that:

"To install the bootloader application, drag or copy and paste the appropriate binary (Tower or Freedom) file from

<install_dir>/targets/<device>/binaries"

What I did -> I dragged and dropped the FRDM_KL43Z4.bin file from /apps/binaries/ so apparently that was not a proper file?

4. Is there any already prepared .bin (or any other) bootloader file for KL43Z?

0 Kudos
1,147 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Piotr Cerba,

     Because kl43 have the ROM bootloader, you don't need to install the bootloader application at first.

    Please refer to the doc:Getting Started with the Kinetis ROM Bootloader.pdf, this document is for your KL43.

  1. check your COM in your computer management:

  This picture is from my side, my com is COM33, this step is very important!!!

5.jpg

2. Open a command prompt in the directory containing blhost. For Windows OS, it is <install_dir>/bin/win.

6.jpg

3. Ping the COM port in blhost

7.jpg

If you get the current version, you will pin the COM successfully.

4  Erase all flash, and write the KL43 application bin file

8.jpg

All these steps you can find it from Getting Started with the Kinetis ROM Bootloader.pdf, please try it again,  about the FRDM_KL43Z4.bin, you can find it from :FSL_Kinetis_Bootloader_1_2_0\FSL_Kinetis_Bootloader_1_2_0\apps\binaries

You need to copy FRDM_KL43Z4.bin to path:FSL_Kinetis_Bootloader_1_2_0\FSL_Kinetis_Bootloader_1_2_0\bin\win before you write it to your chip with UART ROM bootloader.

It works on my FRDM-KL43

Wish it helps you!

If you still have question, please contact with me!

Best Regards,

Jingjing

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,147 Views
piotrcerba
Contributor III

Dear Jingjing Zhou,

as I have said the PEMicro drivers are present of my PC, because previously with OpenSDA bootloader everything has worked correctly.

My COM port is 13, and the only way to check this is by loading the OpenSDA bootloader on the board.

Capture.PNG

---

With FRDM_KL43Z4.bin from FSL_Kinetis_Bootloader_1_2_0\apps\binaries (KBOOT) the port does not show up.

Capture3.PNG

----

After going to blhost directory and typing the command I get a following error (operating on OpenSDA):

Capture2.PNG

Error: Initial ping failure: No response received for ping command.

What am I doing wrong?

PS:

So far I am working only on MSD-DEBUG-FRDM-KL43Z48M_Pemicro_v117.SDA bootloader

0 Kudos
1,147 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Piotr Cerba,

Your operation step is correct.

I also use MSD-DEBUG-FRDM-KL43Z48M_Pemicro_v117.SDA bootloader.

Now, Could you check address 0X40D, check this address data?

You can download a code to the flash, then check address 0X40D, bit7-6 is the boot source selection, 00 boot from flash, 10 and11 all boot from ROM.

You should make sure your chip is booting from ROM, just when the chip is boot from ROM, you can use blhost to boot it from ROM.

Or you can do a mass erase by using the JLINK( use jlink bootloader then use JLINK commander to mass erase it) at first, because after mass erase, the chip must boot from ROM.

Wish it help you!

Jingjing

0 Kudos
1,147 Views
piotrcerba
Contributor III

Thank you for the answer Jingjing Zhou

Now, Could you check address 0X40D, check this address data?

You can download a code to the flash, then check address 0X40D, bit7-6 is the boot source selection, 00 boot from flash, 10 and11 all boot from ROM.

I am afraid I do not know how to check the memory after flashing the program to the board. Can you describe how to do it?

0 Kudos
1,148 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Piotr Cerba,

      If you want to check the 0X40D data, you can read the register FTFA_FOPT register in the debugger mode with the IDE after you download the code.

      Here I help you to create a KDS project, and modify the FTFA_FOPT to boot from the ROM, take care, the new create project is Booting from the Flash, this will cause you can't connect the blhost.

      The following is the test picture, you will find the FTFA_FOPT is 0XFD, this register is the data from 0X40D,.

9.jpg

  Actually, you can just download my code to your chip, then your chip must boot from ROM, and can connect to the blhost.

  Please download my code to your chip at first, then reconnect with the blhost again.

Wish it helps you!

If you still have question, please contact with me!
Have a great day,
Jingjing

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

View solution in original post

0 Kudos
1,147 Views
piotrcerba
Contributor III

Thank you Jingjing Zhou, with your project I managed to connect to the board with blhost and program the FRDM_KL43Z4.bin

Do I have the KBOOT bootloader now present on the board?

I am asking because the device still enumerates as FRDM-KL43Z drive and it seems there is no difference from OpenSDA bootloader. It still has .html file that redirects to PEMicro webpage.

Capture4.PNG

0 Kudos
1,147 Views
kerryzhou
NXP TechSupport
NXP TechSupport

That's very good.

Yes, after you program the FRDM_KL43.bin to your chip, then the code will run your FRDM_KL43.bin code, FRDM_KL43.bin is also from the KL43 driver, so you may see the same phenomena, if you want to see the difference, you can program your own .bin code to it.

  You don't need to care about the .html  file in Opensda, this is just the debugger, just for the code download and the virtul com.

Wish it helps you!


Have a great day,
Jingjing

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

0 Kudos
1,147 Views
piotrcerba
Contributor III

Is there any way to check the source code of FRDM_KL43.bin ?

In the future if I want to protect my board from eg. debugging do I need to set it somewhere in blhost.exe or do I need to program my own version of FRDM_KL43.bin?

0 Kudos
1,147 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Piotr Cerba,

      The source code of FRDM_KL43.bin should in the path:FSL_Kinetis_Bootloader_1_2_0\apps\flash_driver_api\MKL43Z4

    If you want to protect your chip from debugging, you just need to secure it in your .bin file is OK.

Wish it helps you!

If you still have question, please contact with me!


Have a great day,
Jingjing

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

0 Kudos
1,147 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Piotr Cerba,

    Just like Alice have said, you should refer to the Kboot user guide, you should make sure your board's CDC serial port works ok.

    Please check the serial port in Windows Device Manager, and make sure you have install the serial port driver before.

Wish it helps you!

If you still have question, please contact with us.

Have a great day,
Jingjing

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

0 Kudos
1,147 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Piotr,

Which version of KBOOT do you use ? The latest version is KBOOT 1.2.

Have you refer to this :

...\Freescale\FSL_Kinetis_Bootloader_1_2_0\FSL_Kinetis_Bootloader_1_2_0\doc\Kinetis Bootloader Demo Applications User's Guide.pdf .

according to this DOC, does it can work well ?

Hope it helps

Alice

0 Kudos