Skip to main content
Explorer
August 3, 2024
Solved

GPIO init setting pull to the wrong value in disassembly

  • August 3, 2024
  • 1 reply
  • 1043 views

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!

    This topic has been closed for replies.
    Best answer by JTan.2

    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).

    1 reply

    JTan.2AuthorAnswer
    Explorer
    August 3, 2024

    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).

    Technical Moderator
    August 3, 2024

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