Pages: [1]
Author Topic: Need help for Minimon + C167 + 29F400 (Read Ok/Write impossible)  (Read 22979 times)
kitnoos2002
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 8



Hello all!

I try to write in my ECU but I need help with Minimon.
I did a lot of tests for hours and hours.
I read lots of informations on the net.
Infineon C167CS User Manual is very useful but I need help.
http://fbim.fh-regensburg.de/~ems_labor/EMS/docu/Infineon/c167cs_um.pdf

My ECU is a Siemens / VDO 5WY / SIMK43

I can read 29F400 with success OK!
But impossible to Write or Erase...
I had set driver A29F400b.hex

I think the problem come from the registers settings Buscon and Addrsel because maybe I don't understand all very well.

What should be the settings in the [Register] and [Memory] section in file Default.ini ?
What should be 29f400 start address with my config?


Here is my config:

C167CS-LM (No internal Rom)
8mhz x 3 = 24mhz
Connected in Boot-Mode with asc0 port (Usart, NOT K-line)

4MB Flash (AM29F400BB-55)
Word Mode (16 Bit ; Pin "BYTE" to +5V)
16 Bit demultiplexed Bus
OE to C167 Pin CS0 (P6.0)
WE to C167 Pin CS1 (P6.1)
CE to Ground

*Reset: BUSCON0=0680
*Reset: SYSCON=0400
*Reset Configuration: External Bus enabled
*Reset Configuration: 16 Bit demultiplexed Bus
*Reset Configuration: WR# and BHE# retain their normal function (P0H.0=0)
*Reset Configuration: On chip watchdog timer is disabled (RD#=0)
*Reset Configuration: Lengthened ALE signal
RP0H=00C7 (5 "chip select" activated)


--------------
Address Pinout
29F400 / C167

A0 / A1
A1 / A2
A2 / A3
A3 / A4
A4 / A5
A5 / A6
A6 / A7
A7 / A8
A8 / A9
A9 / A10
A10 / A11
A11 / A12
A12 / A13
A13 / A14
A14 / A15
A15 / A16
A16 / A17
A17 / A18
--------------



--------------
Data Pinout
29F400 / C167

DQ0 / AD15
DQ1 / AD13
DQ2 / AD11
DQ3 / AD9
DQ4 / AD0
DQ5 / AD2
DQ6 / AD4
DQ7 / AD6
DQ8 / AD14
DQ9 / AD12
DQ10 / AD10
DQ11 / AD8
DQ12 / AD1
DQ13 / AD3
DQ14 / AD5
DQ15 / AD7
--------------


Thank you for your big help!

Chris
Logged
Tony@NefMoto
Administrator
Hero Member
*****

Karma: +132/-4
Offline Offline

Posts: 1389


2001.5 Audi S4 Stage 3


« Reply #1 on: January 23, 2012, 12:36:04 PM »

Can you post your Minimon INI file? We should check that you have the correct configuration for the flash memory regions.
Logged

Remember you have to log in if you want to see the file attachments!
Info or questions, please add to the wiki: http://www.nefariousmotorsports.com/wiki
Follow NefMoto developments on Twitter: http://twitter.com/nefmoto
kitnoos2002
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 8


« Reply #2 on: January 23, 2012, 01:22:58 PM »

Thank you for your help!

Here is my Minimon Default.ini file.

I left section register empty because I do too many tests and I do not know what to set in buscon, addrsel... I I remember I tried 800A for addrsel1.

I want to add for info :
RP0H=00C7 (5 "chip select" activated) ...But I think only 3 CS signals are used.
CS0 on OE
CS1 on WE
and CS3 connected on 74HCT574D Clock Input (Pin 11)

Logged
Tony@NefMoto
Administrator
Hero Member
*****

Karma: +132/-4
Offline Offline

Posts: 1389


2001.5 Audi S4 Stage 3


« Reply #3 on: January 23, 2012, 02:06:18 PM »

I think you need to specify some more settings and change the start address for your external flash memory region. Your flash definition section doesn't specify which driver features are supported, and your memory addresses start at zero, when they should start at a multiple of 0x100000.

Here are my settings for the 29F800:
Code:
NAME=ExternalFlash
TYPE=FLASH
BLANK=0xFF
BURSTSIZE=0x0001

NAME=ExternalFlash
TYPE=FLASH
BLANK=0xFF
BURSTSIZE=0x0040
SECTION(0).STARTADDRESS(0)=0x800000
SECTION(0).LENGTH(0)=0x004000
SECTION(1).STARTADDRESS(0)=0x804000
SECTION(1).LENGTH(0)=0x002000
SECTION(2).STARTADDRESS(0)=0x806000
SECTION(2).LENGTH(0)=0x002000
SECTION(3).STARTADDRESS(0)=0x808000
SECTION(3).LENGTH(0)=0x008000
SECTION(4).STARTADDRESS(0)=0x810000
SECTION(4).LENGTH(0)=0x010000
SECTION(5).STARTADDRESS(0)=0x820000
SECTION(5).LENGTH(0)=0x010000
SECTION(6).STARTADDRESS(0)=0x830000
SECTION(6).LENGTH(0)=0x010000
SECTION(7).STARTADDRESS(0)=0x840000
SECTION(7).LENGTH(0)=0x010000
SECTION(8).STARTADDRESS(0)=0x850000
SECTION(8).LENGTH(0)=0x010000
SECTION(9).STARTADDRESS(0)=0x860000
SECTION(9).LENGTH(0)=0x010000
SECTION(10).STARTADDRESS(0)=0x870000
SECTION(10).LENGTH(0)=0x010000
SECTION(11).STARTADDRESS(0)=0x880000
SECTION(11).LENGTH(0)=0x010000
SECTION(12).STARTADDRESS(0)=0x890000
SECTION(12).LENGTH(0)=0x010000
SECTION(13).STARTADDRESS(0)=0x8A0000
SECTION(13).LENGTH(0)=0x010000
SECTION(14).STARTADDRESS(0)=0x8B0000
SECTION(14).LENGTH(0)=0x010000
SECTION(15).STARTADDRESS(0)=0x8C0000
SECTION(15).LENGTH(0)=0x010000
SECTION(16).STARTADDRESS(0)=0x8D0000
SECTION(16).LENGTH(0)=0x010000
SECTION(17).STARTADDRESS(0)=0x8E0000
SECTION(17).LENGTH(0)=0x010000
SECTION(18).STARTADDRESS(0)=0x8F0000
SECTION(18).LENGTH(0)=0x010000
DRIVER.PATH="C:\Program Files\MiniMon\Driver\A29F800b\A29F800b.hex"
DRIVER.BUFFERADDRESS=00FC80
DRIVER.MODE=0
DRIVER.FEATURES=ERASE,PROGRAM,STATUS
Logged

Remember you have to log in if you want to see the file attachments!
Info or questions, please add to the wiki: http://www.nefariousmotorsports.com/wiki
Follow NefMoto developments on Twitter: http://twitter.com/nefmoto
kitnoos2002
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 8


« Reply #4 on: January 23, 2012, 03:45:52 PM »

Thank you!

But I have the same problem :
*Erase: loading driver
*Erase: loading driver C:\PROGRAM FILES\MINIMON\DRIVER\A29F400B\A29F400B.HEX
*ERROR: download not successful

I corrected driver features section.
I tried all multiples of 0x100000 until 0x900000
But same problem.

I can see in the P6 register, the chip select is CS0
but it should be CS1 for write command.
CS0 is connected for read command
Logged
kitnoos2002
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 8


« Reply #5 on: January 23, 2012, 07:17:44 PM »

When I set syscon, buscon0 , buscon1, addrsel1, I have a different error message.
Minimon send succesful the driver, but he can't erase :

*Erase: loading driver
*Erase: loading driver C:\PROGRAM FILES\MINIMON\DRIVER\A29F400B\A29F400B.HEX
*Download:  456 bytes
*ERROR: Erase not successful
Logged
kitnoos2002
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 8


« Reply #6 on: January 24, 2012, 09:28:10 AM »

Hello Tony@NefMoto!

What is your settings in your working Defaut.ini Register section?
I can be very useful for me!

Mainly theses :
SYSCON=?
BUSCON0=?
BUSCON1=?
ADDRSEL1=?

Thank you very much!
Logged
Tony@NefMoto
Administrator
Hero Member
*****

Karma: +132/-4
Offline Offline

Posts: 1389


2001.5 Audi S4 Stage 3


« Reply #7 on: January 24, 2012, 11:57:21 AM »

Here is the register definition I have:
Code:
[Register]

SYSCON=0xE604
BUSCON0=0x04AD
BUSCON1=0x040D
ADDRSEL1=0x3803
BUSCON2=0x04AD
ADDRSEL2=0x1007
BUSCON3=0x0000
ADDRSEL3=0x0000
BUSCON4=0x0000
ADDRSEL4=0x0000
Logged

Remember you have to log in if you want to see the file attachments!
Info or questions, please add to the wiki: http://www.nefariousmotorsports.com/wiki
Follow NefMoto developments on Twitter: http://twitter.com/nefmoto
rkam
Full Member
***

Karma: +4/-0
Offline Offline

Posts: 55


« Reply #8 on: January 26, 2012, 11:44:10 PM »

Are the crossed data and address lines handled by the register settings?
Logged
kitnoos2002
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 8


« Reply #9 on: January 27, 2012, 08:21:29 AM »

Thank you Tony!
Your settings don't work for me.

I have disassembled the firmware and I tried with originals setting from the ecu, but he doesn't work.

Maybe the driver A29F400B.hex don't work with my spécial case.
CS0 is connected to pin OE and CS1 is connected to pin WE, so read and write aren't at the same address.

@Rkam : File readed is ok. I think we do not care for the data line if read trought C167.
But data are scrambled if I read directly the flash. But it isn't a problem for me.
Logged
rkam
Full Member
***

Karma: +4/-0
Offline Offline

Posts: 55


« Reply #10 on: January 27, 2012, 11:26:02 AM »

How about erase and write commands sent to the flash chip?
Logged
Tony@NefMoto
Administrator
Hero Member
*****

Karma: +132/-4
Offline Offline

Posts: 1389


2001.5 Audi S4 Stage 3


« Reply #11 on: January 27, 2012, 11:56:32 AM »

Thank you Tony!
Your settings don't work for me.

I have disassembled the firmware and I tried with originals setting from the ecu, but he doesn't work.

Maybe the driver A29F400B.hex don't work with my spécial case.
CS0 is connected to pin OE and CS1 is connected to pin WE, so read and write aren't at the same address.

@Rkam : File readed is ok. I think we do not care for the data line if read trought C167.
But data are scrambled if I read directly the flash. But it isn't a problem for me.

Do you get different results if you try to erase a sector or erase the entire flash chip? Make sure you are only trying to erase whole sectors, and not parts of sectors.
Logged

Remember you have to log in if you want to see the file attachments!
Info or questions, please add to the wiki: http://www.nefariousmotorsports.com/wiki
Follow NefMoto developments on Twitter: http://twitter.com/nefmoto
kitnoos2002
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 8


« Reply #12 on: January 27, 2012, 12:46:18 PM »



         8Bit                       16Bit
SA0 00000h–03FFFh    00000h–01FFFh
SA1 04000h–05FFFh    02000h–02FFFh
SA2 06000h–07FFFh    03000h–03FFFh
SA3 08000h–0FFFFh    04000h–07FFFh
SA4 10000h–1FFFFh    08000h–0FFFFh
SA5 20000h–2FFFFh    10000h–17FFFh
SA6 30000h–3FFFFh    18000h–1FFFFh
SA7 40000h–4FFFFh    20000h–27FFFh
SA8 50000h–5FFFFh    28000h–2FFFFh
SA9 60000h–6FFFFh    30000h–37FFFh
SA10 70000h–7FFFFh    38000h–3FFFFh

In source code, we can see Minimon driver is build with 8Bit sectors.
Maybe I must rebuild a new driver with 16Bit sectors.

I tried with 8Bit and 16Bit in .ini file, but no in Driver.

And maybe Rkam is right!
I thought Write Command was just sending data to address, but Before sending data, there is 3 cycles.
First cycle must send data AA to address 555
Second cycle must send 55 to address 2AA
and last cycle must send A0 to address 555
And after we can send our data.

PS : In driver there is just the 3rd cycle, and it send A0 to 5555? Maybe an error?
Logged
gremlin
Hero Member
*****

Karma: +195/-9
Offline Offline

Posts: 650


« Reply #13 on: January 27, 2012, 05:15:22 PM »

Maybe the driver A29F400B.hex don't work with my spécial case.

Yes. For Simos ECUs you must write new driver.
Standard driver taken from minimon driver directory can read flash and can't perform correct erase/write operations on Simos hardware.
Logged
kitnoos2002
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 8


« Reply #14 on: January 27, 2012, 06:05:32 PM »

Ok Gremlin!
Thank you for informations!

But I'm not good enough to write a new driver in assembler.
Otherwise, if you know where I can found a approaching driver, I can maybe modify it for working with my ECU. (It is not a Simos but Simk43 / 5wy)






Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Page created in 0.022 seconds with 17 queries. (Pretty URLs adds 0s, 0q)