void enterDFU(){ __asm ("LDR R0, =0x40023844");// RCC_APB2ENR __asm ("LDR R1, =0x00004000");// ENABLE SYSCFG CLOCK __asm ("STR R1, [R0, #0]"); __asm ("LDR R0, =0x40013800");// remap ROM at zero __asm ("LDR R1, =0x00000001");// SYSCFG_MEMRMP __asm ("STR...
BOOTKEY_OUTPUT_PIN_Pin,GPIO_PIN_SET);HAL_Delay(200);//如果Enter按键被按下,BOOTKEY_INPUT_PIN_Pin读到值为GPIO_PIN_SET,则跳过下面if代码段,MCU进入DFU模式,//否则读
图4.1.6. 12 STLinkUpgrade对话框 我们先拔掉然后再重新连上连接下载器的USB线,接着点击Open in update mode,弹出如下界面(如果不这样操作,点击Open in update mode以后可能提示ST-Link is not in the DFU mode.Please restart it,即要求复位一下下载器。): 图4.1.6. 13驱动更新操作顺序 点击Upgrade更新ST-...
usb_desc.c文件需要修改下接口字符串描述符,由于我们的SPI Flash空间2M,所以我们将SPI Flash的2M空间全部设置成可读可写可擦除。 /*接口字符串描述符*/uint8_tDFU_StringInterface0[DFU_SIZ_STRING_INTERFACE0]={DFU_SIZ_STRING_INTERFACE0,0x03,//Interface 1: "@ SPI Flash: W25X16 /0x00000000/1*2048k...
由于我们需要使用USB DFU模式,我们在安装STM32CubeProgrammer时Winodws 7默认会把DFUSE的驱动程序安装上去了。所以我们要在设备管理器里,找到通用串行总线控制器,找到STM Device in DFU Mode,下图为具有DfuSe 驱动程序的STM32 DFU器件。 经过实测,Windows 7会识别成如下,需要按下面的操作先卸载驱动。Windows10不用卸载...
/* Enter DFU mode */ DeviceState = STATE_dfuERROR; //程序指向到这句话,说明DFU跳转不成功 DeviceStatus[0] = STATUS_ERRFIRMWARE; DeviceStatus[4] = DeviceState; USB_Configuration(); //初始化USB while(1) { if(KEY1_STATE()==0) //按键1按下,则向spi flash写入数据 ...
The intended procedure to access the DFU is to: - Connect USB to host while device is unpowered - Power up the device We expect to enter DFU mode since the BOOT0 pin is held high before the system power is up. Instead of entering DFU mode, I see the following in Linux dmesg: [289...
5)正点原子官方B站:https://space.bilibili.com/394620890 6)正点原子STM32MP157技术交流群:691905614...
程序中我们要修改几个宏定义,具体名称和意义如下所示(用搜索功能获取这些名称位置):ApplicationAddress 用户程序地址,系统默认为0x08000000,我们修改为0x08003000。DFU_ENTER GPIOA DFU_ENTER_PIN GPIO_Pin_8 RCC_APB2Periph_GPIO_DFU RCC_APB2Periph_GPIOA 这三个为判断按键的管脚配置 ...
=== DFU Interface === Total number of available STM32 device in DFU mode: 1 Device Index : USB1 USB Bus Number : 003 USB Address Number : 003 Product ID : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000 Serial number : 004200343338510534383330 Firmware...