USB automatic update program IAP (in application programming) DFU (development firemeware upgrade). The entire chip has 512k on-chip flash, and the user program is downloaded and run in it. The flash address is 0x8000000, and the size is 0x80000. The USB automatic update program first downloads 0x8000000-0x80002FFF, with a total size of 12K. The user program is downloaded to 0x80003000, with a size of 0x7D000 (500K). The USB automatic update code is as follows. If the button is pressed, it enters DFU mode, otherwise it starts the user code.
In addition to the void NVIC_Configuration(void)
{
/* Set the Vector Table base location at 0x3000 */
NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x3000);
}
Modify it inside, and also modify the compiled address to 0x80003000, the size to 0x7d000,
The compiled address of the iap program is 0x80000000, the end is 0x80002fff, and the size is 0x3000. In this way, the user program and the USB iap program are burned separately and started. The PC host needs to install ST's dfuse_demo_v3.0, which will contain the dfu driver. After plugging in the USB, manually install the driver C:\Program Files\STMicroelectronics\Software\DfuSe\Driver\x86\ file. Run DFU filemanager to convert the compiled .hex file into .dfu, and then run DFUse demonstration upgrade to generate the .dfu file.
int main(void)
{
DFU_Button_Config(); //Configure the button identification of the USB automatic upgrade program
/* Check if the Key push-button on STM3210x-EVAL Board is pressed */
if (DFU_Button_Read() != 0x00)
{ /* Test if user code is programmed starting from address 0x8003000 */
if (((*(__IO uint32_t*)ApplicationAddress) & 0x2FFE0000 ) == 0x20000000)
{ /* Jump to user application */
JumpAddress = *(__IO uint32_t*) (ApplicationAddress + 4);
Jump_To_Application = (pFunction) JumpAddress;
/* Initialize user application's Stack Pointer */
__set_MSP(*(__IO uint32_t*) ApplicationAddress);
Jump_To_Application();
}
} /* Otherwise enters DFU mode to allow user to program his application */
/* Enter DFU mode */
DeviceState = STATE_dfuERROR;
DeviceStatus[0] = STATUS_ERRFIRMWARE;
DeviceStatus[4] = DeviceState;
Set_System();
Set_USBClock();
USB_Init();
/* Main loop */
while (1)
{
}
}
Previous article:The difference between RO segment, RW segment and ZI segment in ARM
Next article:The concept of priority in STM32 (Cortex-M3)
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Technical characteristics and wide application of embedded systems
- Student dormitory apartment monitoring system based on Internet of Things
- 【DIY】Make a 5V input car light controller
- Linux self-study notes (II) Linux disk partition
- EEWORLD University Hall ---- Intelligent Information Processing Peking University Tan Ying
- 【Gravity:AS7341 Review】+Received Color Sensor
- Xunwei IMX6Q development board AndroidStudio-calendar test
- Do you repair Mitsubishi PLC, Siemens PLC, servo drive boards, etc.?
- 6U VPX signal processing card based on C6678+XC7V690T
- How to design PCB safety spacing?