Menu

Id mismatch when programming MC9S12XDG128

2012-08-24
2012-12-03
  • Lorenzo Cappelletti

    I was trying to use HCS12_FlashProgrammer.exe in order to program a MC9S12XDG128.

    If I click on "Detect Chip", it says

    [No matching device]
    Filter by chip ID (C102 )
    

    If I on "XDG-MC9S12XDG128" and then click on "Program Flash", it says:

    Program Failed!
    Selected target device does not agree with detected device.
    (Unable to read/confirm CHIP_ID)
    

    All other options have a default value.

    If it is of any help, the MCUId under CodeWarrior 5.1 (Windows 7) is 0x2C9.

    Thanks

     
  • Lorenzo Cappelletti

    I added the following line to file 'hcs12_devices.xml' under MC9S12XDG128 device section and the chip is now recognized:

    <sdid value="0xC102" />
    

    Programming of an ELF file fails, though, with a 'Program data not within target Flash Memory'.  I checked the FLASH parameters and they seem OK to me.

     
  • Peter O'Donoghue

    The solution to the first error is to do as you have done and add the required SDID value. The present list is based on the data sheet and may be out of date or I simply missed a value.

    The second error indicates that the program file doesn't agree with the expected memory map. How was the file produced? It is possible that a different mapping is being used for paging numbers. The one used is based upon the Codewarrior map but others are possible.

    Finally - ELF files have only been tested with Kinetis & Coldfire.  It is quite possible that the paging isn't being handled properly for this format.

    If you can provide details of the expected  memory map, and the ELF file, I can have a look at it.  I don't have any tools that produce ELF files for HCS12 so have no real idea how the paged addresses are done.

    PS. You will get a quicker response if you post on the Freescale discussion forums. See the link in the documentation under Queries. bye

     
  • Lorenzo Cappelletti

    The second error indicates that the program file doesn't agree with the expected memory map. How was the file produced?

    I use chc12.exe (ANSI-C/cC++ Compiler for HC12 V-5.0.30 Build 6037, Feb  7 2006) from CodeWarrior v4.5.  I ran it via Makefile with option '-F2' for generating output files in ELF/DWARF 2.0 format.

    It is possible that a different mapping is being used for paging numbers.

    Not sure what you mean here.  The application I'm developing is small enough to fit within the ROM without requiring any paging feature.  Registers PPAGE, GPAGE, etc. all have their startup default values.

    If you can provide details of the expected memory map, and the ELF file, I can have a look at it.

    Memory map is the default one, the one you have at startup.

    I'll contact you via SourceForge personal page.  Once I've got your email, I'll send you the ELF file.

    PS. You will get a quicker response if you post on the Freescale discussion forums. See the link in the documentation under Queries. bye

    Do you mind if we go on here?  Just to keep the thread in the same place.

     
  • Peter O'Donoghue

    The problem is due to the ELF file using virtual addresses to indicate load address rather than the physical address as in the ELF file for other targets (ARM, CFVx).

    This has been fixed in the current version (just uploaded).

    bye

     

Log in to post a comment.