uGFX Port for Teensy 3 / ChibiOS available?

Status
Not open for further replies.
Hello,

I'm the founder and maintainer of the µGFX project.
At this time there is at least no official port available. Probably someone got it working but didn't share it.
However, porting µGFX is very easy especially as there are already a number of different ports available from which you can look how it is done (including a template). If you face any issue while porting, we are more than happy to help you where we can at the µGFX community forum.

Edit: Make sure that you use the latest repository rather than the stable release if you start a port.


~ Tectu
 
Last edited:
Hello,

I'm the founder and maintainer of the µGFX project.
At this time there is at least no official port available. Probably someone got it working but didn't share it.
However, porting µGFX is very easy especially as there are already a number of different ports available from which you can look how it is done (including a template). If you face any issue while porting, we are more than happy to help you where we can at the µGFX community forum.


~ Tectu


Hi Tectu,

Can you give me some example so I can dig a bit deeper into it?
 
Hi syso2342,

First of all: From your thread title it looks like you want to use µGFX together with ChibiOS/RT. Is that correct? in that case you don't have to port anything from the µGFX side. As soon as ChibiOS/RT runs on your system µGFX will too - out of the box. Using google it looks like some people already run ChibiOS/RT successfully on the teenesy. However, if you need to port ChibiOS/RT, there's an official guide for that: http://chibios.org/dokuwiki/doku.php?id=chibios:guides:port_guide

Also note that you can use µGFX on any bare metal system (means without any underlying RTOS). The only thing you have to implement is a delay function.

So please let me know what you try to archive in order for me to help you better :)


~ Tectu
 
Dear Tectu,
I also want to bring ChibiOS and uGFX together on a Teensy 3.1.
The display is an Adafruit 2,8 TFT.

After some initial checks I ran into the following potential problems:

Problem 1:
The ChibiOS port for Teensy 3.x from Bill Greiman is "ready-to-run"; there are no makefiles etc. included in GitHub https://github.com/greiman/ChibiOS-Arduino/.
However when I follow the instruction on your homepage http://ugfx.org/get-ugfx/11-documentation/37-get-ugfx-chibios there is a need to add lines into the ChibiOS makefile.
Question: is this a potential show-stopper?

Problem 2:
I develop Teensy 3.1 software using Atmel Studio 6.
The idea of the IDE is to get rid of handwritten makefiles.
However the uGFX software relies on makefiles.
There is a rather clumpsy way to allow makefiles in Atmel Studio 6 but I do not know how to handle that mechanism for only a part of the project.
Question: is there a way to use uGFX without makefiles .

Thank you in adance for your answers.
Regards, Andreas
 
Dear Andreas,

I took a look at Bill Greiman's work and it looks like he simply threw out all the unneeded parts. This is usually a bad idea as updating to a more recent version is rather difficult. However, this is where most IDEs become the problem anyway and therefore the major reason why both ChibiOS/RT and uGFX use a Makefile based systems. A Makefile based library allows to update to a newer version without the need to change a single file inclusion in an IDE or anything like that as all the required path matching is done within the library's Makefile system.

To actually answer your question: It is no problem to use uGFX without makefiles. In fact most of the uGFX users do it due to the fact that most of our users/customers work in a professional industrial environment and there IDEs like Keil, IAR and Atmel Studio are very common. We wrote a small guide which leads you through the process of adding the required uGFX files to your IDE: http://wiki.ugfx.org/index.php?title=IDE
Please note that the current master branch uses slightly different paths (we added proper prefixes to all the files in order to avoid file naming conflicts with the users project). However, they are pretty straight forward to figure out.
Should you face any problem we are more than happy to help you over at the uGFX community forum.


~ Tectu
 
Would anyone be able to update me on the status of using both uGFX and ChibiOS together on the Teensy 3(.1)?
If it is possible, what's the best way to get up and running easily to develop for that combination? (I'm currently just using Teensyduino)
 
Would anyone be able to update me on the status of using both uGFX and ChibiOS together on the Teensy 3(.1)?
From our side (uGFX Developers) there is no port available yet. However, we plan to buy a couple of Teensy boards in the future in order to write the port ourself.
However, due to time issues we'd still be happy if a Teensy user would contribute a port.

If you decide to take up the task yourself we will be more than happy to help you where we can in order to get this running.


~ Tectu
 
I'm working on an SSD1531 (adafruit 1,5" OLED display) driver for ugfx and I'll report progress here. Doesn't seem to be hard, we'll see.
 
I'm not yet compiling with the arduino IDE (but Code::Blocks), but I got it to work. The code is posted in thread linked above and the ugfx people seem to be interested in supporting teensyduino
 
Anyone make progress on this? I would love to try out ChibiOS and uGFX on my Teensy + SSD1351 OLED!
 
I what IDE? That's really important, because the toolchain setup depends on the IDE. Regarding compilation issues and using ugfx together with an OS, the ugfx forum seems to be a good place to ask. In general ugfx has been somewhat adapted to arduino because it can now be compiled as a single file. I can't be more specific because I haven't used ChibiOS, but I might be able to help when specific problems arise.
 
I what IDE? That's really important, because the toolchain setup depends on the IDE. Regarding compilation issues and using ugfx together with an OS, the ugfx forum seems to be a good place to ask. In general ugfx has been somewhat adapted to arduino because it can now be compiled as a single file. I can't be more specific because I haven't used ChibiOS, but I might be able to help when specific problems arise.

I would be using Stino on OS X. it is a plugin for Sublime Text, so I can have custom build steps if I need them, but it might be a pain.

What about using just uGFX without Chibi, does that require a special toolchain?
 
You don't need a special toolchain, but arduino needs a special library format. If you used arduino, you'd have to package ugfx for use with your project.

However, as you're using something different, you can just add the ugfx source files to your existing project, as ugfx is written in plain C. If ugfx is configured correctly (through a header) you just need to add a single source file, see here: http://forum.ugfx.org/viewtopic.php?f=9&t=228&p=1920

I cannot help with your specific IDE, though.
 
From our side (uGFX Developers) there is no port available yet. However, we plan to buy a couple of Teensy boards in the future in order to write the port ourself.
However, due to time issues we'd still be happy if a Teensy user would contribute a port.

If you decide to take up the task yourself we will be more than happy to help you where we can in order to get this running.

~ Tectu

@Tectu - did you get any Teensy's and make a start or any progress?

Given the Arduino IDE support on Teensy that would be my preference. If it works there it should be good for VisualMicro etc.

I tried to generalize some buttons for the ILI9341 touch and it takes about two minutes to see that a 'Resource Editor' tool would be needed just to organize those values - and I saw you have one in beta. I was just pointed to uGFX the other day - knowing how and where to start would be good to see some early progress.
 
I tried to compile an arduino sketch with ugfx as per their instructions and didn't get any errors, but (reasonable) warnings from ugfx's internals. This means that ugfx code was indeed compiled. Some remarks:

The ugfx maintainers instruct you to create a ugfx library for arduino, but ugfx must be configured per project. This is done in files that are in the library folder. I'd advise to create a project-specific ugfx library to keep things separate. For example, for their ArduinoTinyScreen demo I've created a library called ugfx-arduinotinyscreen (lower case for no specific reason). Renaming the folder is enough, no need to rename the files (it also causes problems).

You sketch should include this specific library. I've done this through the library menu. Arduino might get confused if several versions of project-specific libraries exist, because they would all have <gfx.h> in their main library folder.
 
OK, arduino indeed gets confused by several unaltered ugfx library folders with the same content. Here's my workaround: Add a header named like the library: libfolder.png
Content of that header:

Code:
#ifndef UGFX_ARDUINOTINYSCREEN2_H
#define UGFX_ARDUINOTINYSCREEN2_H
#include "gfx.h"
#endif // UGFX_ARDUINOTINYSCREEN2_H

You can't simply rename gfx.h, because other files of the ugfx system will look for it. With this extra wrapper, arduino looks for the correct folder and adds that to the compiler's include path instead of the first one it finds with a file named "gfx.h", because all project-specific copies of ugfx will have that file. Likewise, the sketch should not include <gfx.h>, but <ugfx-arduinotinyscreen_2.h> (or the project-specific header you have in your library folder, of course)

ugfx separates low-level drivers from the high-level drawing code, so it should be possible to create project-specific board drivers as well, like ugfx-ssd1351-teensy32. This makes sense for separating the overall ugfx configuration from the low-level stuff for a specific project.

I hope this helps!
 
christioph,

I tried setting up the arduino package you provided, but I get all kinds of compilation errors related to paths. I am attempting to work around them all by directly linking to the libraries by using include lines such as:

Code:
#include "../../libraries/example-ssd1351-ugfx-config/example-ssd1351-ugfx-config.h"

but I have yet to find a successful combination of library paths.

Tectu, what is stopping you from getting Teensys to try this out? Are you waiting for someone to send you one? I have a spare 3.1 I might be able to send your way if that would get official support rolling...

Anyone else willing to throw down?

T
 
Arduino copies all relevant source files into temporary folders before compiling. So as soon as it starts compiling your relative include path is invalid.

Some questions that you need to answer for me to help you:
  • Are you on windows or Linux?
  • Did you clone or download the code? A cloned repo already has the correct folder name, a downloaded zip file contains a folder that must be renamed.
  • When did you clone/download the code? I have updated the instructions about two days ago.
  • What version of Arduino are you using? I have tested it with 1.6.6.
Your arduino/libraries folder should contain the following folders, and they must be copied from the ugfx-arduino repo to that location:
  • example-ssd1351-ugfx-config/
  • ugfx-arduino-gdisp-ssd1351/
If you are on Linux, please navigate to your arduino libraries folder in a terminal and paste the output of
Code:
<arduinoLibrariesFolder>$ tree -d -L 1 | grep ugfx
It should look like this:
Code:
tenkai@someComputer:<arduinoLibrariesFolder>$ tree -d -L 1 | grep ugfx
.
├── example-ssd1351-ugfx-config/
├── ugfx
├── ugfx-arduino
└── ugfx-arduino-gdisp-ssd1351

Regards

Christoph
 
Status
Not open for further replies.
Back
Top