Dereck Hao 4b11341799 Feat: 新增 KL520 IP 自動驗證測試套件
- 實作 GPIO, SPI, I2C, PWM-ADC 功能驗證模組
- 新增互動式 Console 選單 (ip_test_all) 與 README 接線說明
2025-12-17 17:15:36 +08:00
..
2025-12-17 15:55:25 +08:00
2025-12-17 15:55:25 +08:00

utils/bin_gen.py

To compose flash image binary file from separated binary files. This script combines .bin files in folder, flash_bin, in a predefined order.

Binary placing offset for KL520 flash should align with 4KB

Prerequisite

pip install argparse numpy

Command

$ python3 bin_gen.py <options>

usage: bin_gen.py [-h] [-p] [-f FLASH_SIZE] [-n]

optional arguments:
  -h, --help            show this help message and exit
  -p, --CPU_ONLY        FW only
  -f FLASH_SIZE, --flash_size FLASH_SIZE
                        target board flash size in MB
  -n, --no_usb_loader_mode
                        flash table for no usb loader mode

Default flash size is 32 MB

Note

The following bin files are must

flash_bin
├── boot_spl.bin                   // bool spl bin file
├── fw_loader.bin                  // LOADER bin file (or copied from plus/res/firmware/KL520)
├── fw_ncpu.bin                    // SCPU FW bin file (generated by Keil)
├── fw_scpu.bin                    // NCPU FW bin file (generated by Keil)
├── prog_fw_loader_flash-boot.bin  // switch to flash boot bin file (or copied from kl520_sdk/utils/JLink_programmer/kdp2)
├── models_520.nef                 // model information(or copied from plus/res/models/KL520)
** if -n is specified (no usb loader mode) **
flash_bin
├── boot_spl.bin                   // bool spl bin file
├── fw_ncpu.bin                    // SCPU FW bin file (generated by Keil)
├── fw_scpu.bin                    // NCPU FW bin file (generated by Keil)
├── models_520.nef                 // model information(or copied from plus/res/models/KL520)