stm32n6系列芯片使用记录
1 BOOT[0:1]=01时,处于开发者模式,此时可以在线调试Appli,以及烧录外部Flash. 烧录外部Flash时,是先通过stm32cubeprogramer将xxx.stldr文件下载到片内RAM里,然后xxx.stldr在片内RAM运行配合STM32cubeProgramer将FSBL、Appli下载到片外Flash,因为xxx.stldr加载器里包含各种外部Flash的初始化,读写,擦除等功能,需要做成一个专门的加载器程序,可能功能较多,程序体积较大,不适合做在芯片内BootROM里;推测xxx.stldr加载器自己本身下载到片内RAM时的原理和我们调试运行Appli时的原理是一样的,都是通过上位机软件和芯片BootROM配合将程序(xxx.stldr或者Appli)download到RAM里。xxx.stldr在片内RAM里运行起来后,就具备烧录片外Flash的能力了。
2 在stm32cubeMX里新建项目时,上面的 ExtMemLoader project 在程序实际运行过程中不起任何作用,和本身的程序也没任何关系,它只是产生一个加载器程序,帮助生产阶段烧录外部 Flash的,烧完Flash它就没任何作用了。烧录时在stm32cubeProgramer里勾选该加载器程序xxx.stldr即可。
3 FSBL(xip 模式) + Appli(LRun.ld 链接脚本) 无法启动
FSBL(xip 模式) + Appli(RomXSPI.ld 链接脚本) 正常启动
FSBL(Load and Run 模式) + Appli(LRun.ld 链接脚本) 正常启动
FSBL(Load and Run 模式) + Appli(RomXSPI.ld 链接脚本)正常启动
4 BOOT[0:1]=01 + Appli(LRun.ld链接脚本) 可以正常进入调试状态
BOOT[0:1]=01 + Appli(RomXSPI.ld 链接脚本) 无法进入调试状态
5 FSBL签名产生方法:在FSBL项目名字上 右键后出现快捷键,选Properties->C/C++Buold->Settings ,在build steps 里的 post-build step栏目输入该脚本:
cd "${ProjDirPath}/Debug" && echo y | "H:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin\STM32_SigningTool_CLI.exe" -bin "${ProjName}.bin" -nk -of 0x80000000 -t fsbl -o "${ProjName}-Trusted.bin" -hv 2.3 -dump "${ProjName}-Trusted.bin"
6 ExtMemLoader加载器脚本产生:在ExtMemLoader项目名字上 右键后出现快捷键,选Properties->C/C++Buold->Settings ,在build steps 里的 post-build step栏目有这样的脚本:
bash "../postbuild.sh" "${cubeide_cubeprogrammer_path}/ExternalLoader"
编译该project结束时,出现提示:然后打开Programer软件选择加载文件时就自动出现了《project.stldr》这样的加载文件。
bash "../postbuild.sh" "H:\ST\STM32CubeIDE_1.17.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.2.0.202409170845\tools\bin/ExternalLoader"
STM32CUBE IDE is found!
File copied successfully under STM32CubeProgrammer.
File copied successfully under STM32CubeIDE

浙公网安备 33010602011771号