Is it possible to load a user application onto the KL27Z with the ROM bootloader using SPI from a Raspberry Pi?

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

Is it possible to load a user application onto the KL27Z with the ROM bootloader using SPI from a Raspberry Pi?

Jump to solution
1,410 Views
tobyfrankau
Contributor I

I can use blhost to upload my application onto the KL27Z over USB but I want to be able to do it over SPI.

I know the blhost user guide says:

"The blhost and Kinetis Updater applications do not support firmware download over I2C and SPI

peripherals. Special hardware and host tools are required to support I2C and SPI firmware down load."

What special hardware and host tools are required to support SPI download? How do I do it?

Tags (3)
0 Kudos
Reply
1 Solution
1,143 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Toby:

That is correct, BusPal requires UART. It receives commands via UART from the PC tool and then replicates the commands but using I2C or SPI for the target device.

Sure it may be possible to upload an application using only SPI, but that is not implemented. You would need to replicate the blhost software in the "Master" device (e.g. the Raspberry). This could be a very hard task.

Instead if you strictly require using only SPI, then it would be easier to develop your own custom SPI bootloader using part of the Flash memory and bypass the ROM bootloader.

Regards!

Jorge Gonzalez

View solution in original post

0 Kudos
Reply
4 Replies
1,143 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Toby Frankau:

Actually in the blhost_User's_Guide you can find Appendix C BusPal. It basically describes that BusPal is an embedded software tool which serves as a translator or "bridge" between the blhost PC application and the target Kinetis device.

Currently the software is available for the FRDM-KL25Z and TWR-KV46F150M platforms. The source code is delivered together with the KBOOT installation in the path [C:\Freescale\FSL_Kinetis_Bootloader_1_2_0\apps\bus_pal].

You would need to port such code to the Raspberry Pi platform so you are able to load applications to the KL27 via SPI.

If you are not comfortable with the migration or you want to avoid the use of blhost completely, then you can create a custom SPI bootloader using part of the KL27 Flash memory.

I hope this helps to clarify.

Regards!
Jorge Gonzalez

0 Kudos
Reply
1,143 Views
tobyfrankau
Contributor I

Hi Jorge,

Thank you for your reply.

Am I correct in thinking that BusPal requires a UART connection? Is there any way of uploading an application to the board just using an SPI connection?

Thanks,

Toby

0 Kudos
Reply
1,144 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Toby:

That is correct, BusPal requires UART. It receives commands via UART from the PC tool and then replicates the commands but using I2C or SPI for the target device.

Sure it may be possible to upload an application using only SPI, but that is not implemented. You would need to replicate the blhost software in the "Master" device (e.g. the Raspberry). This could be a very hard task.

Instead if you strictly require using only SPI, then it would be easier to develop your own custom SPI bootloader using part of the Flash memory and bypass the ROM bootloader.

Regards!

Jorge Gonzalez

0 Kudos
Reply
1,143 Views
tobyfrankau
Contributor I

Hi Jorge,

Thank you for your response.

I have now sorted my problem by writing a Python script on the Pi which uploads an application on to the MCU over SPI. It turned out to not be as hard as I thought it might once I had read over the manual thoroughly.

Many thanks for all your help.

Toby

0 Kudos
Reply