light_ws2812 icon indicating copy to clipboard operation
light_ws2812 copied to clipboard

Impossible constraint in 'asm'

Open azkara22 opened this issue 4 years ago • 5 comments

I am trying to use the ws2812 code for AVR with a ATtiny3217 but I get "Impossible constraint in 'asm'" error along with "asm operand 2 probably doesn't match constraints" warnings. The error looks like it's coming from the following instruction, but I can't get it work.

"I" (_SFR_MEM_ADDR(ws2812_PORTREG)

azkara22 avatar Dec 23 '20 08:12 azkara22

Did you define a port register that is part of the I/O region?

cpldcpu avatar Dec 23 '20 10:12 cpldcpu

I have just found that the PORTC register that I am using is out of the I/O region. The solution in my case has been to use the VPORTC_OUT register that it is on that region. Thank you for the response anyway.

azkara22 avatar Dec 23 '20 10:12 azkara22

Hi, is there a way to use a register outside the I/O region? In my case I need to use PH5 on ATMega2560. In iomxx0_1.h PORTH is defined as _SFR_MEM8(0x102).

Sponge5 avatar Apr 03 '21 11:04 Sponge5

The way I understand this is to replace out instructions with sts and fiddle with the amount of noop's. I'll probably resort to rewiring the board 😅

Sponge5 avatar Apr 03 '21 13:04 Sponge5

Have a look at the Arduino version. It actually uses sts for port access.

https://github.com/cpldcpu/light_ws2812/blob/master/light_ws2812_Arduino/light_WS2812/light_ws2812.cpp

cpldcpu avatar Apr 04 '21 05:04 cpldcpu

Version 2.5 should fix this issue.

cpldcpu avatar Nov 18 '23 22:11 cpldcpu