Skip to main content
Visitor II
May 19, 2026
Question

How to fill unused spaces during Keil compilation?

  • May 19, 2026
  • 2 replies
  • 118 views

我正在写BootLoader的程序,我想要实现IAP,我目前编译后生成的.bin文件大小为18kb(之后代码多了还会再增加),但是我APPUP区空间为248KB,我的配置为:

Translation (by google translator):

"I'm writing a BootLoader program and I want to implement In-App Access (IAP). The .bin file I'm currently compiling is 18kb in size (and will increase as the code grows), but my app upload space is 248KB. My configuration is..."

_0-1779157531957.png

我想要实现生成的.bin文件为248kb,不够的地方自动填充,我的生成.bin的指令如下

"I want to generate a .bin file that is 248kb in size, with automatic padding if necessary. My command to generate the .bin file is as follows:"

_1-1779157644842.png

我的编译器版本为:

"My compiler version is:"

_2-1779157696997.png

keil5版本为:5.38.0.0

"The Keil 5 version is 5.38.0.0."

2 replies

mƎALLEm
Technical Moderator
May 19, 2026

Hello @赵文定 and welcome to the ST community,

The language used in this community is English.

Please refer to How to write your question to maximize your chances to find a solution

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
Pavel A.
Super User
May 19, 2026

You can fill the unused spaces as you like, but note that the filler value will affect the checksum or CRC.

How to do it? Whatever tool you prefer. Python is great for tweaking .bin files.