cancel
Showing results for 
Search instead for 
Did you mean: 

How to start a STM32 without active JTAG or SWD Pins....??

askansimon2
Associate II
Posted on October 17, 2011 at 20:07

Hello,

I use STM32 for several years, but know I dont know how to solve this problem.

When I start my STM32

int main(void) { RCC_Configuration(); NVIC_Configuration(); GPIO_Configuration(); ADC_Configuration(); GPIO_PinRemapConfig(GPIO_Remap_SWJ_Disable, ENABLE); // Disable JTAG/SWD so pins are availble UART_Configuration(); if (SysTick_Config(SystemFrequency / 1000)) { while (1) {;} } // Pins Off GPIOA->BRR = (GPIO_Pin_8 | GPIO_Pin_14 | GPIO_Pin_11 | GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_15); GPIOB->BRR = (GPIO_Pin_4 | GPIO_Pin_5);

I have to remap JTMS/SWDIO Pins. Later I put all Pins to Off.

But it is too late. PA13 has Main-Function ''JTMS/SWDIO'' and

PA15 ''JTCK/SWCLK'', PA13 always starts with On, for a secound.

This makes problems with additional electronic....

Does anybody know, how to start up a STM32, without active

''JTMS/SWDIO'' and ''JTCK/SWCLK'' Pin?

Thank you very mutch.

Best Regards

Simon

11 REPLIES 11
Posted on October 19, 2011 at 23:37

Sounds like you're missing an include file. You could add a call to RCCPreInit() in the startup.s file before it calls SystemInit(). Or you could leave the code in your main.c file and call it from SystemInit() thus:

 

extern void RCCPreInit();

void SystemInit (void)

{

  RCCPreInit();

 ..

I don't think you need to go back to a 2.x library, you just have to understand the start up flow of the 3.x code, and observe there are things the C-runtime, and platform initialization do before calling main(). I'm not sure I like the ''man behind the curtain'' approach that CMSIS brings, and it means I'm more likely to customize the library code rather than use it as-is which kind of reduces the value of abstracting it there in the first place.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
askansimon2
Associate II
Posted on October 20, 2011 at 12:09

Dear Clive1,

thank you very mutch for excellent help. I think I have now only a few millisecounds with Pin On,

I think this should work 🙂

Best Regards

Simon