This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

GPIO commit reg is read only

Hi,
I am programming a TM4C123GH6PM device from TI and I get an error when trying to modify the GPIO commit register.
It is defined in the GPIOA_Type struct (in C:\Keil_v5\ARM\PACK\Keil\TM4C_DFP\1.0.0\Device\Include\TM4C123\TM4C123GH6PM.h file) as a constant

__I  uint32_t  CR;    /*!< GPIO Commit*/

this makes the compiler to fail with message: "read-only variable is not assignable"
when trying to modify it.
Is this a bug in the header file? How am I supposed to modify this register?

Javi

Parents
  • From the datasheet:

    And is that really all the datasheet has to say about this group of registers? Last I looked, it said something about this entire mechanism not actually existing for the vast majority of GPIOs on that chip.

    So, I do have to set some of the first 8 bits of that register in order to configure the port.

    Actually, you quite likely don't have to, and shouldn't.

Reply
  • From the datasheet:

    And is that really all the datasheet has to say about this group of registers? Last I looked, it said something about this entire mechanism not actually existing for the vast majority of GPIOs on that chip.

    So, I do have to set some of the first 8 bits of that register in order to configure the port.

    Actually, you quite likely don't have to, and shouldn't.

Children
  • You keep saying that I don't have to modify that register but you don't explain why, that's not very useful. In Valvano's ARM cortex-M Microcontrollers book he says that you have to do so for some GPIOs ("Last I looked, it said something about this entire mechanism not actually existing for the vast majority of GPIOs on that chip." yes, you are right, there are only a few GPIOs that use this mechanism but that doesn't mean that you can't use them!).
    If the datasheet defines those bits as modifiable it has no sense to define them as read-only in the header file (in previous versions of the file this didn't happen).
    More people found this issue:
    http://www.keil.com/forum/23862/

    Regards