thexeno Posted September 24, 2017 Report Posted September 24, 2017 (edited) Hi, I am trying to use the uGFX library in AS7, with the GDISP module for a OLED display, the SSD1306, but I am struggling in the right importing procedure. I have the goal to setup just something which build, it does not matter if the HAL and various modules are not setup properly. I tried to follow the procedure without the makefile, since I would need to modify the Windows environment and I would like not to do this on every machine in which I could work on this project. So I tried the inclusion file approach. I've imported the gfx folder in the root of my project, and added all of its content. Then, in the compiler directories, I have added:C:\Users\[...]\Atmel\ugfx_disp\ugfx_disp\ugfx\srcC:\Users\[...]\Atmel\ugfx_disp\ugfx_disp\ugfx\ while in the gdisp.h, for the inclusion of the right lld config, I modified the include in: #include "../ugfx/drivers/gdisp/SSD1306/gdisp_lld_config.h" and of course I have activated the various modules, in my case just the RAW_OS32 and the GDISP and the heap size. But still, I get a lot un undefined stuff which is for sure related to something very naive, but which still keep me blocked. The errors are all related to app1.c or app2.c which are not existing. I am not a deep pro of Atmel Studio, but I have used it a lot for C and C++ stuff, and converting from one to another. But I am not sure what is going on now. I also not completed the lld files, but what I see is not related to this. But anything incomplete shall not give an error, if I have understood how is written the code. I can attach the project file, which I think is better that posting some code lines here and there. Of course, the Atmel project file is related to my own PC path, so I will include only the sources with their hierarchical structure. Thanks to anyone. project_root.zip Edited September 24, 2017 by thexeno
Joel Bodenmann Posted September 25, 2017 Report Posted September 25, 2017 Hello @thexeno and welcome to the µGFX community I'd recommend you to have a look at our step-by-step guide for the Keil µVision IDE. It shows you exactly what you need to add. Of course, the dialogs are different but at the end of the day it's the same: You have lists of source files and inclusion paths. You can have a look at the guide here: https://wiki.ugfx.io/index.php/Using_Keil_µVision_5_MDK-ARM First of all, I'd recommend you not to enable GDISP until you are able to build your project. Try to take your working AtmelStudio project and just add µGFX as per the guide but do not enable GDISP. You are able to make sure that everything works anyway because the GOS module is always enabled. Therefore, you can build a fully working µGFX application without using the GDISP module. 12 hours ago, thexeno said: I've imported the gfx folder in the root of my project, and added all of its content. Then, in the compiler directories, I have added:C:\Users\[...]\Atmel\ugfx_disp\ugfx_disp\ugfx\srcC:\Users\[...]\Atmel\ugfx_disp\ugfx_disp\ugfx\ Adding the /src directory is not necessary. All files are being included automatically once you included gfx_mk.c and the path to the top-level directory. 12 hours ago, thexeno said: while in the gdisp.h, for the inclusion of the right lld config, I modified the include in: #include "../ugfx/drivers/gdisp/SSD1306/gdisp_lld_config.h" Don't do that. The LLD config file is being included by the driver itself automatically. Have a look at the Keil guide I linked above. You only need to add the path of the driver directory to the include path and then add the driver source file to your list of source files. No need to include or modify anything else. But again: Try without the GDISP module first. That will save you a lot of hassle. Enable GDISP once your project builds fine just with GOS. As a general rule: Once you need to modify µGFX library sources you're doing something wrong. If you'd like to write a guide for the Atmel Studio that we can put on the wiki that would be much appreciated.
thexeno Posted September 25, 2017 Author Report Posted September 25, 2017 Ok, I tried and I have understood better the philosophy too. But, there is something wrong. I try to achieve the same folder structure as in the example (which btw I had completely overlooked), and I get errors, but meaningful at least: With the following structure: In my explorer, I have this hierarchy: And the inclusion is: What makes me suspicious is that the library should have a default mode, even if in the gfxconf.h I have nothing uncommented, but still arise the error directive. Any other configuration and combination of includes, lead to the compiler to not find the includes or mismatching the folder hierarchy (so that the headers they need an additional "./" to work, and is wrong, since I must not edit the sources). Any clue?
Joel Bodenmann Posted September 26, 2017 Report Posted September 26, 2017 So far this looks good. As the error is explaining: You need to select an underlying operating system in your gfxconf.h. That is a mandatory setting as explained in both the documentation and by that error. Just enable RAW32 and you should be ready to go.
thexeno Posted September 26, 2017 Author Report Posted September 26, 2017 (edited) It worked, thanks. But, I had to copy the gfx_mk.c to the root of the project, and remove from the linker scope of course without eliminating the original file in the original position (in Atmel Studio by just dragging to the main.c) Otherwise it wasn't able to locate the gfx_mk.c and therefore knowing which .c file to link, because Atmel Studio was not able to locate the function of the gfxInit, but only the prorotype, which was able to find because in the main.c I put the gfx.h, as it should be. Edited September 26, 2017 by thexeno
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now