cancel
Showing results for 
Search instead for 
Did you mean: 

Defining variable in assembly with STM32CubeIDE

Slh
Senior

I want to define a variable in assembly code and write it in R0 whit this code:

__asm__(
		" var1 DD #123 		\n"
		" ldr.w r0, =var1     	\n"
   	   );

but I have this error when compiling:

"Error: bad instruction `var1 DD 123'"

The compiler doesn't know the "DD" for defining a "Double word" as 32-bit variable.

How can I define a variable in my assembly code and write it into e.g R0?

I use STM32Cube IDE and Cortex-M7.

Thanks

10 REPLIES 10

Still not...