Page 1 of 1

The error in the assembly instruction for STM32F4xx based boards

Posted: Mon Jan 28, 2019 2:23 pm
by kudle19
Hi,
it seems there is some error in the <AND> Cortex M4 (STM32F405xxx) instruction. Below are two chunks of code for the <AND>
and <ORR> instructions for comparison:

MicroPython v1.10-15-gdeb67569f on 2019-01-28; PYBv1.1 with STM32F405RG
Type "help()" for more information.

Code: Select all

>>> @micropython.asm_thumb
... def f1():
...     movwt(r0, 5)
...     movwt(r1, 7)
...     and(r0, r1)
...
Traceback (most recent call last):
  File "<stdin>", line 5
SyntaxError: invalid syntax

>>> @micropython.asm_thumb
... def f1():
...     movwt(r0, 5)
...     movwt(r1, 7)
...     orr(r0, r1)
...
>>> f1()
7

Re: The error in the assembly instruction for STM32F4xx based boards

Posted: Mon Jan 28, 2019 3:10 pm
by Roberthh
The AND instruction is and_ (with trailing underline), because and is a Python keyword.