Menu

MM9Z1-638

2023-09-08
2026-02-09
  • Nedal Aljaber

    Nedal Aljaber - 2023-09-08

    I Need to read and write flash and data to MM9Z1-638 by USBDMLT
    what is the source code

     
    • Dennis Heynlein

      Dennis Heynlein - 2025-01-20

      Did you get it to work?

       
      • Nedal Aljaber

        Nedal Aljaber - 2025-01-20

        Hi DennisUnfortunately it still unsolved .Do you have any solution
        Nedal

        Yahoo Mail: Search, organise, conquer

        On Mon, 20 Jan 2025 at 12:49 pm, Dennis Heynleincl2k@users.sourceforge.net wrote:
        Did you get it to work?

        MM9Z1-638

        Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/usbdm/discussion/1237993/

        To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

         
        • Dennis Heynlein

          Dennis Heynlein - 2025-01-24

          Read/Write Flash works.
          add this to
          C:\Program Files\pgo\USBDM 4.12.1.340\DeviceData\s12z_devices.xml

          <device family="S12Z" name="MM9Z1J638">
          <clock type="External">
          <memoryref ref="s12z8K_Ram">
          <memoryref ref="FTMRZ_EEPROM_4K_4bS">
          <memoryref ref="FTMRZ_PFlash0_SEC_128K_512bS">
          <copctladdress value="0x06CC">
          <sdidaddress value="0x0000">
          <sdidmask value="0xFFFFFF00">
          <sdid value="0x02070207">
          <flashscripts>
          <tclscriptref ref="S12Z-FTMRZ-flash-scripts">
          </tclscriptref></flashscripts>
          <flashprogramref ref="S12Z-FTMRZ-flash-program">
          </flashprogramref></sdid></sdidmask></sdidaddress></copctladdress></memoryref></memoryref></memoryref></clock></device>

          If you have a MM9Z1I638 please share the sdid :)

          (Detect Chip and the sdid is in the round brackets as hex)

           
          • Igor Maliszewski

            my is the same

             
            • Dennis Heynlein

              Dennis Heynlein - 2026-02-08

              The flash loader does not appear to support EEPROM write operations.

              Here a Sample with
              USBDM TCL Interpreter

              Everything EEPROM Sector has a size of 32 Bit

              settarget s12z
              openbdm
              setdevice MM9Z1J638
              reset NH
              connect
              halt
              
              ;#every EEPROM Word has its own ECC
              ;#erasing is only as double word possible
              
              ;#Erase 1 Sector (2 Words)
              rb 0x386 ;#FSTAT if CCIF == 0 Command is running
              wb 0x386 0x30 ;#FSTAT clear ACCERR & FPVIOL flag in flash status register
              wb 0x382 1 ;#FCCOBIX 2 COBs used
              wl 0x38C 0x12100000 ;#FCCOB0+B1  0x12<<24 | 0x100000 COMMAND Erase Sector 0x12 and Address 0x100000
              wb 0x386 0x80 ;#FSTAT clear CCIF bit - Start Write
              
              ;#Verify Sectors
              rb 0x386 ;#FSTAT if CCIF == 0 Command is running
              wb 0x386 0x30 ;#FSTAT clear ACCERR & FPVIOL flag in flash status register
              wb 0x382 2 ;#FCCOBIX 3 COBs used
              wl 0x38C 0x10100000 ;#FCCOB0+B1  0x10<<24 | 0x100000 COMMAND Verify Sector 0x10 and Address 0x100000
              ww 0x390 2 ;#FCCOB2 2 Words
              wb 0x386 0x80 ;#FSTAT clear CCIF bit - Start Write
              
              ;#Write 1 Word
              rb 0x386 ;#FSTAT if CCIF == 0 Command is running
              wb 0x386 0x30 ;#FSTAT clear ACCERR & FPVIOL flag in flash status register
              wb 0x382 2 ;#FCCOBIX 3 COBs used
              wl 0x38C 0x11100000 ;#FCCOB0+B1  0x11<<24 | 0x100000 COMMAND Program EEPROM-Word(s) 0x11 and Address 0x100000
              ww 0x390 0x11 ;#FCCOB2 Word 0x11
              wb 0x386 0x80 ;#FSTAT clear CCIF bit - Start Write
              
              ;#Write 2 Words
              rb 0x386 ;#FSTAT if CCIF == 0 Command is running
              wb 0x386 0x30 ;#FSTAT clear ACCERR & FPVIOL flag in flash status register
              wb 0x382 3 ;#FCCOBIX 4 COBs used
              wl 0x38C 0x11100000 ;#FCCOB0+B1  0x11<<24 | 0x100000 COMMAND Program EEPROM-Word(s) 0x11 and Address 0x100000
              ww 0x390 0x11 ;#FCCOB2 Word 0x11
              ww 0x392 0x12 ;#FCCOB3 Word 0x12
              wb 0x386 0x80 ;#FSTAT clear CCIF bit - Start Write
              
              ;#Write 3 Words
              rb 0x386 ;#FSTAT if CCIF == 0 Command is running
              wb 0x386 0x30 ;#FSTAT clear ACCERR & FPVIOL flag in flash status register
              wb 0x382 4 ;#FCCOBIX 5 COBs used
              wl 0x38C 0x11100000 ;#FCCOB0+B1  0x11<<24 | 0x100000 COMMAND Program EEPROM-Word(s) 0x11 and Address 0x100000
              ww 0x390 0x11 ;#FCCOB2 Word 0x11
              ww 0x392 0x12 ;#FCCOB3 Word 0x12
              ww 0x394 0x13 ;#FCCOB4 Word 0x13
              wb 0x386 0x80 ;#FSTAT clear CCIF bit - Start Write
              
              ;#Write 4 Words
              rb 0x386 ;#FSTAT if CCIF == 0 Command is running
              wb 0x386 0x30 ;#FSTAT clear ACCERR & FPVIOL flag in flash status register
              wb 0x382 5 ;#FCCOBIX 6 COBs used
              wl 0x38C 0x11100000 ;#FCCOB0+B1  0x11<<24 | 0x100000 COMMAND Program EEPROM-Word(s) 0x11 and Address 0x100000
              ww 0x390 0x1112 ;#FCCOB2 Word 0x11
              ww 0x392 0x1314 ;#FCCOB3 Word 0x12
              ww 0x394 0x1516 ;#FCCOB4 Word 0x13
              ww 0x396 0x1718 ;#FCCOB5 Word 0x14
              wb 0x386 0x80 ;#FSTAT clear CCIF bit - Start Write
              
              rl 0x100000
              rl 0x100004
              
               
              ❤️
              1

              Last edit: Dennis Heynlein 2026-02-08
              • Igor Maliszewski

                First - You are my hero :) it's working :)
                Secondly, for others: the correct template
                (Unfortunately, the engine of this website breaks the code when you upload it as text, you have to upload it as an image, Dennis's template was correct before being uploaded as text)

                 

                Last edit: Igor Maliszewski 2026-02-09
        • Dennis Heynlein

          Dennis Heynlein - 2025-03-09

          modification of s12z_devices.xml is sufficient
          I have also placed a 470nF between GND and Reset.

           
      • Dennis Heynlein

        Dennis Heynlein - 2025-01-25

        The flashloader is not optimal, but it works at first glance.
        I am currently trying to adapt the template to the S12Z of MM9Z1J638.

         
  • Peter O'Donoghue

    Look at the link on the main page USBDM Web Site

     

Log in to post a comment.

MongoDB Logo MongoDB