cancel
Showing results for 
Search instead for 
Did you mean: 

Strange situation for a newbie

Posted on June 30, 2010 at 00:01

Strange situation for a newbie

3 REPLIES 3
raptorhal2
Lead
Posted on May 17, 2011 at 13:56

I believe it is simple. PA15 default after reset is JTAG Data In. Use another pin.

Cheers, Hal

Posted on May 17, 2011 at 13:56

I have thought about that and I used this:

    GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable | GPIO_Remap_SWJ_NoJTRST, ENABLE);

since I am using SWJ 3pin, shouldn't this be OK to release that pin?

This is my GPIO config:

void Port_Configuration(void) {

    GPIO_InitTypeDef GPIO_InitStructure;

    GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable | GPIO_Remap_SWJ_NoJTRST, ENABLE);

    RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA|RCC_APB2Periph_GPIOB|RCC_APB2Periph_GPIOC|RCC_APB2Periph_GPIOD|RCC_APB2Periph_AFIO, ENABLE); 

   

// SPI Bitbang -----------------------------------------------------------------

    GPIO_InitStructure.GPIO_Pin   =  GPIO_Pin_5 | GPIO_Pin_7;

    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

    GPIO_InitStructure.GPIO_Mode  = GPIO_Mode_Out_PP;

    GPIO_Init(GPIOA, &GPIO_InitStructure);

    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;

    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;

    GPIO_Init(GPIOA, &GPIO_InitStructure);

// SST25 CS------------------------------------------------------------------------

                                                        

    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);

}

Thanks

Frank

chikos332
Associate II
Posted on May 17, 2011 at 13:56

Hi,

The remap is part of the AFIO IP, so you are using the IP before enabling its clock:

RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA|RCC_APB2Periph_GPIOB|RCC_APB2Periph_GPIOC|RCC_APB2Periph_GPIOD|RCC_APB2Periph_AFIO, ENABLE); 

//then you can call

GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable | GPIO_Remap_SWJ_NoJTRST, ENABLE);