STM32 Hardware Debugging detailed

Source: Internet
Author: User

The basic system of STM32 mainly involves the following parts:
First, power
1), regardless of whether the use of analog and ad parts, the MCU outside of VCC and Gnd,vdda, Vssa, Vref (if the package has this pin) must be connected, not floating;
2), for each group of the corresponding VDD and GND should be placed at least a 104 ceramic capacitor for filtering, and the capacitor should be placed as close as possible to the MCU, 3), with a multimeter test supply voltage is correct. It is best to use a digital power supply during commissioning so that the board is burnt out or over-streamed. It is best to test the voltage from the input end to the chip supply side.
Second, reset, start selection
1), boot pin has nothing to do with JTAG. It is only used to determine the starting address of the execution code after the MCU is started;
2), in the circuit design may boot pin will not be used, but the requirements must be external connection resistor to ground or power, should not be suspended; STM32 three boot mode corresponding storage media are built-in chip, they are:
1) User Flash = Flash built into the chip.
2) SRAM = The Ram area built into the chip is memory.
3) system memory = a specific area within the chip, the chip factory in this area preset a section of bootloader, is usually said ISP program. The contents of this area are not able to be modified or erased after the chip is shipped, i.e. it is a ROM area.
There are two pins BOOT0 and BOOT1 on each STM32 chip, and the level state of the two pins at the time the chip is reset determines the region from which to execute the program after the chip is reset, as shown in the following table:
Boot1=x boot0=0 boot from user flash, this is normal mode of operation.
Boot1=0 boot0=1 boot from the system memory, this mode starts the program function is set by the factory.
The Boot1=1 Boot0=1 starts from the built-in SRAM, which can be used for debugging.
Use the JTAG port or SWD mode burn-write option to boot from the user flash.
Use the serial ISP mode to burn the program to boot from the system store
Third, burn write interface
If you want to reduce the number of sockets, use the SWD mode of simulation, in this mode, if the use of Jlink as long as four lines can be, these four lines are: 3.3V, GND, Swdio, SWCLK
which
STM32 Jtms/swdio to the JTAG port of the TMS;
STM32 JTCK/SWCLK to the JTAG port of TCK.
If you want to use ULINK2, then add one more "NRST", that is, 5.
This interface you can define yourself, when using the DuPont line to jump or do block conversion interface board to join the emulator and the target board.

X


Here is the picture set in MDK:


Idcode has a serial number in the burning write, prove that the burning interface is good! That is, hardware debugging pass. If no welding may not pass, the new reinforcement welding chip.
Iv. common causes of debug burn failures
1, the target chip is not properly connected, does not work properly:
Solution: To ensure that the minimum system of the target board is properly connected, the chip can work properly: VDD, Vdda and VSS, VDDs are all properly connected, reset circuit can be reliably reset, each reset source does not affect each other.
2. The original burned code in the chip affected the new debugging operation:
The original burned code in the chip error, the chip on the power operation, into the undefined state, can not enter the debug mode. The previously burned code in the chip initiates some peripherals or configures the SWJ pin as a normal I/O port.
Workaround: Select the BOOT0/BOOT1 pin of the chip to boot from RAM, or erase the in-chip code first.
3, Chip has been read/write protection:
The Debug tool cannot read and write Flash built into the chip. Workaround: First use the Debug tool to remove the chip read/write protection.
Write software error Summary, follow-up needs to be perfected! If there are any errors, please advise them to correct them promptly.

Go

STM32 Hardware Debugging detailed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.