2018-06-07 12:58 PM
Hi,
i am beginner in stm32
I configured SWCLK AND SWDIO for Serial Debugging.
Can I Change SWCLK and SWDIO as input and output at runtime?
If Change the MCU is RESET or Not?
2018-06-07 01:22 PM
>>Can I Change SWCLK and SWDIO as input and output at runtime?
Yes
>>If Change the MCU is RESET or Not?
No, but the debugger connectivity will drop/fail. If you leave the debugger attached it is likely to interfere with other GPIO usage.
2018-06-07 09:40 PM
Hello,
Could you please share with us bit more part of the code when complete configuration of those IOs and its data manupulation is vitible, please? Is the debugger connected all the time during this rpocess?
Thank you in advnac,e
Best Regards,
Artur
2018-06-07 10:06 PM
At which moment MCU is resetting? Before or after GPIOA->ODR=1<<15; ? Is MCU resetting as well if you do not modify PA15?
Would it be possible for you to have a look at RCC->CSR register after the reset, please? It would give us some guidance about possible root cause.
2018-06-07 11:32 PM
I set GPIO GPIOA->ODR=1<<15 That time also change the SWCLK and SWDIO in STM32l071
but MCU is resetting
why MCU is resetting?
2018-06-07 11:49 PM
int main()
{
while(1)
{
if(wakeupflag==1)
{
EEPROM_READ();
GPIOA->ODR=1<<15;
post_data();
GPIOA->ODR=0<<15;
}
}
}
static void MX_GPIO_Init(void)
{GPIO_InitTypeDef GPIO_InitStruct; /* GPIO Ports Clock Enable */ __HAL_RCC_GPIOB_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); HAL_GPIO_WritePin(GPIOA, GPIO_PIN_15, GPIO_PIN_RESET);/*Configure GPIO pin : PA15 */
GPIO_InitStruct.Pin = GPIO_PIN_15; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); /*Configure GPIO pin Output Level */ HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4, GPIO_PIN_RESET);/*Configure GPIO pin : PA4 */
GPIO_InitStruct.Pin = GPIO_PIN_4; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);}i have connect GSM control pin porta 15 pin after wakeup flag set using RTC write data to eeprom and read eeprom
but device resetting
2018-06-08 12:23 AM
i am testing with debugging resetting is not getting after remove debugger and after 3 hours wakeup flag set that time device is resetting
2018-06-08 05:07 AM
Why write all the other bits to zero? What else is connected on Bank A?
Use
GPIOA->ODR |= (1<<15); // Set PA15
and
GPIOA->ODR &= ~(1<<15); // Clear PA15
2018-06-08 05:15 AM
Thank you but i need information any possibility to resetting the MCU to write like this
GPIOA->ODR = 1<<15; // Set PA15
and
GPIOA->ODR = 0<<15; // Clear PA15
So my MCU resetting for this reason or else ?
2018-06-08 05:38 AM
FFS, what else have you got connected on your board for pins PA0 thru PA14? Your code sets these all to ZERO, arbitrarily, with whatever ramifications that has with your design, which you haven't really shared.