Problem Description:
During the laboratory tuning process, I encountered a problem: In order to facilitate program downloading every time, the team members often plugged Jlink into the board, but during the tuning process, they found that sometimes the program would die inexplicably, while the same program would not have this problem if Jlink was unplugged. And PB3 and PB4 are both set as output ports, and the output is high level. When measured with a multimeter, PB4 is high, but PB3 is not high level. When looking at the register values in MDK, PB3 and PB4 are both high? Why are the register values different from the actual values?
After careful research, we found the crux of the problem:
After checking the manual, I found that after reset, PB3 of the JTAG interface was set to floating (if the pin is floating, the level read from the port is uncertain), so the level read back is also uncertain.
PA13-PA14-PA15-PB3-PB4-PB5 of STM32 are mainly used for JTAG debugging, so by default they are in JTAG mode after startup. These pins are used as ordinary I/O ports in the project program, but the I/O mode configuration is not initialized. Therefore, when JTAG is not needed and the GPIO port needs to be fully utilized, JTAG needs to be turned off and set to GPIO mode.
http://blog.csdn.net/wg1194024093/article/details/54849686
STM32 commonly used pins redefine peripherals
http://blog.sina.com.cn/s/blog_a07a3f180101e6ow.html
The difference between the method of setting JTAG pins as normal IO ports in STM32f1 and the method in STM32f4
http://blog.csdn.net/wangyinyun1/article/details/48239725
Previous article:stm32 timer remapping
Next article:STM32-How to use pin multiplexing function to output PWM
Recommended ReadingLatest update time:2024-11-16 22:20
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Can you guys answer my question about 74HC04?
- OFDR for short-range high-precision measurements
- FPGA instantiation issues
- EEWORLD University ---- MSP430 capacitive touch technology - waterproof Demo
- Study for the rise of China! Hainan student with full score chooses to enter Tsinghua University to make chips
- MSP430F5529 RCT official routine
- Has anyone used Renesas' RH850 MCU?
- The second day of the journey ~ Shenzhen ~ Jiangmen
- Qinheng CH579M-R1 development board evaluation report summary
- [Speech and vision module based on ESP32S3] First version of schematic diagram and circuit design