Error [Og005] + [Og006] when using inline assembler
EW targets: | 430, ARM, AVR |
EW component: | C/C++ compiler |
Last update: | April 3, 2013 |
Problem:
When compiling a project with the IAR Embedded Workbench AVR v 6.12 the following errors might appear:
Error[Og005]: Unknown symbol in inline assembly:
Error[Og006]: Syntax error in inline assembly: "Error[54]: Expression can not be forward"
Solution:
Labels must be referred in the same assembler statement as they are declared.
Use multiline inline assembler (with row breaks \n) to solve this.
Example:
asm( "st -Y, R20 \n" "spmloop: \n" "lN R20, 0x37 \n" "SBRC R20, 0 \n" "RJMP spmloop \n" "OUT 0x37,R25 \n" "SPM \n" "LD R20,Y+ \n