cancel
Showing results for 
Search instead for 
Did you mean: 

Why Would STM32F334 GPIO Port A Pin15 MODER Register Read "0x-2"

ambrose
Associate II

Hi, I had a weird issue with an STM32F334 MCU. A pin was configured as Open Drain - this pin is used for falling edge interrupt and pulled up by a different section of the design. But I had issue today with the operation of the pin and realised the MODER Register read "0x-2". What does this mean please? I have solved this issue by locking the pin, but I just want to know if this makes any sense. I am using Ride 7 IDE.

9 REPLIES 9
TDK
Guru

PA15 is configured with a pullup after reset as it's a JTAG pin.

0693W00000JPB6GQAX.png

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

Hi, thanks a million for the response. this is true, but my issue occurs after the application has been running for a while. It actually forces the pin low.

> But I had issue today with the operation of the pin and realised the MODER Register read "0x-2".

Show, together with other pins and perhaps also the correct setting for this pin.

There are probably not many RIDE users here.

If GPIOx_MODER register changes "spuriously" (which almost always means some bug in code), you can try to catch it by setting a data breakpoint (sometimes called watchpoint) onto the given register.

JW

ambrose
Associate II

Thanks for the response. Yes it "almost always means some bug in code", but there is no reference to that pin any where in the code after configuration. But I am not really bothered about this bug; this product has been on sale for over 5 years and customers are happy. … My question should probably be "does "0x-2" that is "zero-ex-dash-two" in a register mean anything? Or is it just the IDE?" (BTW, I am not using Ride 7 for version 2 of this product, but STM32CubeIDE.

Bob S
Principal

> but there is no reference to that pin any where in the code after configuration

Then you have a stray pointer somewhere. And if it is (trying to) clobber the MODER, what else might be getting overwritten?

> But I am not really bothered about this bug; this product has been on sale for

> over 5 years and customers are happy

What The ?????? Maybe your device works "well enough" but your customers know "you just have to power cycle it once in a while" (kinda like Windows). Or maybe everything else really is OK. But you will never know until you find the source of the problem.

> "does "0x-2" that is "zero-ex-dash-two" in a register mean anything?

My guess (and it is just a guess) is that you have expanded the 32-bit MODER register to show each individual pair of bits??? And the dash just means there aren't really that many bits.

ambrose
Associate II

thanks a million. hahahahahahahahahahahahahaha

>>>> Then you have a stray pointer somewhere. And if it is (trying to) clobber the MODER, what else might be getting overwritten?

I sure hope not (LOL).

>>>>What The ?????? Maybe your device works "well enough" but your customers know "you just have to power cycle it once in a while" (kinda like Windows). Or maybe everything else really is OK. But you will never know until you find the source of the problem.

When this happened a line that affects 9 different boards was pulled low. this means 36 channels will be stuck in one state... This will certainly make our customers scream at us _ I know, and I know them.

It could have been a fluke. who knows?

>>>>My guess (and it is just a guess) is that you have expanded the 32-bit MODER register to show each individual pair of bits??? And the dash just means there aren't really that many bits.

Don't remember doing that.

“0x-2�? is not a 32bit integer value and cannot be in a 32 bit register.
If you feel a post has answered your question, please click "Accept as Solution".

Off course it is not a number. That is the point of this question.

Maybe you can share a screenshot or something that would explain better. It’s certainly not the value in the register, so it must be a display thing in whatever you’re using to view it.
If you feel a post has answered your question, please click "Accept as Solution".