最近在做STM32F767的双bank实验,可是怎么弄也不成功,哪位大佬,弄过,请帮小弟看下:
例子是F7HAL SDK包里面STM32F767 NUCLEO对应的例子:
STM32Cube_FW_F7_V1.6.0\Projects\STM32F767ZI-Nucleo\Examples\FLASH\FLASH_SwapBank
我先定义了FLASH_BANK2,然后修改了FLASH位置和大小
原来作为一个整体FLASH时,起始地址和大小是0x8000000 0x200000
编译,生成了FLASH_BANK2.hex文件。
在修改上面这两项。定义FLASH_BANK1:
编译,生成了FLASH_BANK1.hex文件。
然后打开STM32 ST-LINK Utility
菜单:Target-->Option Byte.
去掉nDBANK的选择
然后用STM32 ST-LINK Utility 先下载FLASH_BANK2.hex
在下载FLASH_BANK1.hex,
然后复位BANK1运行对应的LED1闪烁,
按下用户按键:理论上会切换到BANK2运行,LED2会闪烁
但实际效果还是LED1闪烁,重复了几次还是这样
感觉就是按照程序里面说明做的了:
Below are the steps to run this example:
1- Choose the FLASH_SwapBank_Bank2 project and generate its binary (ie: FLASH_SwapBank.bin)
2- Configure the FLASH memory at Dual Bank mode using STM32 ST-LINK Utilities (Target -> Options Bytes:
"nDBANK" should be unchecked, "nDBOOT" should be checked).
Then, Load FLASH_SwapBank.bin binary at the bank2 of the flash (at the address 0x08100000) using STM32
ST-LINK Utilities(www.st.com) or any similar tool.
@note:
- You can avoid step 1 by directly loading the binary file provided with the example
- You have to configure your preferred toolchain in order to generate the binary
file after compiling the project.
3- Choose the FLASH_SwapBank_Bank1 project and run it, this project will be loaded
in the bank1 of the flash: at the address 0x08000000
4- Click the BUTTON_USER button to swap between the two banks,
- If program is executing from bank1 is selected, LED1 toggles,
- If program is executing from bank2 is selected, LED2 toggles,