Bootloader in half-duplex (RS485) environment

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

Bootloader in half-duplex (RS485) environment

Jump to solution
4,772 Views
robertpoor
Senior Contributor I

My client is building a system that will be potted in epoxy with half-duplex RS485 as the sole communication link to the KL27Z (notably there is no JTAG).  This means that any character that the KL27Z transmits over LPUART0 will be simultaneously received by LPUART0.

In our firmware, we avoid these "ghost echo" characters by disabling LPUART's receiver whenever we transmit a character.  (This is safe because our RS485 protocols are strictly master / slave, and the master won't be trying to transmit serial data when the KL27Z is transmitting.)

I gather that I'll need to write a custom flash-based bootloader to work in this situation.  My current development plan is as follows:

  1. Verify that I can communicate with the ROM-based bootloader on a stock FRDM-KL27Z via blhost [DONE]
  2. Compile an unmodified flash-based bootloader for the FRDM-KL27Z board
  3. Load unmodified flash-based bootloader into the FRDM-KL27Z board and confirm I can communicate with it via blhost
  4. Modify the bootloader for half-duplex RS485 serial communication (by disabling LPUART receiver whenever transmitting a character)
  5. Verify operation on custom KL27Z based board

I'm currently stuck at step 2: where do I find the recipe for the 2.0 bootloader, including compiling from source code and loading into the FRDM27 board?

Thanks in advance!

Labels (1)
0 Kudos
1 Solution
4,048 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

The IDE software could select IAR, KDS or Keil.

The bootloader project for KDS IDE could be found with below path:

..\NXP_Kinetis_Bootloader_2_0_0\targets\MKL25Z4\kds

For you are using FRDM-KL25Z, you need to select the [freedom_bootloader] demo, which located at :

..\NXP_Kinetis_Bootloader_2_0_0\targets\MKL25Z4\kds\freedom_bootloader

Then you need use KDS software menu [File]->[Import]->[Existing Project into Workspace], then to select the root directory and following the wizard to import the project.

pastedImage_1.png

Wish it helps.


Have a great day,
Ma Hui

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

View solution in original post

6 Replies
3,688 Views
ac80
Contributor II

Hey there robertpoor,

We're just looking to do exactly this. Seems straight forward, but thought I would check to see if you're still around and have anything to pass on from your experience. 

Cheers! 

~ac80

0 Kudos
4,048 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

First of all, sorry for the later reply.

For the KL27 product provides ROM bootloader, customer need to refer the bootloader for other L series product, such as KL25/KL26.

The bootloader v2.0 for KL25 software located at ..\NXP_Kinetis_Bootloader_2_0_0\targets\MKL25Z4\iar folder.
Customer could refer and using LPUART module driver instead of UART module.
The AN2295 is also about the serial bootloader, which also provide serial bootloader for Kinetis L family.
Wish it helps.


Have a great day,
Ma Hui

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

4,048 Views
robertpoor
Senior Contributor I

Hello Ma Hui:

I've downloaded NXP_Kinetis_Bootloader_2_0_0/, and I have a simple question: How do I compile the flash-based bootloader for the MKL25Z4 target?

Is there a project file to import into KDS?  Is there a Makefile?  My goal is simply to compile an image that I can load into a FRDM-KL25Z board to verify that I've made a working flash-based bootloader, but I don't see how to do that.

Thanks in advance.

- Robert Poor

0 Kudos
4,049 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

The IDE software could select IAR, KDS or Keil.

The bootloader project for KDS IDE could be found with below path:

..\NXP_Kinetis_Bootloader_2_0_0\targets\MKL25Z4\kds

For you are using FRDM-KL25Z, you need to select the [freedom_bootloader] demo, which located at :

..\NXP_Kinetis_Bootloader_2_0_0\targets\MKL25Z4\kds\freedom_bootloader

Then you need use KDS software menu [File]->[Import]->[Existing Project into Workspace], then to select the root directory and following the wizard to import the project.

pastedImage_1.png

Wish it helps.


Have a great day,
Ma Hui

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

4,048 Views
robertpoor
Senior Contributor I

Ma Hui: Yes - that was the info I needed to get going.  I have other questions, but I'll start a separate thread for them -- in the meantime, I'm marking this as the correct answer.  Many thanks.

0 Kudos
4,048 Views
robertpoor
Senior Contributor I

Thank you.  I'll start with the flash bootloader for the KL25 and see if I can get it compiled and loaded onto the FRDM KL27Z.  Thank you for the pointer to AN2295.

Best,

- rdp

0 Kudos