STM32F1 and JTAG disable

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: barthess, RoccoMarco

drgowen
Posts: 12
Joined: Tue Aug 27, 2013 3:28 pm

STM32F1 and JTAG disable

Postby drgowen » Fri Jan 01, 2016 7:54 pm

Hi folks

I've been tearing my hair out over this. I want to use PB3 as a GPIO and am currently doing the following:

Code: Select all

 halInit();
  chSysInit();

  AFIO->MAPR |= ((0b010)<<10); //(tim3 remap)
  AFIO->MAPR |= ((0b010)<<24); (SWJ_CONFIG)
  palSetPadMode(GPIOB, 3, PAL_MODE_STM32_ALTERNATE_PUSHPULL);


at the beginning of main. But sufficed to say it's still not allowing pb3 to function as GPIO.

What is the correct procedure for this?

Many thanks
Gareth

User avatar
Giovanni
Site Admin
Posts: 14565
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1112 times
Been thanked: 937 times
Contact:

Re: STM32F1 and JTAG disable

Postby Giovanni » Fri Jan 01, 2016 8:25 pm

I never did that, please read carefully the RM and also the errata, there are several bugs affecting AFIO.

Giovanni

zhu
Posts: 2
Joined: Tue Jan 12, 2016 12:28 pm
Been thanked: 1 time

Re: STM32F1 and JTAG disable

Postby zhu » Tue Jan 12, 2016 1:54 pm

hi,
try add afio mapping in boardInit method

/*
* Board-specific initialization code.
*/
void boardInit(void)
{
//JTAG-DP Disabled and SW-DP Enabled
AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE;
}


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 35 guests