blhost error on TWR-K80F150M

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

blhost error on TWR-K80F150M

1,563 Views
ganesan_doraisa
Contributor II

The TWR-K80F150M is connected to COM12. In issuing the following command

"blhost.exe -p COM12 -- receive-sb-file hello_world_qspi.sb"

The CMD window puts a message,

"Ping responded in 1 attempt(s)

Error: Initial Ping failure: Unknown error code (5)"

What would cause this? I tried two different tower module off the box and same result.

Labels (1)
Tags (1)
0 Kudos
8 Replies

1,212 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Ganesan,

      Please refer to the document Kinetis Bootloader QuadSPI User's Guide.pdf, which you can find it from FSL_Kinetis_Bootloader_K80_Tools_1_0_0, this document give the details step about how to modify a normal application code to run from QuadSPI, please check it whether you miss any point at first.

     Beside, I will also try to modify the ucosiii_helloworld demo on my side, after I finish it, I will give you feedback.

Best Regards,

Jingjing

0 Kudos

1,212 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Ganesan Doraisami,

          Which KSDK version you are using now? KSDK1.3.0 or KSDK2.0 for TWR-K80F150M?

        When you use the command: blhost.exe -p COM12 -- receive-sb-file hello_world_qspi.sb

          Did you already get the hello_world_qspi.sb which is converted by elftosb tool?

        You should refer to the following readme  step to operation it:

Tool dependencies: Use the blhost and the elftosb tool included in Kinetis Bootloader for the K8x devices. The

package including these tools can be downloaded from https://www.nxp.com/webapp/Download?colCode=FSL_KINETIS_BOOTLOADER_K80_1_0_0&appType=license&locatio... .

Steps for running this demo:

1. Press and hold the SW2 button (NMI button) while connecting a USB cable between the PC host and the OpenSDA USB port

(or USB port on some boards) on the board. The button should be pressed until the openSDA USB port is connected.

2. Build the demo project and generate the .srec output file. The example requires the use of the SREC file format.

The project can generate the srec file directly. If you want to generate the src output file in another location,

use the following steps for your given toolchain:

  - IAR: open Option for demo Configuration -> Output Converter -> Choose "Generate additional output".

  Set the format as "Motorola", then rebuild the demo.

  - Keil: open Option for demo project -> User -> Choose "Post build" and write

    "fromelf.exe --m32combined  --output  "$L@L.srec"  "#L" "to the line.

  - KDS: open "Property" for demo project C/C++ Build -> Settings -> Toolchains -> Choose "Create flash image".

    Then C/C++ Build -> Settings -> Cross ARM GUN Create Flash Image -> General -> "Output file format". Choose "Motorola

    S-record" -> "OK".

  - Atollic: open "Property" for demo project C/C++ Build->Settings -> Tool settings -> Other -> Output format ->

    Choose "Convert Output" -> Choose "Format" to "S-record".

  - ARMGCC: Use the command "objcopy -O srec hello_world_qspi.elf hello_world_qspi.srec"

    to generate the srec output file.

3. Prepare the QSPI config block for BootROM.

    -  Generate qspi_config_block.bin using tools QCBGenerator in Kinetis Bootloader for the K8x devices, the path of

    the tool is in FSL_Kinetis_Bootloader_K80_Tools_1_0_0/FSL_Kinetis_Bootloader_K80_Tools_1_0_0/bin/win. Double click

    QCBGenerator.exe, it will generate a qspi_config_block.bin file.

      - If you are using a different flash chip, the qspi config block should be reconfigured in the source file, located in

    FSL_Kinetis_Bootloader_K80_Tools_1_0_0/demo/QCBGenerator. Users can use GCC/Visual Studio/Code Block to recompile

    a .bin file for the proper QSPI configuration block. The projects for VS and Code Block is provided in the folder.

    - For detailed information, see the documentation Kinetis Bootloader QuadSPI User's Guide.pdf in the Kinetis

    Bootloader tools downloaded.

4. Use elftosb tool to convert the srec image to secure binary (SB) format required by the blhost tool.

    - First a .bd file is needed, so open .bd file in:

    <SDK_Install>/boards/<board>/demo_apps/hello_world_qspi/hello_world_qspi.bd.

    When changing to another demo, change the srec file name in .bd file. Move the qspi_config_block.bin to the same

    folder with hello_world_qspi.bd, or change the path of qspi_config_block.bin in hello_world_qspi.bd file.

    - On the command line, use the command "./elftosb.exe -V -c hello_world_qspi.bd -o hello_world_qspi.sb" to generate an

    sb file.

5. Use blhost to configure the bootloader and download the image.

  - On the command line using blhost, "./blhost.exe -p COMxx -- receive-sb-file hello_world_qspi.sb" ("COMxx" means

  the virtual COM number of the board.)

  Notice:

      - If you are using UART as the communication interface between blhost and the target, do not open a terminal session until

      the flash is complete or the download may fail.

      - Some platforms can only use the USB port for hardware reasons, i.e., the Freescale Freedom FRDM-K82 development board. To use the USB interface, the command

      should be "./blhost.exe -u -- receive-sb-file hello_world_qspi.sb".

6. Open a serial terminal with the following settings:

    - 115200 baud rate

    - 8 data bits

    - No parity

    - One stop bit

    - No flow control

7. Press the reset button on your board.

8. You should see the "Hello World" string printed to your terminal.

    Besides, take care, you should put the file hello_world_qspi.sb in the folder:\FSL_Kinetis_Bootloader_K80_Tools_1_0_0\bin\win, just like the following picture:

58.jpg

I also attached my hello_world_qspi.sb for your reference.

Wish it helps you!

If you still have question, please contact me!


Have a great day,
Jingjing

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

0 Kudos

1,212 Views
ganesan_doraisa
Contributor II

Hi Kerry Zhou:

Although it was working once before, now I am getting the following. It looks like some bytes are not send due to kStatus_FlashCommand_Failure. Not sure what causes it.

0 Kudos

1,212 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Ganesan,

    Did you try to use the hello_world_qspi which I already give you?

    Whether that file can work ok on you side?

    You can't use the ucosIII hello world directly, you need to do icf modification.

    So, please use the hello_world_qspi file, and test it on your side at first.


Have a great day,
Jingjing

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

0 Kudos

1,212 Views
ganesan_doraisa
Contributor II

I should clarify,

the uCOSIII_Hello program do get program (all bytes transferred) but in reseting, the text “Hello World” does not get generated in serial console.

Bare with me because this is the first time of using this processor and using memory interface serially.

0 Kudos

1,212 Views
ganesan_doraisa
Contributor II

The hello_world_qspi works on the tower.

For the ucoiIII_hello project, I modified the following in the icf file and then build the “.sb” file exactly like the hello_world_qspi but it does not work.

define symbol m_text_start = 0x68001000; /* 0x00000410;*/

define symbol m_text_end = 0x69000000; /* 0x0003FFFF;*/

In startup_MK80F25615.s file, the following were changed also.

__FlashConfig

DCD 0xFFFFFFFF

DCD 0xFFFFFFFF

DCD 0xFFFFFFFF

DCD 0xFFFFBDFE ;0xFFFF3DFE

__FlashConfig_End

0 Kudos

1,212 Views
ganesan_doraisa
Contributor II

Hi Kerry:

The hello_world_qspi do download successfully but it has smaller in size than the uCosIII-Hello.

The uCOSIII-Hello downloaded once successfully and I was able to see messages on serial Terminal at baud rate 115200.

But when I tried second and third time, it shows only 5280 bytes transfered before FlashFailureCommand.

What are the changes one must make on the icf of the ucosIII-Hello example project?

0 Kudos

1,212 Views
ganesan_doraisa
Contributor II

Hi:

Thanks. The one thing missing was pressing SW2. I did press them before but always released after USB cable plugged. I had to see the openSDA port on device manager before releasing the button. Now it works.

Thanks very much for you help.

0 Kudos