Can i flash my code using LPUART_1 and without any debugger or OpenSDA in TWR-KE18F ?

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

Can i flash my code using LPUART_1 and without any debugger or OpenSDA in TWR-KE18F ?

2,165 Views
rohitchudasama
Contributor III

Lets see,

I have MKE18F512XXXXX and i want to flash a code in that but without any debugger or OpenSDA.

I want to use LPUART_1 to flash my code in my controller.

Is it possible and how ?

15 Replies

1,705 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi rohit chudasama,

    Of course you can!

    Because MKE18F512XXXXX already have the ROM bootloader,

pastedImage_1.png

You can use PTC7,PTC6.

Then please download our KBOOT2.0 from this link:

https://www.nxp.com/webapp/Download?colCode=NXP_KINETIS_BOOTLOADER_2_0_0&appType=license&Parent_node... 

Use KinetisFlashTool in folder:NXP_Kinetis_Bootloader_2_0_0\bin\Tools\KinetisFlashTool\win

Take TWR-KE18F as an example, after you click connect, you will find it connected successfully.

pastedImage_3.png

pastedImage_4.png

You can find, I can download the KE18F code with UART successfully.

Wish it helps you!

If you still have question, please let me know!


Have a great day,
Kerry

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

1,705 Views
rohitchudasama
Contributor III

Hello,

I unable to find Bootloader for MKE18F512VLL16.

So i am getting an Error like "Error: Connect device failed(Error: Initial ping failure: No response received for ping command."

Untitled.jpg

Thanks

0 Kudos

1,705 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi rohit chudasama,

     What the board you are using? Your own board or the official board from nxp?

     What the uart pin you are using?

     Is your COM3 the correct port for your uart pin? and whether it can work before?

     Besides, please try to power off the board, press the NMI pin to ground, then power on the board, release the NMI pin, and try to connect it again.

Have a great day,
Kerry

 

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

0 Kudos

1,705 Views
rohitchudasama
Contributor III

I am using TWR-KE18F board. I am trying this on UART_0 (default) and UART_1 (pin : 55,56,57,58).

I am getting the same error on both.my board is connected on COM3.

0 Kudos

1,705 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Rohit chudasama,

   What the tool you connect to COM3?

  Please also post your device manager.

33.jpg


Have a great day,
Kerry

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

0 Kudos

1,705 Views
rohitchudasama
Contributor III

Hello,

I am still getting same error.

I connect PC_RX to PTB1/LPUART0_TX and PC_TX to PTB0/LPUART0_RX. My connection block diagram is below.

I am using CP-2102 from silicon lab to connect TWR-KE18F to my PC. AND its connected on COM9.

Untitled2.jpg

I tried by connecting RTS and CTS too. But still result is same.

Untitled.jpg

Untitled1.jpg

Even i tried with different board rate. And by pressing SW2 and RESET together and by releasing RESET  and than SW2.

Thanks.... 

0 Kudos

1,705 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi rohit,

   You said you are using TWR-KE18F,  TWR-KE18F board already have the on board debugger and the virtual com port.

   Why I can't find the on board virtual com port on your side?

   What the on board debugger you are using? JLINK, CMISIS DAP or opensda?

   I think you need to make the on board com port work at first, then use the on board com port directly.


Have a great day,
Kerry

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

0 Kudos

1,705 Views
rohitchudasama
Contributor III

Hello,

I have TWR-KE18F board with MKE18F512VLL16 MCU.

At this time I am flashing my MCU using OpenSDA with JLINK debugger installed in it.

But I want to flash MKE18F512VLL16 without OpenSDA.

I connected TX pin of CP-2102 to LPUART0_RX (PTB0) and RX pin of CP-2102 to LPUART0_TX (PTB1).

But MCU in not detected in Kinetics flash tool. My com port (COM9) is detected.

Thanks

0 Kudos

1,705 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi rohit chudasama,

    You can use then opensda com port, it is UART0, not the opensda debugger.

    If the on board virtual com port(LPUART0, PTB0, PTB1) can download the code with the kinetis flash tool, then we can make sure your problem is caused by your CP-2102 or your CP-2102  connection.

    Use the on board Com at first.


Have a great day,
Kerry

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

1,705 Views
rohitchudasama
Contributor III

Hello,

Yeahhh, Its working now....!!!!

Can i download hex file in MCU or only BIN file supported ???

Thank you so much 

0 Kudos

1,704 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi rohit chudasama,

    From the kinetis Flash Tool User's guide.pdf in the kboot2.0, you can find:

4.2.2 Browse button
Click the "Browse" button to locate the application image that is written to the Kinetis device. Currently, the supported file
types are .bin, .sb, .hex, .s19, and .srec.

   Wish it helps you!

   If your question is solved, please help me to mark the correct answer to close this question, thank you!


Have a great day,
Kerry

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

0 Kudos

1,704 Views
rohitchudasama
Contributor III

Yes, i am using twr-ke18f.

But i want to flash my mcu without openSDA.

Jlink is installed now in my board debugger and it works fine.

Lets see if i have MKE MCU and i want to flash my code by using LPUART using com port so how can i do that ???

Rohit Chudasama

Firmware Engineer

Bazzaz Inc.

0 Kudos

1,704 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi rohit chudasama,

     From the KE18F MCU side, I can make sure it works with both LPUART0 and LPUART1, I also have give you the detail test result. I also use the USB to TTL tool, it works.

     But to your TTL to USB tool CP-2102 , I am not sure.

    Please check it, it is USB to 232 or USB to TTL, it is very important, because the control level is not the same.

    You also can use the oscilloscope to check the wave, whether it is the TTL uart wave, when you click the connect button, whether you CP-2102  can send our the UART data?


Have a great day,
Kerry

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

0 Kudos

1,704 Views
rohitchudasama
Contributor III

Hello,

I am sure that my CP-2102 is working fine.

I flash the uart app code using openSDA and I check the data transmission using CP2102. And it can send and receive the data via CP2102.

But I want to flash directly by CP2102 instead of using OpenSDA.

Thanks

0 Kudos

1,704 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Rohit chudasama,

     You said:UART_0 (default) and UART_1 (pin : 55,56,57,58).

     This is not correct, did you check the TWR-KE18F schematic?

     I think you connect to the wrong pin.

  1.PTB0, PTB1, it is connect to  the on board virtual com port.

pastedImage_1.png

2. PTC7, PTC6

pastedImage_2.png

In the post reply, I already give you the result which is based on the PTB0, PTB1.

Now, I give you my test result for PTC7, PTC6. You can connect the tower to the tower elevator board.

pastedImage_3.png

A41,A42.

But you need to find a TTL to USB tool, then the PC RX connect to PTC7, PC TX connect to PTC6.

Before you connect the kinetisFlashTool, please press the on board RESET button, and SW2 at the same time, then release the RESET button at first, then release the SW2 at last, take care this is very important.

The following is my test result:

pastedImage_4.png

pastedImage_5.png

Wish it helps you!


Have a great day,
Kerry

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

0 Kudos