2014-05-26 01:50 AM
I am using STM32F205RBT6, Keil 4.73 & Ulink2 & SWD communication
I was trying some test codes for low power mode.One of app note says to configure all inputs pins as analog mode, by first enabling the clock & then after configuring in analog mode disable the clock to all pins.I have written my code at last. Now problem is since all pins gets configured including debug pins: SWCLK & SWDIO as analog. So first time I was able to debug the chip by loading code into it. But after that since pins gets configured so I am not able to debug/load code anymore.Error message comes ''SWD communication failure.''1. I have switched off power supply & then again switched on to check , but cannot do that.2. I had forcefully put reset line low & then connect the debugger. Error message comes: ''Could stop Cortex M3 device, so check JTAG cable''How to remove that problem. Application note : AN3430 by ST , Page 19void main(){/* enable all peripherals clock */ GPIOC_CLK_ENABLE(); GPIOH_CLK_ENABLE(); GPIOA_CLK_ENABLE(); GPIOB_CLK_ENABLE(); GPIOD_CLK_ENABLE(); /* delay after enabling peripheral */ DELAY_AFTER_RCC_ENABLE(); /* Configure GPIO pins : PC13 PC14 PC15 PC0 PC1 PC2 PC3 PC4 PC5 PC6 PC7 PC8 PC9 PC10 PC11 PC12 */ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13|GPIO_Pin_14|GPIO_Pin_15|GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4 |GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7|GPIO_Pin_8|GPIO_Pin_9|GPIO_Pin_10|GPIO_Pin_11|GPIO_Pin_12; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AN; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(GPIOC, &GPIO_InitStructure); /* Configure GPIO pins : PH0 PH1 */ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0|GPIO_Pin_1; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AN; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(GPIOH, &GPIO_InitStructure); /* Configure GPIO pins : PA0 PA1 PA2 PA3 PA4 PA5 PA6 PA7 PA8 PA9 PA10 PA11 PA12 PA13 PA14 PA15 */ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13|GPIO_Pin_14|GPIO_Pin_15|GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4 |GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7|GPIO_Pin_8|GPIO_Pin_9|GPIO_Pin_10|GPIO_Pin_11|GPIO_Pin_12; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AN; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(GPIOA, &GPIO_InitStructure); /* Configure GPIO pins : PB0 PB1 PB2 PB10 PB11 PB12 PB13 PB14 PB15 PB3 PB4 PB5 PB6 PB7 PB8 PB9 */ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13|GPIO_Pin_14|GPIO_Pin_15|GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4 |GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7|GPIO_Pin_8|GPIO_Pin_9|GPIO_Pin_10|GPIO_Pin_11|GPIO_Pin_12; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AN; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(GPIOB, &GPIO_InitStructure); /* Configure GPIO pins : PD2 */ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AN; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(GPIOD, &GPIO_InitStructure); ///* disable all peripherals clock */ GPIOC_CLK_DISABLE(); GPIOH_CLK_DISABLE(); GPIOA_CLK_DISABLE(); GPIOB_CLK_DISABLE(); GPIOD_CLK_DISABLE();}2014-05-26 02:59 AM
@A2: You are a
.2014-05-26 05:00 AM
Hi I have tried to debug by forcing reset pin low, but error ''
Could stop Cortex M3 device, so check JTAG cable
''2014-05-26 05:52 AM
2014-05-27 12:36 AM
I have tried by pulling reset line low & kept reset line oen & start debugger at once, without any delay.
Now board had worked & I had removed that code.But what happened I don't understand. If there is delay between rset low to open & debugging start, it doesn't work2014-05-27 04:07 AM
''I was trying some test codes for low power mode.
One of app note says to configure all inputs pins as analog mode, by first enabling the clock & then after configuring in analog mode disable the clock to all pins. I have written my code at last. Now problem is since all pins gets configured including debug pins: SWCLK & SWDIO as analog. So first time I was able to debug the chip by loading code into it. But after that since pins gets configured so I am not able to debug/load code anymore.'' You MUST NOT change the pins for SWD/JTAG if you expect to use a debugger! It sounds like you have got you debugger/code working again. Bear in mind that (technically) it is not possible to debug the processor in 'low power' mode, Sleep, Stop and Standby modes all stop clocking the ARM core. Once you stop clocking the ARM core - the clock for SWD/JTAG stops! To get around this for 'low power' they simulate the low power modes ie the ARM core is still clocked but the status bits indicate that the processor is stopped.2014-05-27 06:51 AM
http://www.keil.com/forum/57911/