2

Today I've been getting this error in my code stating:

RTE\Device\STM32F407VGTx\startup_stm32f407xx.s(191): A1163E: Unknown opcode R0, expecting opcode or macro

Here is the area of code where it stops at:

Error

I have not performed any assembly in the code that I have written, which seems like a common reason why this message appears. Would anyone be kind enough to help me troubleshoot this issue? This is my first time programming with an STM32F4 board, so I am not entirely sure where to begin looking :(

3
  • 1
    Looks like an indentation problem, is that compiler generated code?
    – Jester
    Mar 27, 2016 at 22:42
  • Yes, it is compiler generated code!
    – Andrew T
    Mar 27, 2016 at 22:45
  • Have you accidentally created two "main.s" file?
    – lousycoder
    Dec 23, 2020 at 17:08

1 Answer 1

4

I took a break from looking at my code, and when I came back, I randomly pressed TAB before the LDR statement and the code can now successfully compile with 0 errors and 0 warnings!

1
  • 1
    In some assemblers, anything in the left-most column is assumed to be a label, not a mnemonic, even if it is also a valid mnemonic. Apparently ARMasm is one of those assemblers. GNU assembler is not; you'd need ldr: to define a symbol called ldr, otherwise it would be assumed to be an instruction. Mar 9, 2021 at 12:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.