Keil Logo

C166: Infineon XC16x/XC2xxx Debug Port Selection in Flash


Information in this knowledgebase article applies to:

  • Infineon XE16x and XC2xxx devices
  • PK166 all versions

QUESTION

On my board, the JTAG/DAP debug interface is not connected to the default pins of the Infineon XE17x or XC2xxx microcontroller. In order to use different pins for the JTAG/DAP debug interface, I need to select the debug port with pull-up/down resistors at CFG pins P10[6:0] during startup. These pins can either select a configuration directly, or can select a DBGPRR register configuration from Flash at address 0xC001F0. I have decided to put the configuration into Flash because this is the most flexible option. How can I locate these configuration bytes in the on-chip Flash at this address with the required format.

ANSWER

There is a general issue when you start to use your board with a new or unprogrammed device. As long as the Flash is not programmed correctly, you cannot use the JTAG/DAP debug interface. As long as you cannot use the JTAG/DAP interface, you cannot program the Flash with ULINK2 or an Infineon DAS debugger.
To overcome this issue, you initially need to program at least the configuration bytes of your microcontroller in a different way or via different interface. Here are some ideas:

  • Enable the on-chip bootstrap loader and download an application with configuration bytes via UART or CAN interface. You may use the Infineon MemTool or any other download tool for this.
  • Use a different startup configuration on the CFG pins P10[6:0] and connect the debug interface to the selected pins.
  • Connect ULINK2 or any other debug interface to the default JTAG/DAP pins of the microcontroller.
  • Program the microcontroller before it is soldered to the board. However, if you download an application with no or wrong configuration bytes, you would not have any way to program it again.

Every application which is going to be downloaded to this board needs a correct debug port configuration in the Flash to select the right JTAG/DAP pins. The easiest way to add these configuration bytes is to add the attached configuration file to your project. This assembly file defines the 16 bit configuration value as well as the inverse value on the following bytes. This file can be configured very comfortable with the µVision Configuration Wizard. This is a view of this file with the configuration wizard enabled:

Note: Even if you download an application which does not directly overwrite the 4 configuration bytes in Flash at address 0xC001F0-0xC001F3 (by reserving this area), the chance is quite high that the configuration gets erased. The Flash can only be erased in 4K blocks which means that any code or constants in the area 0xC00000-0xC00FFF would require an erase of this sector.

MORE INFORMATION

SEE ALSO


ATTACHED FILES

Request the files attached to this knowledgebase article.

Last Reviewed: Thursday, February 25, 2021


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.