Programming Infineon SAF-C164CI-8RM MCU - Page 1
Forum section: electronics / general

author: gaminn
author_rank: Frequent Contributor
timestamp: June 25, 2024, 12:51:52 pm
content: Hi, what tool (both HW and SW) can used to program Infineon SAF-C164CI-8RM MCUs? I found a datasheet of this MCUhttps://www.keil.com/dd/docs/datashts/infineon/c164ciclsisl_um.pdf, but I can't find any information on that topic. I also can't find what pins of the MCU do I connect the programmer to. Hopefully someone knows...

author: Postal2
author_rank: Frequent Contributor
timestamp: June 25, 2024, 02:28:58 pm
content: I'm using "Minimon" for this kind of chips. But especially for c164 there is some trouble with external flash. This is not relative to internal flash.

author: gaminn
author_rank: Frequent Contributor
timestamp: June 25, 2024, 03:36:24 pm
content: Thanks a lot. My board doesn't have an external flash memory.What pins do I connect the programmer to? TxD0 and RxD0? What if TxD0 and RxD0 are already used by the application? What baud rate/parity/Data Bits/Stop Bits do I set?Many of my questions would be answered by some official document describing the programming interface. Is there any?

author: Postal2
author_rank: Frequent Contributor
timestamp: June 25, 2024, 04:19:34 pm
content: Search keyword "BSL" in your document. But your MCU uses mask-rom, not flash.OTP is used in ...-8EM, and I only bought such chips, because they are much cheaper than those that have no memory at all, although they replace them perfectly.

author: gaminn
author_rank: Frequent Contributor
timestamp: October 09, 2024, 04:48:49 pm
content: I was able to connect to my SAF-C164CI-8RM MCU using Minimon. First I connected pins of the MCU like this: RD=0, ALE=0, EA=1, then connceted P3.10/TxD0 and P311/RxD0 to an USB/UART 5V converter.In Minimon, I went to Target -> Configuration, where I selected Controller type = C164CI-8R and Initialize register to SYSCON = 0x0600 and BUSCON0 = 02C0. I connected to the target and uploaded data from address range 0x0000 - 0x7FFF and 0x18000 - 0x1FFFF (which hopefully should be ROM of the MCU) to Minimon:Code:*Loader file Prepare*Minimon file Prepare*send 0 Byte + Loader + MinimonCore*RECEIVE - MC-Identifier: D5*RECEIVE - LoaderACK 01 received*RECEIVE - Minimon ACK 03 received*Minimon successfully launched*Reset: BUSCON0=02C0*Reset: SYSCON=0690*Reset Configuration: External Bus disabled*Reset Configuration: 16 Bit multiplexed Bus*Reset Configuration: WR# acts as WRL#, BHE# acts as WRH# (P0H.0=1)*Reset Configuration: On chip watchdog timer is enabled (RD#=1)*Reset Configuration: Lengthened ALE signal*Initialisation: Write to SYSCON*Initialisation: Write to BUSCON0*Initialisation: Enable X-Peripherals via SYSCON*Initialisation: Call EINIT Command*Upload: 1024 bytes*Upload: 2048 bytes*Upload: 3072 bytes*Upload: 4096 bytes*Upload: 5120 bytes*Upload: 6144 bytes*Upload: 7168 bytes*Upload: 8192 bytes*Upload: 9216 bytes*Upload: 10240 bytes*Upload: 11264 bytes*Upload: 12288 bytes*Upload: 13312 bytes*Upload: 14336 bytes*Upload: 15360 bytes*Upload: 16384 bytes*Upload: 17408 bytes*Upload: 18432 bytes*Upload: 19456 bytes*Upload: 20480 bytes*Upload: 21504 bytes*Upload: 22528 bytes*Upload: 23552 bytes*Upload: 24576 bytes*Upload: 25600 bytes*Upload: 26624 bytes*Upload: 27648 bytes*Upload: 28672 bytes*Upload: 29696 bytes*Upload: 30720 bytes*Upload: 31744 bytes*Upload: 32768 bytes*Upload: 33792 bytes*Upload: 34816 bytes*Upload: 35840 bytes*Upload: 36864 bytes*Upload: 37888 bytes*Upload: 38912 bytes*Upload: 39936 bytes*Upload: 40960 bytes*Upload: 41984 bytes*Upload: 43008 bytes*Upload: 44032 bytes*Upload: 45056 bytes*Upload: 46080 bytes*Upload: 47104 bytes*Upload: 48128 bytes*Upload: 49152 bytes*Upload: 50176 bytes*Upload: 51200 bytes*Upload: 52224 bytes*Upload: 53248 bytes*Upload: 54272 bytes*Upload: 55296 bytes*Upload: 56320 bytes*Upload: 57344 bytes*Upload: 58368 bytes*Upload: 59392 bytes*Upload: 60416 bytes*Upload: 61440 bytes*Upload: 62464 bytes*Upload: 63488 bytes*Upload: 64512 bytes*Upload: 65536 bytesIf I click on View -> Disassemble, I always get something like this:Code:002BA0: TRAP #7B002BA2: TRAP #7B002BA4: RETI002BA6: RETI002BA8: BSET R13.9002BAA: BSET R13.9002BAC: RETI002BAE: RETI002BB0: RETS002BB2: RETS002BB4: BSET R12.9002BB6: BSET R12.9002BB8: BSET R12.15002BBA: BSET R12.15002BBC: RETI002BBE: RETI002BC0: Illegal Operand*****************************I'm not an expert but the code doesn't look valid to me. Can somebody confirm? What should I do to read valid code from the MCU?Also, if I change e.g. first two bytes (address 0x0000 and 0x0001) and I click Download to write 32 byte long chunk of data I just edited to MCU, I get:Code:*ERROR: download not successfulHow to write code to MCU's ROM?

author: Atlan
author_rank: Frequent Contributor
timestamp: October 10, 2024, 10:52:00 am
content: It has rom memory, not flash. And u will be locked for reading.

author: gaminn
author_rank: Frequent Contributor
timestamp: October 31, 2024, 07:27:10 am
content: Quote from: Atlan on October 10, 2024, 10:52:00 amThanks. How can I tell then it is locked for reading? I still get some data shen reading the ROM.

author: gaminn
author_rank: Frequent Contributor
timestamp: May 29, 2025, 08:21:09 am
content: Still, I'm not sure my SAF-C164CI is locked for reading. I can connect to it and everytime I read it, I get "some" data, they are all the same everytime, they are not all 0xFFs or 0x00s. In datasheethttps://www.keil.com/dd/docs/datashts/infineon/c164ciclsisl_um.pdfthey write that ROM can be protected against read if customer orders this feature and that then all ROM read access from outside returns 0x009B which is not my case.Also, what range of memory is used for program code? And would it be possible to load the code read for SAF-C164CI (ROM memory) and write it to SAK-C164CH-8FM (it looks to me that it is the same MCU only with Flash memory)? How?