Skip to content

Commit f361abe

Browse files
Merge pull request #19 from LongLiveCHIEF/add-optimization-note-to-readme
add info on required compiler optimization level
2 parents 209313c + d6a57e0 commit f361abe

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ It provides two variants:
2828
the UART peripheral. You should verify it runs at an acceptable frequency, by
2929
either studying the datasheet & the hal code or using a logic analyzer. An
3030
fx2 based one, commonly available under $10 works great for this.
31+
3132
- If the first led is always on, no matter what data you put in, your spi is
3233
probably not setting the mosi line to low on idle (You can check with a multimeter).
3334
It may also be a timing issue with the first bit being sent, this is the case
@@ -41,6 +42,14 @@ It provides two variants:
4142
- Is everything white? This may stem from an spi peripheral that's too slow or
4243
one that takes too much time in-between bytes
4344

45+
- Are you using the `--release` compiler flag?
46+
47+
The timing of each byte passed over SPI is very sensitive, and running code compiled
48+
without full optimizations can throw off your timing. Always use either `--release`
49+
flag with your `cargo <command>`, or alternatively set `[profile.dev] opt-level = "3"`
50+
To ensure timing matches what your programmed. A dead giveaway of this is when all
51+
pixels go full brightness for every color.
52+
4453
When opening an issue about wrong/strange data, it would help if you include
4554
your code (of course) and a capture of MOSI & SCK from an oscilloscope/a logic
4655
analyzer.

0 commit comments

Comments
 (0)