# art_pi_use_externalLoader_doc **Repository Path**: l1871684591/art_pi_use_externalLoader_doc ## Basic Information - **Project Name**: art_pi_use_externalLoader_doc - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-04-26 - **Last Updated**: 2026-04-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # art_pi 外部下载算法的添加 如果您想要将应用构建至外部flash并下载,请参考此文档以安装下载算法(开发环境在linux下进行) 在此之前您需要确保安装了stm32cubeprogrammer ## 1.下载外部下载算法 ``` https://github.com/RT-Thread-Studio/sdk-bsp-stm32h750-realthread-artpi/blob/master/debug/stldr/ART-Pi_W25Q64.stldr ``` ## 2.查找安装路径 ``` hdj@hdj-virtual-machine:~$ which STM32_Programmer_CLI /usr/local/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI ``` ## 3.将ART-Pi_W25Q64.stldr 外部下载算法放到此路径下 (以自己的路径为准) ``` /usr/local/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/ExternalLoader ``` 如果是 windows or mac 可找到cubeprogrammer安装路径,并放在外部下载算法目录内 # 使用外部下载算法 您可以使用withmcuboot测试,在此之前,您需要做以下操作 ## 1.打开目录 samples/sysbuild/with_mcuboot/boards,并添加art_pi.overlay,内容如下 ``` /* * Copyright (c) 2025 STMicroelectronics * * SPDX-License-Identifier: Apache-2.0 */ /* * Define the device, controller and partition to be the external memory * for running the application in external NOR from MCUboot */ / { chosen { zephyr,flash = &w25q64_qspi; zephyr,flash-controller = &w25q64_qspi; zephyr,code-partition = &slot0_partition; }; }; ``` ## 2.打开目录 bootloader/mcuboot/boot/zephyr/boards,并添加art_pi.conf 内容如下 ``` CONFIG_BOOT_DIRECT_XIP=y CONFIG_STM32_MEMMAP=y CONFIG_BOOT_MAX_IMG_SECTORS_AUTO=n CONFIG_BOOT_MAX_IMG_SECTORS=4096 ``` ## 3.编译 ``` west build -p -b art_pi samples/sysbuild/with_mcuboot --sysbuild -- -DSB_CONFIG_BOOTLOADER_MCUBOOT=y ``` ``` -- Zephyr version: 4.2.99 (/home/hdj/zephyrproject/zephyr), build: v4.2.0-5026-ge5b6161768d1 [148/148] Linking C executable zephyr/zephyr.elf Memory region Used Size Region Size %age Used FLASH: 20100 B 2096768 B 0.96% RAM: 4608 B 512 KB 0.88% EXTMEM: 0 GB 8 MB 0.00% SRAM0: 0 GB 512 KB 0.00% SRAM1: 0 GB 128 KB 0.00% SRAM2: 0 GB 128 KB 0.00% SRAM4: 0 GB 64 KB 0.00% DTCM: 0 GB 128 KB 0.00% ITCM: 0 GB 64 KB 0.00% SRAM3: 16 KB 32 KB 50.00% SDRAM1: 0 GB 6 MB 0.00% IDT_LIST: 0 GB 32 KB 0.00% Generating files from /home/hdj/zephyrproject/zephyr/build/with_mcuboot/zephyr/zephyr.elf for board: art_pi image.py: sign the payload image.py: sign the payload [11/16] Performing build step for 'mcuboot' [1/286] Preparing syscall dependency handling [2/286] Generating include/generated/zephyr/version.h -- Zephyr version: 4.2.99 (/home/hdj/zephyrproject/zephyr), build: v4.2.0-5026-ge5b6161768d1 [286/286] Linking C executable zephyr/zephyr.elf Memory region Used Size Region Size %age Used FLASH: 43016 B 128 KB 32.82% RAM: 87296 B 512 KB 16.65% EXTMEM: 0 GB 8 MB 0.00% SRAM0: 0 GB 512 KB 0.00% SRAM1: 0 GB 128 KB 0.00% SRAM2: 0 GB 128 KB 0.00% SRAM4: 0 GB 64 KB 0.00% DTCM: 0 GB 128 KB 0.00% ITCM: 0 GB 64 KB 0.00% SRAM3: 16 KB 32 KB 50.00% SDRAM1: 0 GB 6 MB 0.00% IDT_LIST: 0 GB 32 KB 0.00% Generating files from /home/hdj/zephyrproject/zephyr/build/mcuboot/zephyr/zephyr.elf for board: art_pi [16/16] Completed 'mcuboot' ``` ## 4.下载 ``` west flash ``` ``` hdj@hdj-virtual-machine:~/zephyrproject/zephyr$ west flash -- west flash: rebuilding [0/6] Performing build step for 'with_mcuboot' ninja: no work to do. [1/6] Performing build step for 'mcuboot' ninja: no work to do. [6/6] Completed 'mcuboot' -- west flash: using runner stm32cubeprogrammer ------------------------------------------------------------------- STM32CubeProgrammer v2.20.0 ------------------------------------------------------------------- ST-LINK SN : 0669FF505750888667051238 ST-LINK FW : V2J43M28 Board : -- Voltage : 3.25V SWD freq : 4000 KHz Connect mode: Under Reset Reset mode : Hardware reset Device ID : 0x450 Revision ID : Rev V Device name : STM32H7xx Flash size : 128 KBytes Device type : MCU Device CPU : Cortex-M7 BL Version : 0x90 Opening and parsing file: zephyr.hex Memory Programming ... File : zephyr.hex Size : 42.01 KB Address : 0x08000000 Erasing memory corresponding to segment 0: Download in Progress: [==================================================] 100% File download complete Time elapsed during download operation: 00:00:09.337 RUNNING Program ... Address: : 0x8000000 Application is running, Please Hold on... Start operation achieved successfully -- west flash: using runner stm32cubeprogrammer ------------------------------------------------------------------- STM32CubeProgrammer v2.20.0 ------------------------------------------------------------------- ST-LINK SN : 0669FF505750888667051238 ST-LINK FW : V2J43M28 Board : -- Voltage : 3.25V SWD freq : 4000 KHz Connect mode: Under Reset Reset mode : Hardware reset Device ID : 0x450 Revision ID : Rev V Device name : STM32H7xx Flash size : 128 KBytes Device type : MCU Device CPU : Cortex-M7 BL Version : 0x90 Opening and parsing file: zephyr.signed.hex Memory Programming ... File : zephyr.signed.hex Size : 19.96 KB Address : 0x90000000 Erasing memory corresponding to segment 0: Erasing external memory sectors [0 4] Download in Progress: [==================================================] 100% File download complete Time elapsed during download operation: 00:00:01.045 RUNNING Program ... Address: : 0x8000000 Application is running, Please Hold on... Start operation achieved successfully ``` LOG ``` Hello sysbuild with mcuboot! art_pi *** Booting MCUboot v2.2.0-118-gaa4fa2b6e173 *** *** Using Zephyr OS build v4.2.0-5026-ge5b6161768d1 *** *** Booting Zephyr OS build v4.2.0-5026-ge5b6161768d1 *** Address of sample 0x90000000 Hello sysbuild with mcuboot! art_pi ```