This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/CC2640R2F: CC2640R2 Code Composer, can't read GPIO and other registers

Part Number: CC2640R2F
Other Parts Discussed in Thread: LAUNCHXL-CC2640R2

Tool/software: Code Composer Studio

We are working with the i2ctmp116_CC2640R2_LAUNCHXL_tirtos_ccs project.  We are using the TI CC2640R2 Development Kit board.  The board also has LAUNCHXL-CC2640R2 Rev 1.0  written on it.

We can compile the code, and download it to the board without any errors reported.  We made sure that all breakpoints were removed, and hit F7 to make sure that the code started running after it was downloaded.

If we then the go to the 'View' menu option and select 'Registers', it opens up a window with a list of registers.

If we click on the '>' next to the GPIO to expand and see the values on the GPIO pins, we see 'Error: unable to read' on each GPIO.  We get the same 'Error: unable to read' error when we try to see the values of most other registers.  We CAN, however, see the contents of the flash.

What is wrong?  How can we see the contents of the registers?

Thanks for any help you can give,

Dan Benkman
Innowave

  • Hi Dan,
    I was able to reproduce the issue also. After checking with my colleague, I was able to confirm that that it is because several peripherals (like GPIO) are powered off by default - hence not accessible. Once they are initialized (turned on), then it will be available.

    For the i2ctmp116 example, once I stepped over line 64 in main_tirtos.c, the GPIO registers became available. That line calls board_init(), which likely turns on GPIO.

    Thanks
    ki
  • Ki, thanks for your help. Stepping over board_init() does indeed enable the GPIOs to be read. However, if I make the code run, (Ctrl F8), the GPIOs again cannot be read.

    What makes it a little confusing is that once they are read, the Register display window won't necessarily show you if it can no longer read a GPIO. The best way to make certain appears to be to close the Register display window, select View -> Registers again, and then click on the refresh icon. It will then tell you if a GPIO can currently be read or not, even if was read from before.

    I would hate to have to repeatedly call board_init() over and over again in various parts of our code in order to keep the GPIOs enabled.

    Another simple question. There are many calls to Display_printf(), but nothing is printed on either the Console or Terminal windows. Where does Display_printf() print to? Is there a display module that connects to the TI CC2640R2 Development Kit board? How do we get such a display?

    Can we redirect the printf's to a CCS window? Do we need to comment out all these Display_printf() calls in the final code?

    Thanks for your help!

    Dan Benkman
    Innowave
  • If I put a 'while(1)' at the end of the code in i2ctmp116.c, so it loops forever instead of returning, and when I pause the code, I can see the contents of the GPIOs.

    I will post another question about Display_printf().
  • Daniel Benkman said:
    What makes it a little confusing is that once they are read, the Register display window won't necessarily show you if it can no longer read a GPIO. The best way to make certain appears to be to close the Register display window, select View -> Registers again, and then click on the refresh icon. It will then tell you if a GPIO can currently be read or not, even if was read from before.

    Unless the continual refresh option in the Register View is enabled, the view will only access memory when manually refreshed or when the target is next halted. 

    Daniel Benkman said:
    I will post another question about Display_printf().

    Thanks. I'm not sure how Display_printf works. It is likely redirecting IO to some peripheral (LCD display?). This is device specific, hence a new thread in the device forum is best.