JFlash多固件Merge合并打包方法

方法

整理很久之前帮客户写的一个项目,在做CI/CD的时候发现每次打包固件使用python脚本比较麻烦,直接使用Jlink提供的JFlash更加的高效快捷

JFlash.exe -openprj"AT32F415CBxx.jflash" -open"E:\work\AT32F415\project\new_version_boot\Debug\rtthread.bin",0x08000000 -merge"E:\work\AT32F415\project\master\Debug\rtthread.bin",0x08008000 -saveas"Merged.hex" -auto

参考

《UM08003_JFlash》

Programming multiple data files at once

For some production environments, the firmware image to program may consist of multiple data files, e.g.

  1. Bootloader
  2. Firmware
  3. Unit-specific data
    • MAC address
    • Calibration data
    • Signature
  4. etc…

J-Flash can only program one data file to a target at a time.
Programming the data files separately could cause a series of issues, e.g.

  • One of the data files enables a flash write protection, causing following flash programming attempts to fail
  • Multiple programming operations decrease the flash memory’s lifespan
  • Multiple programming operations increase the time required to produce a single unit

Instead, J-Flash can be used to merge multiple data files into a single data file which can then be programmed in one go. Example:

JFlash.exe -openprj"Path\To\Proj.jflash" -open"Path\To\Data1.bin",0x08000000 -merge"Path\To\Data2.bin",0x08000200 -merge"Path\To\Data3.bin",0x08000400 -saveas"Path\To\Merged.hex" -auto

The command line above does the following:

  1. Starts J-Flash
  2. Opens the project file Proj.jflash
  3. Opens the data file Data1.bin
  4. Merges Data2.bin into Data1.bin
  5. Merges Data3.bin into the merged data
  6. Saves the resulting data file to Merged.hex
  7. Starts production programming of the merged data

Note:

The contents of the data files Data1.bin, Data2.bin and Data3.bin are not changed by J-Flash using the command line above.

Furthermore, saving the resulting merged data before programming is not necessary and that step may be omitted.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值