cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 disassembler

adaniel
Associate III
Posted on August 30, 2010 at 15:24

STM32 disassembler

#cortex-disassembler
15 REPLIES 15
picguy2
Associate II
Posted on May 17, 2011 at 14:04

You could always ask ST for the source.  The answer may be “no.�?  But I would start there.

Many Cortex-M3 development packages have a built-in disassembler.  At least with IAR’s (the free version at least) you don’t get to disassemble to a file.

While I am here let me ask a question.  Where can I find the information needed to write a Cortex-M3 disassembler?  I have several books and docs from ARM but no binary description of that instruction set.  The information has to exist else on one could write low-level tools like C compilers and assemblers.  Anybody?
domen23
Associate II
Posted on May 17, 2011 at 14:04

With gnu toolchain i got this far:

arm-none-eabi-objcopy -I binary -B arm -O elf32-littlearm foo.bin bar.elf

arm-none-eabi-objdump -xD bar.elf --disassembler-options=force-thumb --start-address=0xaddress

It annoys me that it just stops when it gets to something invalid (?).

picguy: armv7 architecture reference manual and possibly also cortex-m3 technical reference manual

adaniel
Associate III
Posted on May 17, 2011 at 14:04

1 - The answer was NO

2 - I use the Keil version of RealView which has a disassembler. All what I get is a disassembly of ny own C-files.

3 - The problem is: I have a binary file (or intel HEX file), how do I disassemble it?

Details about what I am trying to do: I wrote a command line program to download frimware through a serial port (RS232). My board has the necessary hardware to

hold the BOOT pins before RESET in order to enter the bootloader. The problem is

that my board has also an ON/OFF button, so that the board is switched OFF

after RESET. In order to download a new firmware I have to hold the ON/OFF

pushbutton depressed. I want to avoid this annoying situation by jumping directly

to an appropriate point into the bootlader, bypassing the ports setup.

Thanks for your answer, anyway.

daviddavid92
Associate II
Posted on May 17, 2011 at 14:04

The ARM ARM has instruction encodings

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0403c/index.html

Chris.

stforum2
Associate II
Posted on May 17, 2011 at 14:04

You can use the Crossware simulator to disassemble the bootloader, available from here:

http://www.crossware.com/trialware/21499113stm/index.htm

Image attached.

Posted on May 17, 2011 at 14:04

Different batches/versions of the STM32 have different boot loaders.

You can always call the boot loader from your own code using the standard entry point (SP/PC @  0x1FFFF000/0x1FFFF004)

The Keil tools are capable of downloading the ROM via JTAG into a HEX file, and certainly capable to debugging/disassembling code directly in the ROM. Just change the PC to point inside the ROM, or jump to the code, while in the debugger.

The instruction set is documented as the ARM THUMB2 ISA, which is a superset of the original THUMB ISA.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
adaniel
Associate III
Posted on May 17, 2011 at 14:04

Codery and Crossware: thanks for your answers, I have downloaded the stuff and I'll inform you of any progress.

Clive1: thanks for your answer, but it is of no use:

 1 - At the standard entry point, the bootloader sets the ports and switches my board OFF.

 2 - I already downloaded the bootloader binary through the bootloader itself and its instruction set.

 3 - The Keil disassembler doesn't see the bootloader because it is not part of my project.

Andrew Neil
Evangelist III
Posted on May 17, 2011 at 14:04

''3 - The Keil disassembler doesn't see the bootloader because it is not part of my project.''

I'm sure that's not true!

The Keil disassembler can see any arbitrary memory location!

http://www.keil.com/support/man/docs/uv4/uv4_cm_unassemble.htm

stforum2
Associate II
Posted on May 17, 2011 at 14:04

We have put together a brief tutorial ''Simulating through the Bootloader'' for guidance:

http://www.crossware.com/arm/tutorials/STM32/bootloader/index.htm