The chip used is stm32f103c8t6.
Today, when debugging the board, I found that the LED light on the PA15 port only has an intermediate level of 2.3V regardless of whether the output is high or low. Later, Baidu said that this port (PA15--JTDI) is used as a JTAG debugging port by default and needs to be configured as a normal IO port. So I wrote two sentences according to that person's method: RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO,ENABLE);GPIO_PinRemapConfig(GPIO_Remap_SWJ_Disable,ENABLE);
It would have been fine if I hadn't written it, but after writing it, even the SWD port that was originally used to download and debug programs could not be used... Later, I found the correct way to write it in the STM32 library: RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO,ENABLE); GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable,ENABLE); This means not to use JTAG but to keep SWD. Neither the previous JTAG nor SWD will be kept.
The problem has been discovered, but what can I do? Now even SWD cannot be used... I used the serial port to download, but I was dumbfounded when I saw the board (I drew it myself), BOOT1 was floating, and BOOT0 was grounded... There was no way to connect the jumpers, so I grounded BOOT1, and pulled BOOT0 up to 3V3 through 4K7, and then used the MCUISP serial port to download (those who have used the Wildfire development board should know). The software first erased the chip and then wrote a new HEX file (the new HEX file is the second code above, only SWD is retained).
The download is successful, then pull up BOOT0 (it doesn’t matter if BOOT1 is still grounded, it is very clear in the data sheet), and after connecting to ST-LINK, SWD mode can download normally, and the PA15 port can also control the light normally.
From this we can see: 1. If the pin resources are not very tight, it is still better to pull the BOOT1 pin low; 2. In the first code above, the 5 IOs originally occupied by JTAG can be used as ordinary IO ports, but the program can only be downloaded through the serial port in the future.
void LED_GPIO_INIT(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOA, ENABLE ); //PA clock enable
GPIO_InitStructure.GPIO_Pin = LED_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; //PULL PUSH
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init( LED_PORT, &GPIO_InitStructure );
// for PA15 JTDI REMAP
RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO,ENABLE);
// GPIO_PinRemapConfig(GPIO_Remap_SWJ_Disable,ENABLE); // JTAG&SWD DISABLE
GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable,ENABLE); // JTAG DISABLE,SWD ENABLE
GPIO_ResetBits( LED_PORT, LED_PIN ); //TURN OFF LED
}
Previous article:STM32 timer input capture points
Next article:Understanding of 8 GPIO modes of STM32
Recommended ReadingLatest update time:2024-11-23 10:54
- Popular Resources
- Popular amplifiers
- The STM32 MCU drives the BMP280 absolute pressure sensor program and has been debugged
- DigiKey \"Smart Manufacturing, Non-stop Happiness\" Creative Competition - Small Weather Station - STM32F103 Sensor Driver Code
- LwIP application development practical guide: based on STM32
- FreeRTOS kernel implementation and application development practical guide: based on STM32
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- KA5Q1265RFTU
- Research on Self-Compiled ISP Code for P89LPC922
- Consumer electronics section highlights
- In the EMC-related experiments of circuits, there are some voltage pulse experiments. How should the withstand voltage value of the capacitor be considered?
- Start with LoRa and learn more about the Internet of Things
- Modern power modules
- Bored at home? Learn about oscilloscopes. 200M Tektronix LCD oscilloscope for 1580 yuan including express delivery
- Ask about the udealy function of Liunx
- How to modify the AT32F4xx SRAM space size
- About software testing of commercial appliances