Loading ...
Sorry, an error occurred while loading the content.

5153new effort, was Re: [gnuarm] Re: Project Status

Expand Messages
  • schultdw
    Mar 25, 2012
    • 0 Attachment
      --- In gnuarm@yahoogroups.com, "redsp" <gnuarm.2006@...> wrote:

      > I think that many of the newer low end Cortex devices do not run ARM32 instructions, but only Thumb along with Thumb2 instructions. That was the intent of the Thumb2 instructions, to do away with the ARM32 instruction codings and provide the same functionality in a better binary coding.
      >
      > In the older devices which had both ARM32 and Thumb mode instructions there was a awkward switchover any time you had an interrupt because interrupts required a switch to ARM32 mode.
      >
      > Rick
      >

      I recently ran into a problem with a STM32F407 which is a Cortex M4 processor or thumb only. I had carefully set the -thumb option and the code compiled without trouble. But the code died. It took me quite a while to convince myself that it was the call to strncmp() that was the problem.

      When I looked at the code using objdump I found a blx instruction which has no valid thumb encodings. What was really weird is that the compiler was emitting a bl instruction.

      It turns out that the linker was changing the bl to a blx.

      The fix was to rebuild the library with the thumb option and without interwork. Which was odd because I was using a version of the compiler and library that I had just built using instructions that supposedly described how to build for the Cortex M4:

      http://cu.rious.org/make/compiling-the-arm-cortex-m4-toolchain-yourself/
    • Show all 10 messages in this topic