cancel
Showing results for 
Search instead for 
Did you mean: 

SPI3 and JTAG on Connectivity line

lorenzo23
Associate II
Posted on April 16, 2010 at 12:23

SPI3 and JTAG on Connectivity line

4 REPLIES 4
niko2
Associate II
Posted on May 17, 2011 at 13:47

I'm using SPI3 for I2S with default i/o. I have following code to make sure pins are available for SPI3

/* use swd */

GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable, ENABLE);

 /* make sure i2s3 i/o is not blocked by swo */

DBGMCU->CR &= ~0xe0;

If you're using IAR you must also disable automatic SWO enable that the C-spy performs every time it gains control of mpu.

Create file setup_macro.mac (or any other name, it doesn't really matter) and put the following line in it:

CALL 278767s_IAR

Then open Project->Options->Debugger dialog and enable ''Use macro file(s)'' checkbox and type complete path to the macro file you just created into one of the text edit-fields below the check box.

This should do the trick for IAR users. I don't know about other IDEs.

I hope this helps.

--

niko

lorenzo23
Associate II
Posted on May 17, 2011 at 13:47

>>I'm trying to use SPI3 on 107 part without success.

>>I'm using the same driver I have been using with STM3210C eval

>>board which uses SPI3 to connect with the TFT. The main difference

>>is that

>I'm using SPI3 for I2S with default i/o. I have following code to make sure pins

>are available for SPI3

Thanks Niko for your answer.

I'm still looking into it. I have already disabled JTAG pins and trace into my Keil project, in fact connection with my ULink is no longer available and I have to flash firmware via bootloader.

Now I'm trying to drive PB3 and PB5 as simple GPIOs, but these pins are still stuck.

I added your code, but problem still persists.

Thanks in advance,

Lorenzo

lorenzo23
Associate II
Posted on May 17, 2011 at 13:47

I did a silly mistake in the schematic... I choose 10K instead 0 ohm (wrong copy & paste!) so the line resistance was too high for driving a long trace + some input pads...

Furthermore, disabling JTAG-DP only (leaving SW-DP enabled) I'm able to use the Ulink debugger with SPI3!

Lorenzo

niko2
Associate II
Posted on May 17, 2011 at 13:47

I remember having one pin stuck to one value even if used as GPIO, rest worked ok. The stuck pin was SWO. My problem was caused by IAR. You can still use SWD with SPI3 just fine if your jtag-interface supports it.

Are you using an pcb with external pull-ups/downs connected to the ios you cannot control? STM3210-eval-C had external pullups or down on some debug lines if I remember correctly and those had to be removed in order to get the spi3 work correctly.