cancel
Showing results for 
Search instead for 
Did you mean: 

GPIO init setting pull to the wrong value in disassembly

JTan.2
Associate II

JTan2_0-1722644267806.png

Hi, I'm finding this strange behaviour whereby I'm unable to turn on the internal pull up for GPIO Port C, on pins 14, 15, and 6.

When I look into the gpio.c generated by CubeMX, I see that the C code is correct. GPIO_NOPULL has value of 0. Yet the disassembly shows that a literal 2 (for pull-down) is being written instead. I'm actually trying to set it to pull up, but no matter what value I use, it just keeps writing 2 instead.

It's killing me as I've also tried to write to the PUPDR directly, but the value is not getting changed. please help!

1 ACCEPTED SOLUTION

Accepted Solutions
JTan.2
Associate II

Sorry, this was a *** question. It seems the IDE had confused the project to load and was running a backup copy of my project instead of the one I was editing. Deleted the backup and everything is fine (probably reload the project would have fixed it too).

View solution in original post

2 REPLIES 2
JTan.2
Associate II

Sorry, this was a *** question. It seems the IDE had confused the project to load and was running a backup copy of my project instead of the one I was editing. Deleted the backup and everything is fine (probably reload the project would have fixed it too).

Glad to see you fixed your case ! Debugger is best friend of our developers