1: GPIO_PinRemapConfig(GPIO_Remap_SWJ_Disable,ENABLE);
Change the mapping of the specified pin GPIO_Remap_SWJ_Disable SWJ completely disabled (JTAG+SW-DP)
2: GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable, ENABLE);
Change the mapping of the specified pin GPIO_Remap_SWJ_JTAGDisable, JTAG-DP disable + SW-DP enable
Select the mode you want here. I only use SWD without JTAG.
1
2
3
4
5
6
7
8
9
10
11
12
|
void GPIOint(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO,ENABLE);
GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable,ENABLE);
RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOA , ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOA, &GPIO_InitStructure);
}
|
STM32 cannot perform JTAG simulation after disabling the JTAG function in the program.
If you accidentally use only JTAG and cannot download the program, you can solve it by the following method:
1. Set the boot mode to ISP mode (BOOT0=1, BOOT1=0) or set the boot mode to RAM operation mode (BOOT0=1, BOOT1=1).
Re-power the board. Since it is not in user program mode, the statement to disable JTAG will not be executed and the JTAG function can be used normally.
2. Set the boot mode to ISP mode (BOOT0=1, BOOT1=0), use the ISP program to erase the STM32 FLASH, and then you can restore the JTAG function.
The software Flash_Loader_Demonstrator for serial port download is available on the official website. Note that serial port download can only use USART1, which is the group of PA9 and PA10 pins.
3. If your emulator supports SWD emulation mode, such as JLINK in IAR and ULINK2 in MDK.
Simply set the emulator mode to SWD mode to avoid being affected by disabling the JTAG function.
Previous article:STM32 TIM remapping
Next article:STM32F407 external SRAM
- 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 information security mechanism of AUTOSAR, the automotive embedded software framework
- Brief Analysis of Automotive Ethernet Test Content and Test Methods
- How haptic technology can enhance driving safety
- Let’s talk about the “Three Musketeers” of radar in autonomous driving
- Why software-defined vehicles transform cars from tools into living spaces
- How Lucid is overtaking Tesla with smaller motors
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- What birthday gift should I give to my mother?
- Download the free NI white paper "Overcoming the Challenges of Production Test for Complex Devices Under Test"
- 2.4G module NRF24L01 debugging experience
- Design of analog signal source for remote sensing images with wide spectrum coverage
- DSP Basics--Fixed-point Decimal Operations
- Small Cell Networks and the Evolution of 5G
- Do you know the chip manufacturer of this Bluetooth module?
- ADS1.2 Issues
- Disassembly of isolator
- Which domestic motor drive company do you think is the most promising?