libretiny-eu / libretiny

PlatformIO development platform for IoT modules
http://docs.libretiny.eu/
MIT License
415 stars 62 forks source link

BK7231N : The compiled Firmware file size exceeds the flash memory #268

Closed TuanAIoT closed 8 months ago

TuanAIoT commented 8 months ago

Chip : BK7231N Module : CBU

Flash memory is 2MB, however when I compile the program it exceeds 2048kb, despite only using 66% of memory (used 715616 bytes from 1083136 bytes) image image

Cossid commented 8 months ago

That is completely normal, uf2 is a wrapping format with extra information about partitions, writing instructions, and validations. The file is streamed and processed, and only the appropriate bits will be written as determined by the information streamed and processed. You must use LTChipTool (included in the PlatformIO toolchain) [or the OTA process which also implements uf2 depending on platform], and it will be handled correctly.

kuba2k2 commented 8 months ago

Firmware.bin is exactly the same UF2 file. It's named this way so that people used to ESP platforms choose this file for flashing.

As Cossid said, it only works with LibreTiny flashing tools, which understand this file format. OpenBeken's flasher tool only understands raw binaries, so it will not be able to write UF2 files.

TuanAIoT commented 8 months ago

yes, thank you everyone, The problem has been resolved