Simplified MCU-Boot Program

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

Simplified MCU-Boot Program

Simplified MCU-Boot Program

       本program对NXP官方 MCUBOOT进行了大幅简化,砍掉了绝大部分功能,只保留串口下载功能,同时由于保持协议兼容,可以配合官方Win下的命令行工具blhost 或者 GUI工具Kinetis Flash Tool 来实现一个基于MCU串口的bootloader,这套代码基于纯C代码,非常容易移植到任何NXP MCU平台上来,有如下两个特色:

  • 基础实现和具体硬件完全解耦。 只有2个.c .h文件:kptl.c mcuboot.c。 除Systick中断外 不使用任何中断。只使用串口轮训发送和接收数据。
  • 所有与硬件相关的必要操作全部由回调函数显示。 kptl 和 mcuboot 本身没有任何硬件依赖。非常容易移植到任何ARM Cortex MCU上。kptl和mcuboot写的很小白,有C基础的都可以看的明白,容易改。

 

Products

Product Category NXP Part Number URL
MCU MK64FN1M K64_120: Kinetis® K64-120 MHz 
MCU MKE02Z64 KE02_40: Kinetis® KE02-40 MHz 
MCU MKE15Z256 KE1xZ: up to 72MHz, 5V main stream CM0+ MCU 
MCU LPC802/804
LPC80X: Low-Cost Microcontrollers M0+ 

 

Tools

Attachments
%3CLINGO-SUB%20id%3D%22lingo-sub-1159213%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3ESimplified%20MCU-Boot%20Program%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1159213%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3E%0A%3CP%3E%3CSPAN%3EThis%20program%20greatly%20simplifies%20the%20official%20NXP%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fsupport%2Fdeveloper-resources%2Fsoftware-development-tools%2Fmcuxpresso-software-and-tools%2Fmcuboot-mcu-bootloader-for-nxp-microcontrollers%3AMCUBOOT%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E%20MCUBOOT%3C%2FA%3E%3CSPAN%3E%20%2C%20cutting%20off%20most%20of%20the%20functions%20and%20retaining%20only%20the%20serial%20port%20download%20function.%20At%20the%20same%20time%2C%20because%20it%20maintains%20protocol%20compatibility%2C%20it%20can%20be%20used%20with%20the%20official%20Windows%20command%20line%20tool%3C%2FSPAN%3E%3CCODE%20translate%3D%22no%22%3Eblhost%3C%2FCODE%3E%3CSPAN%3E%20or%20GUI%20tool%3C%2FSPAN%3E%3CCODE%20translate%3D%22no%22%3EKinetis%20Flash%20Tool%3C%2FCODE%3E%3CSPAN%3E%20to%20implement%20a%20bootloader%20based%20on%20the%20MCU%20serial%20port.%20This%20code%20is%20based%20on%20pure%20C%20code%20and%20is%20very%20easy%20to%20port%20to%20any%20NXP%20MCU%20platform.%20It%20has%20the%20following%20two%20features%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EThe%20basic%20implementation%20is%20completely%20decoupled%20from%20the%20specific%20hardware.%20Only%202.c%20.h%20file%3Akptl.c%20mcuboot.c.%20Do%20not%20use%20any%20interrupt%20except%20Systick%20interrupt.%20Only%20use%20serial%20port%20polling%20to%20send%20and%20receive%20data.%3C%2FLI%3E%0A%3CLI%3EAll%20necessary%20hardware-related%20operations%20are%20displayed%20by%20callback%20functions.%20kptl%20and%20mcuboot%20do%20not%20have%20any%20hardware%20dependencies.%20They%20are%20very%20easy%20to%20port%20to%20any%20ARM%20Cortex%20MCU.%20kptl%20and%20mcuboot%20are%20written%20very%20simply%2C%20and%20anyone%20with%20a%20basic%20understanding%20of%20C%20can%20understand%20them%20and%20they%20are%20easy%20to%20modify.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CBR%20%2F%3E%0A%3CP%20style%3D%22color%3A%20%2351626f%3B%20background-color%3A%20%23ffffff%3B%20border%3A%200px%3B%22%3E%3CSPAN%20style%3D%22border%3A%200px%3B%20font-weight%3A%20inherit%3B%20font-size%3A%2030px%3B%22%3E%3CSTRONG%20style%3D%22color%3A%20%23717171%3B%20border%3A%200px%3B%20font-weight%3A%20bold%3B%20font-size%3A%2030px%3B%22%3EProducts%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20class%3D%22%22%20style%3D%22color%3A%20%2351626f%3B%20background-color%3A%20%23ffffff%3B%20border%3A%200px%3B%22%3E%0A%3CTABLE%20class%3D%22j-table%20jiveBorder%22%20style%3D%22border%3A%201px%20solid%20%23c6c6c6%3B%20font-weight%3A%20inherit%3B%20margin%3A%200px%200px%202px%3B%22%20width%3D%22100%25%22%3E%0A%3CTHEAD%20style%3D%22border%3A%20inherit%20solid%20inherit%3B%20font-weight%3A%20inherit%3B%22%3E%0A%3CTR%20style%3D%22background-color%3A%20%23efefef%3B%20font-weight%3A%20inherit%3B%20height%3A%2024px%3B%22%3E%0A%3CTH%20class%3D%22%22%20style%3D%22font-weight%3A%20bold%3B%20padding%3A%205px%3B%20height%3A%2024px%3B%22%20height%3D%2224px%22%3E%3CSPAN%20style%3D%22border%3A%200px%3B%20font-weight%3A%20inherit%3B%22%3EProduct%20Category%3C%2FSPAN%3E%3C%2FTH%3E%0A%3CTH%20class%3D%22%22%20style%3D%22font-weight%3A%20bold%3B%20padding%3A%205px%3B%20height%3A%2024px%3B%22%20height%3D%2224px%22%3E%3CSPAN%20style%3D%22border%3A%200px%3B%20font-weight%3A%20inherit%3B%22%3ENXP%20Part%20Number%3C%2FSPAN%3E%3C%2FTH%3E%0A%3CTH%20class%3D%22%22%20style%3D%22font-weight%3A%20bold%3B%20padding%3A%205px%3B%20height%3A%2024px%3B%22%20height%3D%2224px%22%3E%3CSPAN%20style%3D%22border%3A%200px%3B%20font-weight%3A%20inherit%3B%22%3EURL%3C%2FSPAN%3E%3C%2FTH%3E%0A%3C%2FTR%3E%0A%3C%2FTHEAD%3E%0A%3CTBODY%20style%3D%22border%3A%20inherit%20solid%20inherit%3B%20font-weight%3A%20inherit%3B%22%3E%0A%3CTR%20style%3D%22font-weight%3A%20inherit%3B%20height%3A%2024px%3B%22%3E%0A%3CTD%20height%3D%2224px%22%20style%3D%22padding%3A%205px%3B%20height%3A%2024px%3B%22%3EMCU%3C%2FTD%3E%0A%3CTD%20height%3D%2224px%22%20style%3D%22padding%3A%205px%3B%20height%3A%2024px%3B%22%3E%3CSPAN%3EMK64FN1M%3C%2FSPAN%3E%3C%2FTD%3E%0A%3CTD%20height%3D%2224px%22%20style%3D%22padding%3A%205px%3B%20height%3A%2024px%3B%22%3E%3CA%20title%3D%22K64_120%3A%20Kinetis%C2%AE%20K64-120%20MHz%22%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fproducts%2Fprocessors-and-microcontrollers%2Farm-microcontrollers%2Fgeneral-purpose-mcus%2Fk-series-cortex-m4%2Fk6x-ethernet%2Fkinetis-k64-120-mhz-256-kb-sram-microcontrollers-mcus-based-on-arm-cortex-m4-core%3AK64_120%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EK64_120%3A%20Kinetis%C2%AE%20K64-120%20MHz%3C%2FA%3E%26nbsp%3B%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20height%3D%2231px%22%20style%3D%22padding%3A%205px%3B%22%3EMCU%3C%2FTD%3E%0A%3CTD%20height%3D%2231px%22%20style%3D%22padding%3A%205px%3B%22%3E%3CSPAN%3EMKE02Z64%3C%2FSPAN%3E%3C%2FTD%3E%0A%3CTD%20height%3D%2231px%22%20style%3D%22padding%3A%205px%3B%22%3E%3CA%20title%3D%22KE02_40%3A%20Kinetis%C2%AE%20KE02-40%20MHz%22%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fproducts%2Fprocessors-and-microcontrollers%2Farm-microcontrollers%2Fgeneral-purpose-mcus%2Fke-series-cortex-m4-m0-plus%2Fkinetis-ke02-40-mhz-entry-level-microcontrollers-mcus-based-on-arm-cortex-m0-plus-core%3AKE02_40%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EKE02_40%3A%20Kinetis%C2%AE%20KE02-40%20MHz%3C%2FA%3E%26nbsp%3B%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20height%3D%2231px%22%20style%3D%22padding%3A%205px%3B%22%3EMCU%3C%2FTD%3E%0A%3CTD%20height%3D%2231px%22%20style%3D%22padding%3A%205px%3B%22%3E%3CSPAN%3EMKE15Z256%3C%2FSPAN%3E%3C%2FTD%3E%0A%3CTD%20height%3D%2231px%22%20style%3D%22padding%3A%205px%3B%22%3E%3CA%20title%3D%22KE1xZ%3A%20up%20to%2072MHz%2C%205V%20main%20stream%20CM0%2B%20MCU%22%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fproducts%2Fprocessors-and-microcontrollers%2Farm-microcontrollers%2Fgeneral-purpose-mcus%2Fke-series-cortex-m4-m0-plus%2Fup-to-72mhz-5v-main-stream-cm0-plus-mcu-with-nxp-touch-tsi-and-can-control%3AKE1xZ%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EKE1xZ%3A%20up%20to%2072MHz%2C%205V%20main%20stream%20CM0%2B%20MCU%3C%2FA%3E%26nbsp%3B%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20height%3D%2231px%22%20style%3D%22padding%3A%205px%3B%22%3EMCU%3C%2FTD%3E%0A%3CTD%20height%3D%2231px%22%20style%3D%22padding%3A%205px%3B%22%3E%3CSPAN%3ELPC802%2F804%3C%2FSPAN%3E%3CSPAN%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FTD%3E%0A%3CTD%20height%3D%2231px%22%20style%3D%22padding%3A%205px%3B%22%3E%3CA%20title%3D%22LPC80X%3A%20Low-Cost%20Microcontrollers%20M0%2B%22%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fproducts%2Fprocessors-and-microcontrollers%2Farm-microcontrollers%2Fgeneral-purpose-mcus%2Flpc800-cortex-m0-plus-%2Flow-cost-microcontrollers-mcus-based-on-arm-cortex-m0-plus-core%3ALPC80X%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3ELPC80X%3A%20Low-Cost%20Microcontrollers%20M0%2B%3C%2FA%3E%26nbsp%3B%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3C%2FDIV%3E%0A%3CP%20style%3D%22border%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20style%3D%22border%3A%200px%3B%22%3E%3CSPAN%20style%3D%22border%3A%200px%3B%20font-weight%3A%20inherit%3B%20font-size%3A%2030px%3B%22%3E%3CSTRONG%20style%3D%22border%3A%200px%3B%20font-weight%3A%20bold%3B%20font-size%3A%2030px%3B%22%3ETools%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20class%3D%22%22%20style%3D%22border%3A%200px%3B%22%3E%0A%3CTABLE%20class%3D%22j-table%20jiveBorder%22%20style%3D%22border%3A%201px%20solid%20%23c6c6c6%3B%20font-weight%3A%20inherit%3B%20margin%3A%200px%200px%202px%3B%22%20width%3D%22100%25%22%3E%0A%3CTHEAD%20style%3D%22border%3A%20inherit%20solid%20inherit%3B%20font-weight%3A%20inherit%3B%22%3E%0A%3CTR%20style%3D%22background-color%3A%20%23efefef%3B%20border%3A%20inherit%20solid%20inherit%3B%20font-weight%3A%20inherit%3B%22%3E%0A%3CTH%20class%3D%22%22%20style%3D%22border%3A%20inherit%20solid%20inherit%3B%20font-weight%3A%20bold%3B%20padding%3A%205px%3B%22%20width%3D%2236.666666666666664%25%22%20height%3D%2231px%22%3E%3CSPAN%20style%3D%22border%3A%200px%3B%20font-weight%3A%20inherit%3B%22%3ENXP%20Development%20Board%3C%2FSPAN%3E%3C%2FTH%3E%0A%3CTH%20class%3D%22%22%20style%3D%22border%3A%20inherit%20solid%20inherit%3B%20font-weight%3A%20bold%3B%20padding%3A%205px%3B%22%20width%3D%2263.18840579710145%25%22%20height%3D%2231px%22%3E%3CSPAN%20style%3D%22border%3A%200px%3B%20font-weight%3A%20inherit%3B%22%3EURL%3C%2FSPAN%3E%3C%2FTH%3E%0A%3C%2FTR%3E%0A%3C%2FTHEAD%3E%0A%3CTBODY%20style%3D%22border%3A%20inherit%20solid%20inherit%3B%20font-weight%3A%20inherit%3B%22%3E%0A%3CTR%20style%3D%22border%3A%20inherit%20solid%20inherit%3B%20font-weight%3A%20inherit%3B%22%3E%0A%3CTD%20width%3D%2236.666666666666664%25%22%20height%3D%2252px%22%20style%3D%22border%3A%20inherit%20solid%20inherit%3B%20padding%3A%205px%3B%22%3EFRDM-K64F%3C%2FTD%3E%0A%3CTD%20width%3D%2263.18840579710145%25%22%20height%3D%2252px%22%20style%3D%22border%3A%20inherit%20solid%20inherit%3B%20padding%3A%205px%3B%22%3E%0A%3CP%20style%3D%22border%3A%200px%3B%20font-weight%3A%20inherit%3B%20margin%3A%200pt%200px%200pt%200in%3B%22%3E%3CA%20title%3D%22FRDM-K64F%3A%20Freedom%20Development%20Platform%20for%20Kinetis%C2%AE%20K64%2C%20K63%2C%20and%20K24%20MCUs%22%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdesign%2Fdevelopment-boards%2Ffreedom-development-boards%2Fmcu-boards%2Ffreedom-development-platform-for-kinetis-k64-k63-and-k24-mcus%3AFRDM-K64F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EFRDM-K64F%3A%20Freedom%20Development%20Platform%20for%20Kinetis%C2%AE%20K64%2C%20K63%2C%20and%20K24%20MCUs%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20height%3D%2252px%22%20style%3D%22padding%3A%205px%3B%22%3EFRDM-KE02Z40M%3C%2FTD%3E%0A%3CTD%20height%3D%2252px%22%20style%3D%22padding%3A%205px%3B%22%3E%0A%3CP%20style%3D%22border%3A%200px%3B%20font-weight%3A%20inherit%3B%20margin%3A%200pt%200px%200pt%200in%3B%22%3E%3CA%20title%3D%22FRDM-KE02Z40M%3A%20Freedom%20Development%20Platform%20for%20Kinetis%20KE02%20MCUs%22%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdesign%2Fdevelopment-boards%2Ffreedom-development-boards%2Fmcu-boards%2Ffreedom-development-platform-for-kinetis-ke02-mcus%3AFRDM-KE02Z40M%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EFRDM-KE02Z40M%3A%20Freedom%20Development%20Platform%20for%20Kinetis%20KE02%20MCUs%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20height%3D%2252px%22%20style%3D%22padding%3A%205px%3B%22%3EFRDM-KE15Z%3C%2FTD%3E%0A%3CTD%20height%3D%2252px%22%20style%3D%22padding%3A%205px%3B%22%3E%0A%3CP%20style%3D%22border%3A%200px%3B%20font-weight%3A%20inherit%3B%20margin%3A%200pt%200px%200pt%200in%3B%22%3E%3CA%20title%3D%22FRDM-KE15Z%3A%20Freedom%20Development%20Platform%20for%20Kinetis%C2%AE%20KE1xMCUs%22%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdesign%2Fdevelopment-boards%2Ffreedom-development-boards%2Fmcu-boards%2Ffreedom-development-platform-for-kinetis-ke1xmcus%3AFRDM-KE15Z%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EFRDM-KE15Z%3A%20Freedom%20Development%20Platform%20for%20Kinetis%C2%AE%20KE1xMCUs%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20height%3D%2231px%22%20style%3D%22padding%3A%205px%3B%22%3ELPCXpresso802%3C%2FTD%3E%0A%3CTD%20height%3D%2231px%22%20style%3D%22padding%3A%205px%3B%22%3E%0A%3CP%20style%3D%22border%3A%200px%3B%20font-weight%3A%20inherit%3B%20margin%3A%200pt%200px%200pt%200in%3B%22%3E%3CA%20title%3D%22LPCXpresso802%20for%20the%20LPC802%20family%20of%20MCUs%22%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fproducts%2Fprocessors-and-microcontrollers%2Farm-microcontrollers%2Fgeneral-purpose-mcus%2Flpc800-cortex-m0-plus-%2Flpcxpresso802-for-the-lpc802-family-of-mcus%3AOM40000%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3ELPCXpresso802%20for%20the%20LPC802%20family%20of%20MCUs%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20height%3D%2231px%22%20style%3D%22padding%3A%205px%3B%22%3ELPCXpresso804%3C%2FTD%3E%0A%3CTD%20height%3D%2231px%22%20style%3D%22padding%3A%205px%3B%22%3E%0A%3CP%20style%3D%22border%3A%200px%3B%20font-weight%3A%20inherit%3B%20margin%3A%200pt%200px%200pt%200in%3B%22%3E%3CA%20title%3D%22LPCXpresso804%20for%20the%20LPC804%20family%20of%20MCUs%22%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdesign%2Fsoftware%2Fdevelopment-software%2Fmcuxpresso-software-and-tools-%2Flpcxpresso804-for-the-lpc804-family-of-mcus%3AOM40001%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3ELPCXpresso804%20for%20the%20LPC804%20family%20of%20MCUs%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CBR%20%2F%3E%0A%3C%2FDIV%3E%0A%3C%2FLINGO-BODY%3E
No ratings
Version history
Last update:
‎09-25-2020 01:36 AM
Updated by: