-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkg: u8g2: add graphics library #5549
Conversation
Awesome ! |
I used the EFM32 based STK3600 and SLSTK3401A (includes low-power memory LCD). There exist several versions of the SSD1306. Be sure to pick the right one. Also check the Makefile + README.md for more information on how to setup the display. |
## API | ||
This package patches the original source to add an interface for RIOT-OS peripherals and removing most of the device/platform specific code. | ||
|
||
The following two interfaces add add support for the included drivers via I2C and SPI peripherals: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"two interfaces add support " (extra add)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turns out I forgot to update this file, It was still for U8g. Fixed it.
@basilfx, with a bit of luck (and tries), I could make this PR work with an I2C ssd1306 based module. The README is well explained.
Good job ! |
Default output to stdout works as well (using TEST_U8G2_OUTPUT=0). @basilfx, can you fix the inline comments, so I can give this PR an ACK ? |
eeec1f2
to
7866ef7
Compare
I fixed the comments, updated the package and tested it again. Can you also take a quick look? |
I wanted to test the SDL display with native but it doesn't compile although I have libSDL (1 and 2) installed on my Linux (Ubuntu 16.04). Any idea why ? |
Does this work for you? Although I am on macOS, the first two should work: basilfx:~/ $ sdl-config --libs
-L/opt/homebrew/lib -lSDLmain -lSDL -Wl,-framework,Cocoa
basilfx:~/ $ sdl-config --cflags
-I/opt/homebrew/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE
basilfx:~/ $ brew list sdl
/opt/homebrew/Cellar/sdl/1.2.15/bin/sdl-config
/opt/homebrew/Cellar/sdl/1.2.15/include/SDL/ (32 files)
/opt/homebrew/Cellar/sdl/1.2.15/lib/libSDL-1.2.0.dylib
/opt/homebrew/Cellar/sdl/1.2.15/lib/pkgconfig/sdl.pc
/opt/homebrew/Cellar/sdl/1.2.15/lib/ (3 other files)
/opt/homebrew/Cellar/sdl/1.2.15/libexec/SDLMain.nib/ (3 files)
/opt/homebrew/Cellar/sdl/1.2.15/libexec/ (4 files)
/opt/homebrew/Cellar/sdl/1.2.15/share/aclocal/sdl.m4
/opt/homebrew/Cellar/sdl/1.2.15/share/man/ (174 files) |
I tried the 2 ones:
Which are the expected values : I could build a simple SDL example. When building the SDL for native RIOT, I have other strange messages:
|
Ah I think that it has to do with RIOT-OS building a 32-bit binary while your SDL is 64-bit. I'll look into that, otherwise it will be a limitation that I will document. Edit: maybe try this: http://askubuntu.com/questions/510419/i-can-i-install-a-32-bit-version-of-libsdl1-2debian-on-a-64-bit-machine |
I improved the comments a bit more, regarding SDL. I also tried |
Good to know. I was a bit optimistic with the --unified=0 option. |
Another question: is it supposed to work when running RIOT in native and displaying in stdout (make term BOARD=native) ? |
That should work. It should produce the output equal to the first display. Characters are printed to stdout. |
The stdout display was not working for me in native, I had to install missing 32bit libraries:
to make it work. For SDL:
but the it still doesn't work for me. I had to:
|
@basilfx, for SDL, the problem comes from |
Neat :) |
ACK |
Murdock is failing. Please add the boards that don't have enough memory to your tests as |
Anyone wants to revive #1681 ? 😉 |
I'll fix this tonight. |
I could simply blacklist U8g2 (and U8glib) was designed for Arduino platforms, so it is strange that I don't have a working MSP-430 compiler, but I presume it has a similar problem. |
Hmmm... in the results we have:
for arduino-mega2560 and
which are actually impossible... Can you try to rebase and see what happen? |
I did. After rebase, without 'fix': basilfx:pkg_u8g2/ (feature/pkg_u8g2) $ BOARD=arduino-mega2560 make
Building application "pkg_u8g2" for "arduino-mega2560" with MCU "atmega2560".
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/pkg/u8g2
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/tests/pkg_u8g2/bin/pkg/arduino-mega2560/u8g2
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/tests/pkg_u8g2/bin/pkg/arduino-mega2560/u8g2/csrc
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/tests/pkg_u8g2/bin/pkg/arduino-mega2560/u8g2/sys/utf8/common
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/boards/arduino-mega2560
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/core
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/cpu/atmega2560
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/cpu/atmega_common
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/cpu/atmega_common/periph
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/drivers
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/sys
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/sys/auto_init
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/sys/tsrb
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/sys/uart_stdio
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/sys/xtimer
/opt/homebrew/opt/avr-binutils/bin/avr-ld: /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/tests/pkg_u8g2/bin/arduino-mega2560/pkg_u8g2.elf section `.text' will not fit in region `text'
/opt/homebrew/opt/avr-binutils/bin/avr-ld: region `text' overflowed by 739852 bytes
collect2: error: ld returned 1 exit status
make: *** [all] Error 1 After rebase, with 'fix' basilfx:pkg_u8g2/ (feature/pkg_u8g2) $ BOARD=arduino-mega2560 make
Building application "pkg_u8g2" for "arduino-mega2560" with MCU "atmega2560".
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/pkg/u8g2
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/tests/pkg_u8g2/bin/pkg/arduino-mega2560/u8g2
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/tests/pkg_u8g2/bin/pkg/arduino-mega2560/u8g2/csrc
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/tests/pkg_u8g2/bin/pkg/arduino-mega2560/u8g2/sys/utf8/common
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/boards/arduino-mega2560
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/core
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/cpu/atmega2560
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/cpu/atmega_common
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/cpu/atmega_common/periph
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/drivers
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/sys
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/sys/auto_init
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/sys/tsrb
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/sys/uart_stdio
"/Applications/Xcode.app/Contents/Developer/usr/bin/make" -C /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/sys/xtimer
text data bss dec hex filename
16224 650 2361 19235 4b23 /Users/basilfx/Desktop/RIOT_Dev/RIOT_U8g2/tests/pkg_u8g2/bin/arduino-mega2560/pkg_u8g2.elf Fix: diff --git a/boards/arduino-mega2560/Makefile.include b/boards/arduino-mega2560/Makefile.include
index de5461b..c9f6ad5 100644
--- a/boards/arduino-mega2560/Makefile.include
+++ b/boards/arduino-mega2560/Makefile.include
@@ -41,6 +41,6 @@ export CFLAGS_OPT ?= -Os
export CFLAGS += $(CFLAGS_CPU) $(CFLAGS_LINK) $(CFLAGS_DBG) $(CFLAGS_OPT)
export ASFLAGS += $(CFLAGS_CPU) $(CFLAGS_DBG)
-export LINKFLAGS += $(CFLAGS_CPU) $(CFLAGS_DBG) $(CFLAGS_OPT) -static -lgcc -e reset_handler
+export LINKFLAGS += $(CFLAGS_CPU) $(CFLAGS_DBG) $(CFLAGS_OPT) -Wl,--gc-sections -static -lgcc -e reset_handler
export OFLAGS += -j .text -j .data -O ihex
export FFLAGS += -p m2560 -c $(PROGRAMMER) $(PROGRAMMER_FLAGS) -F -D -U flash:w:bin/$(BOARD)/$(PROJECT)$(APPLICATION).hex |
b19a85b
to
b27171d
Compare
What it means 'fix' ? |
Adding This option is what the Arduino IDE also uses, but what is missing in the Makefile. |
Looks sensible. Can you open a PR for that? |
Can you rebase this one since #5632 was merged? |
b27171d
to
9516568
Compare
9516568
to
7033401
Compare
So since @aabadie already ACKed, Murdock is green and the RIOT tetris game was revived, lets merge this one! |
This PR adds support for U8g2, the successor of U8glib. It replaces PR #5126.
The main advantages (so far):
I'm currently testing it, so there is some work in progress and needs testing on other platforms/compilers. Furthermore, U8g2 is still under development.