cancel
Showing results for 
Search instead for 
Did you mean: 

Issue when configuring PA0 as input on STM32F030K6T6

JGreg.2
Associate III

Hello,

On a pcb on which there is the STM32F030K6T6, I am facing a strange issue.

First, the context is that I am using different timers, interruptions, DMA, UART, analog inputs and digital outputs (PWM, ON/OFF signals).

2 of the i/o's are concerned by the issue:

  • PA0, which is directly connected to GND, as others i/o.
  • PB3, which is digital output (high level or low level). This output is connected at the top of a voltage divider whose the output drives the input current of a bipolar transistor. The maximum current driven from PB3 is 500uA.

When I am configuring the PA0 as input, with no pulling, the PB3 output can't be drive and remain low even if I order to go to high level. Other functionnalities seem to work fine, the only issue is the PB3 output and this thing happens to only 2 of my 8 prototypes ! The 6 others works fine even with this configuration.

When I am configuring the PA0 as output, push-pull type, it all works perfectly, even for the 2 which weren't working.

That thing doesn't make sense to me at all !

Is there something I am missing with the PA0 configuration as input ? maybe related to other peripherals configuration, i/o drive, etc as something as I souldn't configure it this way because I am already using something, somewhere ?

Thank you in advance,

10 REPLIES 10

Simplify your program up to the point where it stops having this issue.

Or, conversely, start a new program, which handles only these two pins, and gradually add other features.

JW

JGreg.2
Associate III

Dear Waclawek.jan,

Thank you for your reply.

Sure, it would be a method to more deeply understand why and discover the root cause of issue. It would be long and fastidious to do this.

It has been already long to discover why the output on PB3 was not going at high level..

Moreover, it may not bring any further explanation.

As the observation made and mentionned in my previous post is not normal, I am affraid to be missing something that I shouldn't have done, that's why I am asking the question here.

TDK
Guru

Pins in alternate function mode on the STM32F0 are chosen per-peripheral and not per-pin. Possibly this is causing an issue, coupled with a hardware error. Or just a hardware error (solder bridge, missing connection, or similar).

My guess is if you only set PA0/PB3 in the given mode, everything works fine, so the problem would be elsewhere.

Just a guess since there isn't much info here.

> Sure, it would be a method to more deeply understand why and discover the root cause of issue. It would be long and fastidious to do this.

It has been already long to discover why the output on PB3 was not going at high level..

Moreover, it may not bring any further explanation.

Such is the nature of debugging. You get better/faster the more you do it, but avoiding it and grasping at straws is much less likely to bear fruit.

If you feel a post has answered your question, please click "Accept as Solution".
JGreg.2
Associate III

Hello TDK,

Thans for your reply.

Pins in alternate function mode on the STM32F0 are chosen per-peripheral and not per-pin.

  • What do you mean by "pins in alternate function mode" ?

Or just a hardware error (solder bridge, missing connection, or similar).

  • If it would be a hardware error such as solder brige or missing connection, the system woudn't work fine with the other configuration (push-pull output pin mode).
  • But I do agree with you on the fact that it is probably due to a Hardware and Firmware combination use.

My guess is if you only set PA0/PB3 in the given mode, everything works fine, so the problem would be elsewhere.

  • I guess if there is only those 2 configurations, everything would work fine (I will do the test). So the issue is comming because of the use of something.

Such is the nature of debugging. You get better/faster the more you do it, but avoiding it and grasping at straws is much less likely to bear fruit.

  • I guess you are right, as it seems there is not any obvious mistake seen.

Just a guess since there isn't much info here.

  • Which information would you need to do further analysis?
When I have a repeatable problem that only happens on a subset of boards, I would look for a hardware issue. If it's a hardware issue, I'm not going to be able to diagnose it remotely, barring high resolution photos or something similar.
I'm sure there's an explanation, just depends on how much time you want to spend finding it. Producing a minimal working example will help to eliminate possibilities.
If you feel a post has answered your question, please click "Accept as Solution".
JGreg.2
Associate III

I have checked visually with a high zoom the PCB and there is nothing surprizing.

  • Could tell me more about Pins in alternate function mode on the STM32F0 are chosen per-peripheral and not per-pin. => What do you mean by "pins in alternate function mode" ?

JGreg.2
Associate III

I have also just made the tests driving output PB3 at high level with PA0 configured as input (and all others i/o configured as in my project) and it perfectly worked ( I have started over from a new project from Cube Mx, with HAL librairies instead of my initial code which is using LL libraries but I have no choice since LL library are not supported by CubeMx for STM32F0).

JGreg.2
Associate III

After research, I think you are talking about all others functions (from peripherals) than GPIO. But I don't see how it could be the issue. Could you highlight me the point ?

Thank you

TDK
Guru

> I have also just made the tests driving output PB3 at high level with PA0 configured as input (and all others i/o configured as in my project) and it perfectly worked 

Gotta be something else in your code that is causing the issue then. Not sure I have much more info to provide.

Alternate function mode is when pins are used for things like UART, SPI and similar.

If you feel a post has answered your question, please click "Accept as Solution".