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,985 次查看
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,507 次查看
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,508 次查看
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,507 次查看
kunxu
Contributor II

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

0 项奖励
回复