Author Topic: Programming Infineon SAF-C164CI-8RM MCU  (Read 2331 times)

0 Members and 1 Guest are viewing this topic.

Offline gaminnTopic starter

  • Frequent Contributor
  • **
  • Posts: 342
  • Country: 00
Programming Infineon SAF-C164CI-8RM MCU
« on: June 25, 2024, 12:51:52 pm »
Hi, what tool (both HW and SW) can used to program Infineon SAF-C164CI-8RM MCUs? I found a datasheet of this MCU https://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...
 

Offline Postal2

  • Frequent Contributor
  • **
  • Posts: 695
  • Country: ru
Re: Programming Infineon SAF-C164CI-8RM MCU
« Reply #1 on: June 25, 2024, 02:28:58 pm »
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.
 

Offline gaminnTopic starter

  • Frequent Contributor
  • **
  • Posts: 342
  • Country: 00
Re: Programming Infineon SAF-C164CI-8RM MCU
« Reply #2 on: June 25, 2024, 03:36:24 pm »
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?
 

Offline Postal2

  • Frequent Contributor
  • **
  • Posts: 695
  • Country: ru
Re: Programming Infineon SAF-C164CI-8RM MCU
« Reply #3 on: June 25, 2024, 04:19:34 pm »
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.
« Last Edit: June 25, 2024, 04:25:51 pm by Postal2 »
 

Offline gaminnTopic starter

  • Frequent Contributor
  • **
  • Posts: 342
  • Country: 00
Re: Programming Infineon SAF-C164CI-8RM MCU
« Reply #4 on: October 09, 2024, 04:48:49 pm »
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: [Select]
*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 bytes

If I click on View -> Disassemble, I always get something like this:

Code: [Select]
002BA0: TRAP    #7B
002BA2: TRAP    #7B
002BA4: RETI   
002BA6: RETI   
002BA8: BSET    R13.9
002BAA: BSET    R13.9
002BAC: RETI   
002BAE: RETI   
002BB0: RETS   
002BB2: RETS   
002BB4: BSET    R12.9
002BB6: BSET    R12.9
002BB8: BSET    R12.15
002BBA: BSET    R12.15
002BBC: RETI   
002BBE: RETI   
002BC0: 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: [Select]
*ERROR: download not successful
How to write code to MCU's ROM?
« Last Edit: October 09, 2024, 04:53:52 pm by gaminn »
 

Offline Atlan

  • Frequent Contributor
  • **
  • Posts: 473
  • Country: sk
Re: Programming Infineon SAF-C164CI-8RM MCU
« Reply #5 on: October 10, 2024, 10:52:00 am »
It has rom memory, not flash.  And u will be locked for reading.
FNIRSI 1013D Always provide a picture or video with the problem where the parameters of the oscilloscope are visible, and a picture of the diagnostic screen with the values.
 

Offline gaminnTopic starter

  • Frequent Contributor
  • **
  • Posts: 342
  • Country: 00
Re: Programming Infineon SAF-C164CI-8RM MCU
« Reply #6 on: October 31, 2024, 07:27:10 am »
It has rom memory, not flash.  And u will be locked for reading.

Thanks. How can I tell then it is locked for reading? I still get some data shen reading the ROM.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf