Notices
ECU Flash

MUT/RAM logging

Thread Tools
 
Search this Thread
 
Old Sep 14, 2021 | 02:37 AM
  #16  
Dow Jhob's Avatar
Newbie
 
Joined: Jun 2016
Posts: 93
Likes: 7
From: siberia
_0x87mode_read:packetCount
this is the number of packets with a length of 44 that must be read, if you make it equal to zero then the maximum size of 79 messages will be read

read worked --> branch stockDMAdev
_0x87mode_write, where is the payload?

Last edited by Dow Jhob; Sep 14, 2021 at 04:23 AM.
Reply
Old Sep 14, 2021 | 04:29 AM
  #17  
orion4096's Avatar
Thread Starter
Newbie
iTrader: (1)
 
Joined: Dec 2014
Posts: 83
Likes: 27
From: -
<duplicate post>

Last edited by orion4096; Sep 14, 2021 at 04:41 AM.
Reply
Old Sep 14, 2021 | 04:32 AM
  #18  
orion4096's Avatar
Thread Starter
Newbie
iTrader: (1)
 
Joined: Dec 2014
Posts: 83
Likes: 27
From: -
Code:
packetCnt respPacketCnt
0x00 0x100 (256)
0x01 0x001 (1)
...
0xFF 0x0FF (255)

If you send a write:
packetCnt = 0x00
direction = 0x05
addr4B = 0x0001C000

The ECU responds with 0x100 (256) packets covering 0x0001C000-0x0001EBFF.

I updated the asm to change the response packet for read (0x05): 05<currentByteCnt1B>05 ... 0D
The original read (0x01) still responds with a single response: 050001 ... 0D

For a write request the payload is in the request packet:


Code:
struct _0x87mode_write
{
    byte modeId = 0x87;
    byte byteCount = 0x00-0x2C; // represents bytes to write from starting address <addr>
    (byte)direction directionId = 0x04;
    WORD addr; // prepended with 0xFFFF in ECU to avoid increasing addr size in packet
    byte data[0x2C]; // payload
    byte checkSumm;
    byte endOfStruct = 0x0D;
}
Reply
Old Sep 14, 2021 | 05:00 AM
  #19  
Dow Jhob's Avatar
Newbie
 
Joined: Jun 2016
Posts: 93
Likes: 7
From: siberia
no, ecu replies with one message in which all 0x51 packets are added

there is a nuance, I modified 90550001 rom (there is all the code with an offset of 0x1000), but this is hardly the reason, well, reading it takes me a couple of three seconds for all maps
Attached Files
File Type: bin
90550001-live-byNanner.bin (256.0 KB, 0 views)

Last edited by Dow Jhob; Sep 14, 2021 at 08:13 AM. Reason: change binary
Reply
Old Sep 14, 2021 | 08:13 AM
  #20  
Dow Jhob's Avatar
Newbie
 
Joined: Jun 2016
Posts: 93
Likes: 7
From: siberia
write dont worked
Reply
Old Sep 14, 2021 | 01:08 PM
  #21  
orion4096's Avatar
Thread Starter
Newbie
iTrader: (1)
 
Joined: Dec 2014
Posts: 83
Likes: 27
From: -
There is only one start of message set at the beginning of a read. Many packets get coalesced into a single message by the OP2. The built-in DMA logging works the same way.

I fixed a bug with writes in the asm where it would send multiple acks. A test write and read to 0xFFFF9C00 works for me.


Code:
       ToECU    fromECU   fromECU
writes WriteMsg ReadMsgs* ReadMsgs&
read   WriteMsg ReadMsgs* ReadMsgs+

* = Start of Message
& = One acknowledgement packet. 058000 ... (rest looks like request)
+ = One or more packets grouped into a single message.

I didn't add the acknowledgement packet for writes. That's how the existing code works.

Last edited by orion4096; Sep 14, 2021 at 04:32 PM.
Reply
Old Sep 14, 2021 | 11:41 PM
  #22  
Dow Jhob's Avatar
Newbie
 
Joined: Jun 2016
Posts: 93
Likes: 7
From: siberia
Well, yes, I didn’t notice the responsiveness.
now the recording is working
my client is now fully functional according to your way of reading the record

a little boring:
you do not correctly imagine reading and writing by means of op20, you do not need it continuously poll, op20 does it for you.
For example:
The ECU sends a packet of bytes, op20 receives it and writes it to the internal memory, when you call PassThruReadMsgs you read this packet from the memory of op20 into the memory of your application, and in op20 this data block will be considered destroyed for simplicity.
Further:
Let's say the ECU sends several packets and 20 bytes one by one, for op20 it will be one message and will be buffered one by one and when PassThruReadMsgs is called it will be read as one message.
Now the sweetest thing: PassThruReadMsgs receives a pointer to memory in your application into which it will copy data from op20, moreover, the structure of this buffer is an ARRAY OF STRUCTURES PASSTHRU_MSG.

PASSTHRU_MSG date [desired number of messages that can be read at a time]


Therefore, if ECU sends you many packets and does not pause P3_MIN between them, you will read them all at once in one message.
That's it, you don't need a timer.
Reply
Old Sep 15, 2021 | 12:19 AM
  #23  
Dow Jhob's Avatar
Newbie
 
Joined: Jun 2016
Posts: 93
Likes: 7
From: siberia
response on write packet is over 900ms..
you fix it, but it would not be bad to remove this packet altogether, or at least shorten it
it still takes about 90ms to read at 62,500

Last edited by Dow Jhob; Sep 15, 2021 at 07:34 AM.
Reply
Old Sep 15, 2021 | 10:42 AM
  #24  
Dow Jhob's Avatar
Newbie
 
Joined: Jun 2016
Posts: 93
Likes: 7
From: siberia
you can check 80700010? On 0x8214 many diff with 88590015 and 90550001 (88590015 is the same as 90550001)
Reply
Old Sep 15, 2021 | 08:55 PM
  #25  
orion4096's Avatar
Thread Starter
Newbie
iTrader: (1)
 
Joined: Dec 2014
Posts: 83
Likes: 27
From: -
I tried to remove the ACK for writes but a second write doesn't work. Will look into it when I have more time.

Is 80700010 an automatic? Looks like the same function in 88590015:0x9026 is 80700010:0x805C. There are different stack locations, state bits used, and the compiler moved other things around. The changes will have to be ported by someone who can test it.
Reply
Old Sep 15, 2021 | 09:56 PM
  #26  
Dow Jhob's Avatar
Newbie
 
Joined: Jun 2016
Posts: 93
Likes: 7
From: siberia
Originally Posted by orion4096
The changes will have to be ported by someone who can test it.
i can test it, 80700010 very popular rom, I'm not very good at revers rom

I tried to remove the ACK for writes but a second write doesn't work. Will look into it when I have more time.
​​​​​​​
it's just an important point, proofreading this answer takes a significant amount of time (90ms) and makes it difficult for group editing of rom
Reply
Old Sep 15, 2021 | 09:58 PM
  #27  
Dow Jhob's Avatar
Newbie
 
Joined: Jun 2016
Posts: 93
Likes: 7
From: siberia
Originally Posted by orion4096
I tried to remove the ACK for writes but a second write doesn't work. Will look into it when I have more time.

Is 80700010 an automatic? Looks like the same function in 88590015:0x9026 is 80700010:0x805C. There are different stack locations, state bits used, and the compiler moved other things around. The changes will have to be ported by someone who can test it.
many more branches than 90550001 or 88590015
Reply
Old Sep 17, 2021 | 02:10 AM
  #28  
Dow Jhob's Avatar
Newbie
 
Joined: Jun 2016
Posts: 93
Likes: 7
From: siberia
for each request of the form 0x8x, there is a response 0x0x,
and in the case of subfunctions, the answer should be of the form
0x0x 0x0y where x is the function number and y is the subfunction number
(in the case of direct read / write) in this case responses can be easily parsed and sent
to the appropriate handlers
Reply
Old Sep 18, 2021 | 05:37 PM
  #29  
orion4096's Avatar
Thread Starter
Newbie
iTrader: (1)
 
Joined: Dec 2014
Posts: 83
Likes: 27
From: -
The CAS interrrupt gets called every 1.25ms. The main loop has a delay which only allows it to execute at most every 10ms (8x CAS interrupts). The command decoder, handler for 100 hz logging, and reads/writes are in the main loop. And it looks like there is also a minimum required 20ms delay between the end of one command and the start of the next. Normally this protected by the client waiting for the response, but since the response is removed I can see there being 20ms + (2 to 3 mainloop iterations to decodeCmd/performWrite, cleanup) * 10ms = ~50ms of necessary delay. As long as the read and write is handled in the mainloop a single command won't get much faster. It may be possible to add a EOW (End of Write) bit in the write packet so the state machine stays live but data would need to be double buffered and it gets complicated. You would still need to add pauses to slow it down to every 10-20ms. There are other solutions:

(1) Add new read/write commands that setup DMAC so raw data can be transferred to/from an address after the initial command is sent. The write will generate a response and only after receiving the response the client can start sending data.

This should get close to the full 62500 data rate for large data (minus serial overheads). Small reads/writes will still be slow since 1 command can only be done every ~90-100 ms. But when sending lots of data in one command it will be at a high rate.

(2) Custom decoder in the serial data ready interrupt which sets up DMAC for these new read/write commands.

This should have low latency and high data rate. Not sure if it can even be made to work, though. Something has to keep the mainloop DMA state machine from triggering. The way this works for OBD/MUT transfers is the 5baud init causes it to get disabled. When the ECU boots up it sets up the receive buffer DMA for 0x33 bytes which is why commands can be sent @ 62500 baud with no setup work. Would require changes to not setup the DMA right away. This seems too complicated.

(3) DMAC complete interrupt to decode new commands and setup DMAC for data or hand off other commands to existing main loop state machine.

Right now the main loop polls on idle DMA transfer counts. The interrupt is not used. This would also have low latency and high rate like (2). This seems like the best approach since the DMAC completion interrupt can immediately manage the RCV/SND fifos and state before the serial interrupt or mainloop do their work.

I'll have to think about it more as there are problems with all 3 approaches. Not sure if or when something can be coded and tested. It's not a simple thing to change.
Reply
Old Sep 18, 2021 | 10:39 PM
  #30  
Dow Jhob's Avatar
Newbie
 
Joined: Jun 2016
Posts: 93
Likes: 7
From: siberia
Originally Posted by orion4096
(1) Add new read/write commands that setup DMAC so raw data can be transferred to/from an address after the initial command is sent.
This is how it works livemap jcsbanks https://www.evolutionm.net/forums/ec...ap-source.html

Originally Posted by orion4096
Right now the main loop polls on idle DMA transfer counts.
word_FFFF7D14 -FFFF7D20 ?

Last edited by Dow Jhob; Sep 19, 2021 at 12:46 AM.
Reply



All times are GMT -7. The time now is 07:26 AM.