Comments (10)
Hm, strange. What device and Rust version are you using? I haven't needed to add opt-level
to my STM32F103 projects to get them to work which is odd. I'll dig out my SPI display if I find some time and try to repro. Do you have an I2C display you can test with?
from ssd1306.
Using the latest nightly, with a bluepill, on Mac OS. I'm testing on my Ubuntu machine now. I'm afraid I had to cut some traces on my SSD1306 to use the SPI interface, so I don't have any I2C displays :(
from ssd1306.
Tested, no dice. I flash with opt-level=1 and it works, flash with opt-level=s and it doesn't. Do you normally build on the debug profile?
from ssd1306.
I'm always compiling with opt-level=s
and never had such a problem.
I just tried an example of my nucleo-f042k6
crate and it worked just fine with opt-level=s
.
@jamwaffles NB: We should release a new version to fix crates using ssd1306
as dependency.
from ssd1306.
I just tried cargo run --example blinky_i2c --release
and got a panic in GDB (macOS, Rust 1.27.0 nightly 2018-05-15). --release
implies opt-level=3
according to the defaults in the manifest. @Chocol4te do you get the same thing?
Adding various opt-level
s to [profile.release]
in Cargo.toml is odd:
opt-level = 0
worksopt-level = 2
does notopt-level = "s"
works for me on a Blue Pill over I2C.
This is very odd. I'll get my SPI display out tomorrow and see if that crashes also.
@therealprof We should indeed. I'm going to look at bumping to the latest releases of most of the deps to keep up with the ecosystem.
from ssd1306.
So I just tried s
, 2
and 3
here on my STM32F042 and they all work just fine.
from ssd1306.
The latest nightly breaks cortex-m-rtfm
so I am now using nightly-2018-05-11
.
I think I've found the issue. When stepping through line by line with the debugger it works. When I ignore breakpoints, or step very quickly, nothing gets written to screen. I'm guessing there's a delay that is getting optimised away somewhere, maybe needs a #[no_mangle]
?
I was wrong, that didn't fix the problem. I guess next is looking at the list of optimisations under each opt-level and comparing to find the ones that are different between 0, 1 and 2, 3, s and z
from ssd1306.
I don't know if this is the same issue, but I'm struggling to make it work on a Blue Pill board (regardless of debug level).
My code works fine on two f4xx boards (Nucleo F411RE and f407-based "black vet6" board).
But on a Blue Pill board, display either doesn't turn on at all, image is glitched, or rarely it's normal.
Maybe there's something wrong with my board, I'll try a different one next week.
from ssd1306.
As it turned out, I used PB13 as DC (data-command selector), but it didn't work for some reason. Logic analyzer showed "high" all the time. I switched to PA9, and now it works.
So, the driver works for me on Blue Pill on any optimization level (both default release and LTO-enabled). Didn't test true debug build because apparently it consumes too much stack and crashes (t's naive Game of Life implementation).
from ssd1306.
Closing as fixed 🙂
from ssd1306.
Related Issues (20)
- memchr does not declare `#![no_std]` HOT 4
- Issues on Adafruit OLED Bonnet HOT 1
- ssd1306 with rtic 1.0.0 HOT 7
- memory.x or probe-run "fix" HOT 6
- [N00b help request] Init fails with Raspberry Pi Pico and Adafruit OLED HOT 3
- Noob Issue: Cant manage to get this building for the stm32f1xx_hal HOT 6
- Newbie: No signs of life from SSD1306 atmega32u4 SPI 128x64 HOT 2
- How to use display with multiple I2C peripherals ([shared-bus] crate?) HOT 3
- Static noise when using crate with embedded_graphics HOT 4
- Using `DrawTarget::clear` is difficult in buffered graphics mode HOT 5
- `DrawTarget` is not implemented for `Ssd1306<I2CInterface<avr_hal_generic::i2c::I2c<.....` HOT 4
- Yet another `DrawTarget` is not implemented for `Ssd1306<SPIInterface<Spi... HOT 6
- Unable to draw circles & lines using embedded graphics crate
- Issues with 128x32 Display on Elegoo Arduino UnoR3
- read or toggle pixel in bufferedMode? HOT 4
- Using terminal mode with 90/270 degree rotation leads to incorrect output and panic HOT 1
- Configurable I2C address HOT 1
- trait `DrawTarget` is not implemented for ... / esp_idf_hal::i2c::*
- Buffered graphics paging issues.
- embedded-hal v1.0.0 and embedded-hal-bus HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ssd1306.