Giter Club home page Giter Club logo

Comments (11)

travisgoodspeed avatar travisgoodspeed commented on August 19, 2024

Yup, this should be added. Luckily, it's a nice short transaction that'll stand out in a pcap.

from md380tools.

aeickho avatar aeickho commented on August 19, 2024

pcap file of
write time: https://flauschfunk.de/write_date_time.pcapng
read time: https://flauschfunk.de/read_date_time.pcapng

from md380tools.

aeickho avatar aeickho commented on August 19, 2024

on read time: https://flauschfunk.de/read_date_time.pcapng
the date/time is in frame 245

from md380tools.

travisgoodspeed avatar travisgoodspeed commented on August 19, 2024

Thanks! Sticking to read_date_time.pcapng for this comment.

Yup, that's the date in 7-bytes of BCD returned in packet 245.
screen shot 2016-02-20 at 7 31 09 pm

Packet 244 is a normal UPLOAD request, for 7 bytes from block 2. (DFU reads and writes index from 2 within a memory. 0 is used for control and 1 for our non-standard patches.)

Working backward, we ignore 241/242 as a STATUS pair.

228 and 229, however, are more promising. They are a DFU secret command pair of 0xA2 0x08, and I'm pretty sure from reading the firmware that the A2 commands all select a memory target.

Sure enough, this little example will dump the current time from the device.

                import usb.core
                dfu = init_dfu()
                dfu.md380_custom(0x91,0x01); #Programming Mode                                                                                                                                                             
                dfu.md380_custom(0xA2,0x08); #Access the clock memory.                                                                                                                                                     
                time=dfu.upload(0,7);  #Read the time bytes as BCD.                                                                                                                                                        
                hexdump(time);
iMac% md380-dfu time
20160220 194440
iMac% 

Writing in this same way is probably enough to set the clock. I'll toss together a test now and merge it if it works.

from md380tools.

travisgoodspeed avatar travisgoodspeed commented on August 19, 2024

In the write PCAP, working backward from the end,

Packet 248 performs the reboot by calling 0x91,0x05 as a secret command.

Packet 231 performs a write of eight bytes beginning with B5 and followed by the 7-byte BCD date. Trying that.

Packet 213 send 0x91,0x02.

Packet 179 sends the 0xA2, 0x07 sequence.

Packet 145 sends 0xA2, 0x04.

Packet 111 sends 0xA2, 0x03.

Packet 77 sends 0xA2, 0x02.

Packet 43 sends 0xA2, 0x01.

Packet 27 sends 0x91, 0x01, entering programming mode.

From the firmware, I recall that a lot of the A2 modes have to go in order. I'll try rigging up a client to do them in sequence early next week.

from md380tools.

travisgoodspeed avatar travisgoodspeed commented on August 19, 2024

I merged your pull request for the raw read of the time in md380-tool. What's the procedure for a raw write?

from md380tools.

aeickho avatar aeickho commented on August 19, 2024

i work on it

from md380tools.

aeickho avatar aeickho commented on August 19, 2024

usb_upld_handle() @ 0x0808d448 (2.032) there is the command "8" parser :)

from md380tools.

ea avatar ea commented on August 19, 2024

Should this be closed or is there anything else that needs to be done ?

from md380tools.

travisgoodspeed avatar travisgoodspeed commented on August 19, 2024

@ea I'll try it out now and close the issue if there's no trouble.

from md380tools.

travisgoodspeed avatar travisgoodspeed commented on August 19, 2024

The pull request broke md380-dfu time, but with a4a57d1, the regression is fixed.

Happily closing one of our oldest issues.

from md380tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.