Page 1 of 2

STM32F103C: really strange behavior

Posted: Thu Sep 20, 2012 11:17 am
by ucasano
Hi, I am facing a strange behavior of my stm32f103C custom board.
I will explain briefly.

PA11 pin is configured as normal input: #define VAL_GPIOACRH 0xB44B44B3 /* PA15...PA8 */
PA11 input pin is low on the board: I checked through scope.
PA11 is high in Chibios: palReadPad(GPIOA, 11);
PA11 is high in internal GPIOA register: in gdb the command "x/2bt 0x40010808", which should be port A input register, gives: 0x01011100 0x11011101

Am I missing something? What am I doing wrong?

I amusing Chibios 2.5.0

Thank you for your replies.
-g

Re: STM32F103C: really strange behavior

Posted: Thu Sep 20, 2012 11:21 am
by Giovanni
Does GPIOA CRH really contains 0xB44B44B3 at runtime? it could be a misconfiguration.

Giovanni

Re: STM32F103C: really strange behavior

Posted: Thu Sep 20, 2012 12:12 pm
by ucasano
Hi Giovanni, so i will do when i'll be back at work.

Question: how much can we rely upon gpio configuration made in board.h file?

-g

Ps. Automatic corrector of iPhone/iPad really sucks!

Re: STM32F103C: really strange behavior

Posted: Thu Sep 20, 2012 12:25 pm
by Giovanni
It is very reliable, I believe it is not a software problem but something in HW or project setup.

Giovanni

Re: STM32F103C: really strange behavior

Posted: Thu Sep 20, 2012 12:37 pm
by ucasano
Hardware? But i did check with scope! It's low, no way.

Re: STM32F103C: really strange behavior

Posted: Thu Sep 20, 2012 1:51 pm
by ucasano
I confirm GPIOA_CRH register contains 0xb44b44b3.

any ideas?

-g

Re: STM32F103C: really strange behavior

Posted: Thu Sep 20, 2012 1:54 pm
by ucasano
If I attach the scope on the testpad, device seems to work... maybe I have to ship the board with included a scope?
Or maybe I should configure the input as pullup/down?

What do you think?
-g

Re: STM32F103C: really strange behavior

Posted: Thu Sep 20, 2012 2:15 pm
by Giovanni
Input pins have to be driven or they "float", a pull-up is required if you don't have anything driving the input.

Also make sure to pull-up unused pins, this is a common error and source of EMI problems.

Giovanni

Re: STM32F103C: really strange behavior

Posted: Thu Sep 20, 2012 2:25 pm
by ucasano
Well, PA11 is directly feeded by a voltage level translator. No pull up or pull down are required.
But, if I attach the scope probe, everything works fine. If I detach the scope, system stops working.

Do you have an explanation for this?
-g

Re: STM32F103C: really strange behavior

Posted: Thu Sep 20, 2012 2:35 pm
by ucasano
I configured PA11 as input pulldown and everything works, now: so the Mohm pulldown of scope probe worked like a charm ;)

If interested in investigating more, and I am still interested in understanding this behavior, I can tell you PA11 was feeded by port B of TXS0108,
a voltage level translator of TI.

Thanks a lot.
bye

-g