STM32F103C: really strange behavior

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

ucasano
Posts: 57
Joined: Mon Aug 06, 2012 1:05 pm
Has thanked: 1 time

STM32F103C: really strange behavior

Post 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
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: STM32F103C: really strange behavior

Post by Giovanni »

Does GPIOA CRH really contains 0xB44B44B3 at runtime? it could be a misconfiguration.

Giovanni
ucasano
Posts: 57
Joined: Mon Aug 06, 2012 1:05 pm
Has thanked: 1 time

Re: STM32F103C: really strange behavior

Post 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!
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: STM32F103C: really strange behavior

Post by Giovanni »

It is very reliable, I believe it is not a software problem but something in HW or project setup.

Giovanni
ucasano
Posts: 57
Joined: Mon Aug 06, 2012 1:05 pm
Has thanked: 1 time

Re: STM32F103C: really strange behavior

Post by ucasano »

Hardware? But i did check with scope! It's low, no way.
ucasano
Posts: 57
Joined: Mon Aug 06, 2012 1:05 pm
Has thanked: 1 time

Re: STM32F103C: really strange behavior

Post by ucasano »

I confirm GPIOA_CRH register contains 0xb44b44b3.

any ideas?

-g
ucasano
Posts: 57
Joined: Mon Aug 06, 2012 1:05 pm
Has thanked: 1 time

Re: STM32F103C: really strange behavior

Post 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
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: STM32F103C: really strange behavior

Post 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
ucasano
Posts: 57
Joined: Mon Aug 06, 2012 1:05 pm
Has thanked: 1 time

Re: STM32F103C: really strange behavior

Post 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
ucasano
Posts: 57
Joined: Mon Aug 06, 2012 1:05 pm
Has thanked: 1 time

Re: STM32F103C: really strange behavior

Post 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
Post Reply