Custom MCUBOOT bootloader development flow question (KV31)

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Custom MCUBOOT bootloader development flow question (KV31)

跳至解决方案
4,390 次查看
ac80
Contributor II

Hello everyone,

We are going to develop a custom bootloader from the freedom bootloader example that ships with the mcuexpresso sdk for KV31. Since our serial interface is a UART connected to a half duplex RS485 interface, we need at least two modifications:

1. Enable the RS485 transmitter with GPIO before sending, and disable it when finished.
2. Disable the UART receiver on KV31 to prevent echos from being parsed (might not be necessary).

My question relates to the development flow of custom bootloaders:

How can a flash-resident bootloader be replaced / iterated?

 

The intent is to first flash the standard bootloader to the board as it ships in the sdk and confirm its working for us (by bypassing the RS485 and instead using a UART-USB part from FTDI). Next we will make incremental changes to the bootloader, replace the previous version on the board, and test.

I have two thoughts on how to replace the bootloader:

1. Build the flashloader and flashloader loader application to reside at 0xA000, and load it with the default bootloader. Then execute the floashloader from the bootloader, and overwrite the existing bootloader.

2. Buy a SWD programmer and iterate that way.

I dont like option 2, because in the final form, SWD ports will not be available. So if later we want to add features (we plan to implement some kind of encrypted firmware download support, for example), this would not work.

Id love to hear your thoughts or experience with this!

Kind regards,

AC80~

0 项奖励
回复
1 解答
4,361 次查看
ac80
Contributor II

Ok, I found what I was looking for. This is well documented in the blhost User's Guide in Appendix B - Updating a bootloader image.

 

Apparently the flashloader can be programmed directly to ram, and then executed to upload a new bootloader starting at flash address 0x0.

在原帖中查看解决方案

0 项奖励
回复
3 回复数
4,362 次查看
ac80
Contributor II

Ok, I found what I was looking for. This is well documented in the blhost User's Guide in Appendix B - Updating a bootloader image.

 

Apparently the flashloader can be programmed directly to ram, and then executed to upload a new bootloader starting at flash address 0x0.

0 项奖励
回复
4,376 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi ac80,

KV3x has been preprogrammed with one-time-use flashloader when ship to customer. You can download your bootloader via UART directly.

 

Regards,

Jing

0 项奖励
回复
4,367 次查看
ac80
Contributor II

Hi Jing,

 

Thanks for your reply. Flashing the bootloader the first time is not an issue; the flashloader is well documented in the kv31 reference manual.

The question is how can a flash-resident bootloader be over-written during custom bootloader development?

0 项奖励
回复