Notices
ECU Flash

DMA source code - techie thread - for interest only

Thread Tools
 
Search this Thread
 
Old Feb 23, 2008 | 03:04 PM
  #1  
jcsbanks's Avatar
Thread Starter
Evolved Member
 
Joined: May 2006
Posts: 2,399
Likes: 6
From: UK
DMA source code - techie thread - for interest only

I will make better info threads later, but here I attach the two main SH2 asm files that I've been working on and commenting to make them as universal as possbile.

The first file is hooked into the MUT processing routine, it grabs requests E0,E1,E2 and setups up a 6 byte DMA transfer that has a 4 byte address and 2 byte length.

The second file uses DMA end and transmit end interrupts to setup a further DMA transfer to/from the 4 byte address of the 2 byte length. It uses flags to clean up afterwards.

A third file I've not put here yet runs off the main ECU loop to kill DMA and reset our flags if the comms timeout.

Example:

E0 ... wait 10ms .... 00035920 0040 will then have the ECU dump 64 (40) bytes from the addresses pointed to by 35920, 35924, 35928 etc (DMA logging)

E1 ... wait 10ms .... FFFF8500 00FF will then have the ECU dump 255 (FF) bytes from FFFF8500 in ECU RAM.

E2 ... wait 10ms .... FFFF8500 00FF followed by 255 (FF) bytes will get the ECU to write these bytes at FFFF8500 in ECU RAM.
Attached Files
File Type: txt
newfulldma1.txt (2.4 KB, 14 views)
File Type: txt
newfulldma2.txt (4.4 KB, 7 views)
Reply
Old Feb 24, 2008 | 04:51 AM
  #2  
burgers22's Avatar
Evolved Member
 
Joined: Jan 2006
Posts: 953
Likes: 2
From: Oxfordshire
For the partially techie, where is this routine inserted into the existing code? Which routine is used to point to your new code?

MB
Reply
Old Feb 24, 2008 | 10:08 AM
  #3  
jcsbanks's Avatar
Thread Starter
Evolved Member
 
Joined: May 2006
Posts: 2,399
Likes: 6
From: UK
At the end of the first file there is a hook that is inserted into the MUT processing code. After it tests to see if the request ID is >0xBF, it goes through a series of further comparisons. I hook into the one that tests for E8.

The second file needs pointers for DMA end and transmit end interrupts to point to it.
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
roger smith
ECU Flash
57
Oct 29, 2018 03:23 AM
Jack_of_Trades
ECU Flash
363
May 29, 2018 07:05 AM
jcsbanks
ECU Flash
91
Jun 9, 2011 11:45 AM
silver_evo
ECU Flash
34
Jun 25, 2010 11:31 AM
Seijuro
ECU Flash
4
Mar 20, 2010 11:53 AM




All times are GMT -7. The time now is 04:23 AM.