Help Flashing Infineon XC164CS-16F (XC16X series) Micro with MemTool - Page 1
Forum section: electronics / general

author: fmashockie
author_rank: Frequent Contributor
timestamp: April 03, 2024, 02:17:41 am
content: Hey y'all! I am struggling with attempting to flash a Infineon XC164CS-16F micro. This type of microcontroller is used on the mainboard of centrifuge that I am trying to repair. The micro definitely died so I did replace it with a new one, however, I am struggling to program it.I have only flashed a micro one other time - an STM32 series, and with some help, it was relatively straightforward. However, with this Infineon series micro, I am struggling to find adequate info/resources to perform this flash. They give a lot of examples using some of their evaluation/starter boards, but I am hoping to flash the chip from a working centrifuge mainboard in-circuit (without removing it from the board).I have downloaded Infineon's MemTool software which seems easy enough to use if I could get the micro to connect. I have tried putting the micro in BSL mode, but I'm not sure if I have it right. Right now I have tried the following:For BSL mode, I configured the following pins as stated below, and reset the micro by pulling pin 1 RSTIN low:EA pin 66 = HighALE pin 65 = LowWR pin 64 = HighRD pin 63 = LowI have the following pins connected to a UART to USB converter FTDI C232HD cable:RxD0 P3.11 pin 49 connected to TxD of cableTxD0 3.10 pin 48 connected to RxD of cableI've tried both default Target files in MemTool and creating my own Target file, but I always get the same result when trying to connect (see attached photo).I've also included a schematic of micrcontroller section of the board I am trying to repair. Also, here are links to the user manual for the XC164CS-16F and some additional resources I've been using to try to accomplish this.XC164CS-16F user manual- chrome-extension://efaidnbmnnnibpcajpcglclefindmkaj/https://www.infineon.com/dgdl/xc164_um_v2.1_2004_03_sys.pdf?fileId=db3a304412b407950112b40ae71906bfXC164CS Easy Kit Board manual- chrome-extension://efaidnbmnnnibpcajpcglclefindmkaj/https://www.farnell.com/datasheets/17493.pdfInfineon MemTool for XMC1000 family- chrome-extension://efaidnbmnnnibpcajpcglclefindmkaj/https://www.infineon.com/dgdl/Infineon-TOOL_Tutorial_Memtool_XMC1-TR-v01_00-EN.pdf?fileId=5546d462525dbac401530e93cdc9061fIf there's anything else I can include so that you guys can better assist me, please just let me know. I would greatly appreciate anyone's help with this!Thanks!-Frank

author: fmashockie
author_rank: Frequent Contributor
timestamp: April 03, 2024, 08:18:33 pm
content: Okay so I figured out how to successfully connect with the micro using MemTool and my UART to USB cable. I read the flash memory from the working centrifuge's microcontroller. I took that hex file and saved it onto my PC. However, I noticed that the file size is ~300kB. The SAF-XC164CS-16F has only 128kB of program memory. So why is the file size so large? I have attached the hexfile for reference (XTR_1.hex).In MemTool, when you ask to read the target (i.e. micro), it takes you to this window (see photo below). In that photo are the settings I picked for reading the existing/working micro.And then finally, when I try to program the new micro with the hex file I saved (the one that is too big), I get another error message. In MemTool, before you program, you have to select the hexfile you wish to use for programming. When I do that I get the following message "WARNING: Not all sections added to FLASH buffers. Check mapping". I have included a photo of that as well.Also, here is a tutorial I found on YouTube of someone showing what I am trying to accomplish. MemTool doesn't seem that well known (possibly because it is outdated?). Just trying to provide additional resources so someone could help me better.I feel like I'm pretty close to getting this if someone could help me with this final step! I would greatly appreciate it!! Thank you!!-Frank

author: fmashockie
author_rank: Frequent Contributor
timestamp: April 03, 2024, 09:39:11 pm
content: Another update: I was able to get passed that error/warning message in MemTool. I read the working micro breaking it up into mapped sectors as specified in the datasheet. This allowed me to select the hexfile (I have attached the updated file below. It is XTR_4.hex) and program the new micro.However, it is still not working. Is it possible that it is because the original is read-protected? How would I be able to tell? During programming, the software stated it was able to successfully program ~120kB. Would that still occur if the micro I was trying to flash was protected?Any additional insight would be greatly appreciated!

author: fmashockie
author_rank: Frequent Contributor
timestamp: April 04, 2024, 03:02:21 pm
content: I didn't consider this when I posted, but I'm sure some members might feel some type of way about helping someone trying to 'flash' a MCU. I just want to reiterate, I am just trying to repair this mainboard for a centrifuge at my company. The mainboard is perfectly fine otherwise. It is a waste to have to chuck this one and buy a replacement (for $1-2k from manufacturer) all because of a failed micro. I have no interest in reverse engineering or anything malicious, I just want to repair this board for my colleagues so I can get this piece of equipment back up and running for them.I would greatly appreciate if anyone could look at that hexfile for me or provide any other insight. Thank you!-Frank

author: fmashockie
author_rank: Frequent Contributor
timestamp: April 05, 2024, 03:16:00 am
content: Update: Looks like I performed the flash successfully after all! It turns out a bad decoder IC (D43, 74HCT138) was likely the cause for the issue I was seeing.

author: xradiotex
author_rank: Newbie
timestamp: June 17, 2025, 08:32:19 am
content: How could the xc164cs flash, what signals did it send to 63,64,65,66 legs for reading, what signals for writing?