Giter Club home page Giter Club logo

dflash_to_eeprom's Introduction

dflash_to_eeprom Build Status

Tool to fix corrupt MC9S12XEQ384 eeprom.

Background

The "FRM3" and other Electronic Control Units contain the MC9S12XEQ384 microprocessor with integrated Flash. When the integrated Flash is used in eeprom emulation mode, like in the case of the FRM3, the settings can get corrupted making the ECU unable to access the eeprom again. The ECU can be repaired by programming the correct data in the (simulated) eeprom.

Usage

This tool allows the corrupt data in the microprocessor to be read, even after the eeprom got corrupted. This is done by reading the d-flash contents from the microcontroller using an appropriate programmer (like xprog), after which this program can convert it to an eeprom image which can then be programmed to the simulated eeprom area again using the same programmer.

Internals

This tool runs under the following assumptions: The Flash is used as a circular buffer, where each flash block can contain zero to 63 "eeprom commands", which "update" the data in the simulated eeprom. It is assumed that an eeprom word starts as 0xFF, and can be written by adding a command to the flash. It can be overwritten by adding another command to the flash (The flash cannot be erased at word-level, and the block can still contain valid commands for a different address, so it has to keep the old command). Thus, the order of commands matter. It is assumed that a block that has its header set to FFFFFFFE is prepared to become the next block to be written to. It is also assumed that a block that is not completely filled with commands is the current block, which shall be located just before the prepared block. If none of these conditions are found, it just searches for the longest chain of empty blocks (header starts with 0xFFFF and not 0xFACF), and assumes that these are the prepared blocks.

Magic

This is all just based on looking to D-flash dumps, so there might be more magic. However, so far in all cases where this tool did not detect any errors, the resulting image worked fine. When the D-Flash image is corrupt, this script will tell you so.

Note: This tool does not clear any error codes, short circuit counters, mileage or checksums. Therefore, in all cases you should clear the fault memory after the FRM3 is installed and in some cases it is wise to reset the short circuit counters.

dflash_to_eeprom's People

Contributors

tomvleeuwen avatar

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.