• -print-libgcc-file-name gives thumb while -marm is used

    Arjan
    Arjan

    Dear Forum,

    Using

    ~$ arm-none-eabi-gcc -v                                                                             
    Using built-in specs.
    COLLECT_GCC=arm-none-eabi-gcc
    COLLECT_LTO_WRAPPER=/opt/gcc-arm-none-eabi/bin/../libexec/gcc/arm-none-eabi/9…

    • 1 month ago
    • Processors
    • Cortex-A / A-Profile forum
  • gcc does not generate correct code while building PIC

    rgujju
    rgujju

    Hey guys,

    I have been exploring building PIC using the gcc toolchain and I think there is a bug.

    I first build a shared library using 

    arm-none-eabi-gcc -shared -mcpu=cortex-m4 -mthumb -Wall -g -fPIC -fmessage-length=0 --specs=nosys.specs mylib.c -o libmylib…

    • 3 months ago
    • Processors
    • Cortex-M / M-Profile forum
  • Saving processor state for power-down and resume

    Andrew Heale
    Andrew Heale

    I'm working on a SoC that can power-off the ARM (Cortex-M4) while retaining the system RAM, and I'm interested in saving the processor state then restoring it when the ARM is restarted.  So prior to power-off the software would save all necessary…

    • 5 months ago
    • Processors
    • Cortex-M / M-Profile forum
  • UXTB only Thumb2?

    Samar Samar
    Samar Samar
    Note: This was originally posted on 12th February 2009 at http://forums.arm.com

    Hi All,

    Arm9 crashed on UXTB instruction because it is not able to decode it. It caused Undef-Instruction exception.

    I have been trying to find if UXTB which is a Thumb2 instruction…
    • Answered
    • over 6 years ago
    • Processors
    • Classic processors forum
  • State of link register on an interrupt from Thumb (ARM7TDMI).

    Revanth Kamaraj
    Revanth Kamaraj

    Hi,

    If an interrupt occurs when in Thumb state, does the LSB of the link register become 1.

    Thanks,

    Revanth

    • Answered
    • over 3 years ago
    • Processors
    • Classic processors forum
  • Cortex A code / function alignment

    Vincent Siles
    Vincent Siles

    Hi !

    I am writing assembly code for some ARMv7a and ARMv8a CPU. I know that code has to be 4 bytes aligned, but I saw in several places (uboot/linux) the ".align 4" GCC directive, which will align to 2**4 = 16 bytes.

    When writing code that will…

    • Answered
    • over 3 years ago
    • Processors
    • Cortex-A / A-Profile forum
  • Real Value of PC Register.

    Carlos Delfino
    Carlos Delfino

    I've been reading books on the ARM Cortex-M architecture and as already mentioned in other post, all the books are consistent in saying that the PC points four bytes (Thumb Instruction Set) forward due to Pipeline (prefetch).

    Did some testing with…

    • Answered
    • over 5 years ago
    • Processors
    • Cortex-M / M-Profile forum
  • [Cortex-M0] Thumb mode & code size

    wshen
    wshen

    Hi,

    I'm somewhat confused with the Thumb mode code size.  My understanding is compiling with ARM mode will generate 32-bit instructions and compiling with Thumb mode will generate 16-bit instructions.  When I compile my Cortex-M0+ project (which should…

    • Answered
    • over 5 years ago
    • Processors
    • Cortex-M / M-Profile forum
  • Could you explain this assembly line to me?

    Robert
    Robert

    Hi,

    I am learning ARM assembly code. The following is a Thumb disassembly from a short .c file:

    int main()

    {

          printf("Hardware test, finish testing.\n");

          return 0;

    }

    00000000 <main>:…

    • Answered
    • over 6 years ago
    • Processors
    • Cortex-M / M-Profile forum
  • UPREDICTABLE instructions

    Juha Aaltonen
    Juha Aaltonen

    Any idea about instructions marked as UNPREDICTABLE: can it then be UNDEFINED?

    In other words: UNDEFINED REQUIRES the instruction to cause UND-exception, but

    MAY UNPREDICTABLE do that, or does it have to execute normally except that the result may be…

    • Answered
    • over 5 years ago
    • Processors
    • Cortex-A / A-Profile forum
  • The madman strikes again - ADD/SUB SP

    Juha Aaltonen
    Juha Aaltonen

    Is there something special in the instructions ADD (SP plus register, ARM) and SUB (SP minus register)?

    I didn't find anything different from the basic ADD  (register) and SUB (register) except the documentation:

    <Rd> The destination register…

    • Answered
    • over 5 years ago
    • Processors
    • Cortex-A / A-Profile forum
  • From the CPU's point of view, how does it distinguish an assembly code is an ARM code or a Thumb code?

    Kun.Niu
    Kun.Niu

    From the CPU's point of view, how does it distinguish an assembly code is an ARM code or a Thumb code?

    Is there some signal bit represent the code is ARM or Thumb code, this is just my guess.

    • Answered
    • over 4 years ago
    • Processors
    • Cortex-M / M-Profile forum
  • Why does ARM Branch with Link (BL) instruction considers prefetch?

    Robert
    Robert

    Hi,

    When I read the words below dot line, I don't understand why "R14 is adjusted

    to allow for the prefetch"

    Could you explain it to me?

    Thanks,

    .......

    Branch with Link (BL) writes the old PC into the link register (R14) of the

    current…

    • Answered
    • over 4 years ago
    • Processors
    • Cortex-M / M-Profile forum
  • Why does ARMSim# not recognize instruction 'addw'?

    Robert
    Robert

    Hi,

    For the below code, ARMSim# does not recognize '.arch armv7-r'. It says:
    "unknown opcode or directive: .arch"It does not recognize 'addw' either, says:
    "unknown opcode or directive: addw"I have check ARMTRM. 'addw' is a legal…
    • Answered
    • over 4 years ago
    • Processors
    • Classic processors forum
  • What does it mean 'IT can be omitted'?

    Robert
    Robert

    Hi,

    When I read the following on ARM website, I don't understand the first line. When I change ITTE to TE (as 'IT can be omitted"), the assembler complains an error of this line.

    Could you explain it to me?

    Thanks,

      ITTE NE ; IT can be omit…

    • Answered
    • over 4 years ago
    • Processors
    • Cortex-A / A-Profile forum
  • Question about a code snippet on ARM, Thumb state change

    Robert
    Robert

    Hi,

    I find the following code snippet online on ARM state change. Although that whole material looks solid, the second line in the blue code below is puzzling.

    add R1,PC,#1 ;Load address of SUB_BRANCH, Set for THUMB by adding 1

    I don't see how the above…

    • Answered
    • over 4 years ago
    • Processors
    • Cortex-A / A-Profile forum
  • M0+ Stack Pointer (PSP/MSP) Clarification

    Sean Dunlevy
    Sean Dunlevy

    Background

     I'm working part-time on a Cortex M0+ based SoC converting a very processor-intensive section of C++ code (inner-loop executed 10s of 1000s of times a second & compiles to over 400 instructions using GNU O3) and after almost 3 months of work…

    • Answered
    • over 1 year ago
    • Processors
    • Cortex-M / M-Profile forum
  • Linker in gnu arm toolchain says "group ended without start" thought there is no such option in my build

    ShyamThella
    ShyamThella

    shyam@shyam:~/projects/zynq/microzed/linux_source/Test_Chips$ make
    make -C  /home/shyam/projects/zynq/microzed/linux_source/Test_Chips/../dev_tools/build
    make[1]: Entering directory `/home/shyam/projects/zynq/microzed/linux_source/dev_tools/build'
    Making…

    • Answered
    • over 3 years ago
    • Processors
    • Cortex-M / M-Profile forum
  • Store the value of PC to Memory address

    Muzahir
    Muzahir

    I want to store the value of Program Counter(pc) to a memory location.

    I did this, 

        LDR R1, =[0x20000000]

        STR R15, [R1,#0]

    I got an error saying, "Error: r15(pc) not allowed here -- `str R15,[R1,#0]'.

    How should I get over this error?

    • Answered
    • over 2 years ago
    • Processors
    • Cortex-M / M-Profile forum
  • IT CPZ CPNZ

    Sean Dunlevy
    Sean Dunlevy

    My Thumb 16-bit Instruction Set 'Quick Reference Guide' is permanently displayed on one of my monitors. I note several instructions that are at once listed but are marked as T2 i.e.

    (If then)                                   IT {pattern} {cond}
    (compare/branch) 

    …
    • over 1 year ago
    • Processors
    • Cortex-A / A-Profile forum
  • NVIC and ARM asm

    martin
    martin

    Cannot configure interupts of TIM6 on stm32f103 board

    Does my NVIC configuration wrong?

    Code:

    @ stm32f103 timer & interrupt test by laper_s (from 2019-02-02)
    
    .thumb
    .cpu cortex-m3
    .syntax unified
    
    .word   0x20005000
    .word   start + 1
    
    b   start…

    • Answered
    • over 1 year ago
    • Processors
    • Cortex-M / M-Profile forum
  • Decoding the Startup file for Arm Cortex-M4

    Gopal Amlekar
    Gopal Amlekar

    Introduction

    This is my attempt to understand the startup file for an Arm Cortex M4 processor, specifically the STM32F4 (Cortex M4) processor. This document should help in giving a feel of assembly language for Arm and understanding how the Cortex M4…

    • startup_stm32f40xx.s.zip
    • over 5 years ago
    • Processors
    • Processors blog
  • ELF entry point in thumb mode (armv7/aarch32)

    Vincent Siles
    Vincent Siles

    Hi !

    We are writing an OS targeting 32 bits ARM platform, where binaries can be compiled in ARM or in Thumb mode.

    At the moment, to execute a new process, I load the info from an ELF, set lr_usr to the entry point address, set spsr_usr to a default value…

    • Answered
    • over 3 years ago
    • Processors
    • Cortex-A / A-Profile forum
  • Warning: It blocks containing 32-bit Thumb instructions are deprecated in ARMv8 with GCC 4.9

    Carlos Delfino
    Carlos Delfino

    Dear colleagues.

    I am compiling the Intel TBB in an effort to optimize my code to the Cortex-M53, however, because I was still forced to use GCC 4.9 I'm getting some warning messages about the use of  32bit Thumb Instrucions in IT blocks:

    Warning…
    • Answered
    • over 3 years ago
    • Processors
    • Cortex-M / M-Profile forum
  • How many states for an ARM Cortex A8?

    Robert
    Robert

    Hi,

    When I read about Thumb2 instructions, I have such a question: How many states for a Coretx A8? I know it has ARM and Thumb states. Thumb2 instruction is belong to Thumb state? Then does A8 have a pure Thumb instruction besides Thumb2 set?

    Thanks,

    • Answered
    • over 4 years ago
    • Processors
    • Cortex-A / A-Profile forum
  • View related content from anywhere
  • More
  • Cancel
>