How to get the machine code file from a target board with an un-protected or un-secured Flash MCU?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to get the machine code file from a target board with an un-protected or un-secured Flash MCU?

ソリューションへジャンプ
1,963件の閲覧回数
kunxu
Contributor II

Hello, I have a target board with a MC9S12XEP100 chip. The flash of the MCU chip is un-protected and un-secured. I want to get the machine code file or assembly file (*.abs, or *.s19). What should I do?

PS: I have succesfully connected the target board using the BDM (P&E USB Multilink Inerface) via the software - hiwave.exe, and see the contents of the Flash memory, as well as the Assemble codes  in the Windows of "Memory" and "Assemble" of the hiwave.exe software, respectively. But I don't know how to save them as a *.abs file or a *.s19 file.  The copy command cannot be used in the Windows "Memory" or "Assemble" of the hiwave.exe software

ラベル(1)
1 解決策
1,485件の閲覧回数
iggi
NXP Employee
NXP Employee

The code programmed into memory of a chip is an optimized binary code but not originally written assembly. The chip never records your original assembly code. So it is not possible to get your original assembly code from chip. 

We can use the SAVE command to save a specified block of memory to a specified file in Freescale S-record format. Then we can reload the memory block later using the load S-record (SREC) command. The SAVE command is used in debugger command window.

E.g. 
in>SAVE 0x1000..0x2000 DUMP.S19 ;A


This way we can read binary opcode from flash to .s19 file. It appends the memory range 0x1000..0x2000 to the DUMP.S19 file.

We can use decoder.exe tool to decode .s19 and see the code in assembly-pseudo, but it is not real assembly format. This attribute depends on .s19 and .lib itself but not decode tool

元の投稿で解決策を見る

2 返答(返信)
1,486件の閲覧回数
iggi
NXP Employee
NXP Employee

The code programmed into memory of a chip is an optimized binary code but not originally written assembly. The chip never records your original assembly code. So it is not possible to get your original assembly code from chip. 

We can use the SAVE command to save a specified block of memory to a specified file in Freescale S-record format. Then we can reload the memory block later using the load S-record (SREC) command. The SAVE command is used in debugger command window.

E.g. 
in>SAVE 0x1000..0x2000 DUMP.S19 ;A


This way we can read binary opcode from flash to .s19 file. It appends the memory range 0x1000..0x2000 to the DUMP.S19 file.

We can use decoder.exe tool to decode .s19 and see the code in assembly-pseudo, but it is not real assembly format. This attribute depends on .s19 and .lib itself but not decode tool

1,485件の閲覧回数
kunxu
Contributor II

Thank you for the nice reply. I can have a good sleep tonight. Thank you

0 件の賞賛
返信