Jump to content

uGFX and High-speed real-time apps


Stas285

Recommended Posts

Hello community!

I'm newbie here and would be grateful for an advice.

1. I developed previously a few high-speed real-time devices using Silabs 8051 controllers. "High-speed real-time" means here that there is a timer interrupt every 10 microseconds. Within the interrupt the following is performed:

ADC read with emergency check;

PID control function calculation;

write the result to DAC;

pending UART read/write (1 Mbaud);

system counter increment.

Highly optimized IRQ routine takes few microseconds to do that providing guaranteed response not later then 10 uS after something happens.

The "slow" HMI part (keyboard/encoder and alphanumeric display) is serviced asynchronously in main infinite cycle (without interrupts).

A 8-bit 100 MHz Silabs controller is completely sufficient for this task, however, progress must go on, so I decided to switch to STM32 with GUI.

Thus, the question: Is it possible to realize this using uGFX/ChibiOS? May Systick be as fast as 10 uS (with LCD and Touchscreen control)? Will the response be guaranteed? Probably it's possible to use usual "slow" systick timer for GUI together with another "fast" 10 uS timer having higher priority?

2. The second question is more philosophical. I'm now in search for GUI platform which is optimal for me. Taking into account that I am an "episodical" programmer (and my brain is full of another garbage) the main demand is just simplicity.

My first try with STM32 was using Cube from ST. Hardware configuration "by mouse", automatic code generation, next few lines by-hand to main.c and blinky LED was done in 10 minutes. Excellent! I was really happy, but the next step (GUI) occurred much harder. I tried STemWin: for the first glance it looks too complicated for my tasks, and the code not open, so I suspect probable issues with guaranteed fast response. Next I tried the online compiler MBED. The first result was obtained relatively quickly, but MBED works only on Nucleo boards and doesn't have native GUI. These problems look not catastrophic, and it seems that my tasks may be solved using MBED, but there is no satisfaction at the moment. uGFX looks attractive, but not so easy (it's just a first impression, probably I didn't spent enough time yet). I am trying to implement the Widgets example using Keil uVision but without success yet due to lot of details. The example just for Keil would be helpful, but I didn't found any. uGFX Studio looks perfect, but when the beta will be released?

So the question: could anybody advise me if uGFX is the good choice for my situation?

Link to comment
Share on other sites

We believe that ugfx is a good choice for what you want but then we are biased. :)

The trick with simplicity is not to reinvent the wheel. For example, we have a number of users that want to use ugfx without an operating system. Whilst possible it is definitely more complex than using an existing real time operating system.

I would strongly suggest that you start with the chibios and ugfx combination. Chibios is the hard real time operating system and ugfx is the GUI. The reasons for suggesting this combination are:

1. Both chibios and ugfx are well supported with active user groups to help with problems,

2. The chibios ugfx combination is the best supported combination of GUI and os with many boards supported out of the box for this combination,

3. Chibios is small and extremely fast. Ugfx runs as a (lower prioroty) user thread thus not affecting the real time response of your system,

4. Chibios has an excellent HAL that supports all the STM32 peripherals and supports dma operation where supported by those peripherals,

5. The ugfx makefile system knows how to build a chibios/ugfx system out of the box - no makefile nasty stuff to hack.

6. Ugfx supports a Linux or win32 emulation that should enable easy prototyping and debugging of your gui even before putting it on real hardware often with no code change (ugfx is designed to be operating system portable).

Questions on the real time performance of chibios is probably better being asked in the Chibios forum.

A good place to start to learn ugfx is with the demo programs. They are designed to demonstrate how to use various aspects of the system. If you are using win32 as a Dev platform read the wiki guide on your first windows compile. It will have you up and running in a few minutes with all the appropriate compilers etc for that platform.

Next read the other wiki articles on the ugfx architecture. That will help when you go to port to your own hardware.

I would also suggest trying the Chibi - Studio ide (part of the chibios project). Based around the popular eclipse ide it includes all the necessary bits and pieces such as compilers, configuration etc for working with your actual hardware.

Whilst taking other paths such as using Kiel is definitely possible, it is just another complication to have to deal with initially.

Good luck and welcome to the community.

Link to comment
Share on other sites

Hello Stas285 and welcome to the community!

Inmarket has already covered pretty much everything. I'd just like to leave a few more comments:

1. uGFX is meant to be easy and powerful at the same time. I know that this sounds very controversial and that most libraries fail miserably at this point. We pay a lot (and I mean a really lot) of time and attention to have an API that is totally consistent and easy to use. Along with the very simple and straight forward API we provide interfaces for more advanced programmers to customize their uGFX experience to fit into their application seamlessly without any unnecessary pay-offs. Summary: uGFX is very easy to use compared to other embedded GUI libraries if you don't want to dig deep and as soon as you want to dig deep you will discovery that it provides everything you need to customize it to build a powerful and optimized application.

Just click a few minutes through the API and the examples which you can find in the /demos/modules directory and judge by yourself whether the API is easy enough: http://api.ugfx.org

But as inmarket already said: We're of course biased. This can however always be turned to a positive point: We looked for a good embedded GUI library ourselfs back then and there way nothing around that suited our demands (which were very close to yours) so we decided to do it ourself ;-)

2. I'm sadly not allowed to list any specific names due to NDA contracts but many big industrial companies are already using uGFX very successfully and they are rather satisfied with it. In fact, about half of our commercial customers switched from an existing embedded GUI library to UGFX.

3. ChibiOS/RT is a great RTOS. It's basically uGFX but on the OS side: It is very easy to use at the beginning (very straight forward API, plenty examples, active forum community and open development) and when you become more advanced there are enough interfaces that you can use to optimize your application.

One of the greatest things about ChibiOS/RT is that it provides an (optional) built-in HAL. You can get anything from I2C, SPI, SD-Cards and so on working within minutes.

uGFX actually started as an official add-on module to ChibiOS/RT called ChibiOS/GFX. As soon as we realized that there's a high demand for a library like uGFX in the embedded world we decided to abstract the OS interface so it can now be used with anything.

4. uGFX-Studio: The beta is very close as inmarket said. I just published a new

. It is already a usable program but it lacks the actual widgets as we focused on the ground work first. We will add the remaining widgets within the following weeks and then we'll release the public beta.

We have already provided preview versions to selected commercial customers. If it helps you to decided whether you want to use uGFX please contact us through the listed e-mail address and we'll see what we can do for you ;)

If you have any further question do not hesitate to ask. We're happy to help wherever we can.

~ Tectu

Link to comment
Share on other sites

Thanks a lot to inmarket and Tectu!!!

I couldn't even expect for so prompt, detailed, consistent, and (the main poin) useful comment.

To my mind this is the best advertisement of uGFX and highly valuable reason for me to use it in future.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...