Jump to content

cpu20

Members
  • Posts

    130
  • Joined

  • Last visited

Posts posted by cpu20

  1. - As the project build successfully your project is probably set up correctly.

    - This board currently only has board files using ChibiOS. This means that if you want to go BareMetal (no underlying RTOS) you will have to write the board files yourself.

    - If you are planning to use ChibiOS you will have to use the MakeFile approach as it is the only viable option to get ChibiOS working in an Eclipse-like environment. There is project available in the downloads section that can easily be imported in Eclipse to get started with this approach:

    - Going BareMetal means you will have to rewrite the board files using the HAL-libraries or self written libraries. Once they are written you should put them in the include folder of your project.
    You also need to add the STM32LTDC and STMPE811 driver to the includes and source location of your project. The procedure of including the drivers is described in the Eclipse guide.

    - The demo in the applications folder can be used by copying all the .c files in your source folder and all the .h files in your include folder. Or if you are using a MakeFile you can just point the GFXDEMO variable to the demo location and it will be included for you.
    But it is important that you first get a basic program running printing some text on the display or something before playing with the demos.

  2. That's my bad. I forgot to mention that in the "userfonts.h" file I changed the include to:

    #include "../rsc/DejaVuSans16.c"

    Normally you don't have to do this when you put the rsc folder inside the inc folder. But for some reason Eclipse wasn't including the file correctly then. I have no idea why though...

  3. First you'll have to copy and paste the GOS settings from the original gfxconf.h. This is because the studio does not generate these.

    ///////////////////////////////////////////////////////////////////////////
    // GOS - One of these must be defined, preferably in your Makefile       //
    ///////////////////////////////////////////////////////////////////////////

    So copy everything from the original gfxconf.h below this GOS header (and above the GDISP header) and copy it into your new gfxconf.h file.

    Next for using font stuff you must add uGFX/src/gdisp/mcufont to your include paths in your project settings.

    Move the rsc folder (containing the font file DejaVuSans16.c) to the root directory of your project and also add it to your include paths.

    Result_studio.thumb.png.a543aa4e92a5828c4dddbda9305f40db.png

    This should be the result. Don't forget to add HAL_Init(); to the beginning of your main program!

    gfxconf.h

  4. Was your backlight not working from the start? Because that needs to be fixed before you can see anything draw on the screen.

    Looking at your previous post you connected the backlight pin to PD12 (TIM4_CH1)? If I am not mistaken you should change the following in your code:

    static const PWMConfig pwmcfg =
    {
     100000,   // frequency
     100,      // period
     NULL,     // callback
     {
      {PWM_OUTPUT_ACTIVE_HIGH, 0},
      {PWM_OUTPUT_DISABLED, 0},
      {PWM_OUTPUT_DISABLED, 0},
      {PWM_OUTPUT_DISABLED, 0}
     },
     0,        // cr2
     0,        // dier
    };
    
    pwmStart(&PWMD4, &pwmcfg);
    pwmEnableChannel(&PWMD4, 1, 100);

    If this is set up correctly you should see the backlight come on after the gfxInit() in your code.

  5. 7 hours ago, blacktronics said:

    Okay, sorry to bother you again

    No problem, happy to help anywhere I can.

    All the .h files generated by µGFX studio should be copied into your inc dir. However the gui.c file as well as the rsc folder should be copied into your src folder.
    The compiler is also saying there are some problems in your gfxconf.h. Maybe something went wrong when generating the file in the studio. If changing what I said here does not work, post your gfxconf.h here and I'll take a look where there might be a problem.

  6. I've looked a little bit further into it and it seems there is an incompatibility between the HAL-driver used by SW4STM32 and the stm32f746_discovery_sdram.c file used for the board.
    The problem is temporarily fixed by manually editing the inclusions:

    Use this to get started with and I'll look into fixing the issue properly when I have more time. You will see that when initializing there is some glitching on the screen which gets resolved after the initialization.

    To use the project just do Import -> Existing project into workspace.

  7. 4 hours ago, blacktronics said:

    I am completely stuck, really close to setting stuff on fire, send help.

    No need for a fire here :P We are here to help you!

    4 hours ago, blacktronics said:

    At this step i am not quite sure which board files to include, here is what I did though: 
    I copied the following files from boards/STM32F746-Discovery to my inc folder:

    You did everything correctly so far. But here we'll have to take another approach as all the board files for the STM32F746-DISCO are already written and ready to be used. So first there is no need to do this:

    4 hours ago, blacktronics said:

    I also copied gmouse_lld_FT5336_board.h to uGFX/drivers/ginput/touch/FT5336 and deleted gmouse_lld_FT5336_board_template.h

    Normally you don't mess with the files in the library itself. You should keep the µGFX library untouched and copy any board files needed to your inc folder. But!!!! don't do that yet in this case!

    Here it is much easier to just go back to Project -> properties -> C/C++ General -> Paths and Symbols -> Includes. Here you should add the folder /boards/STM32F746-Discovery for all languages again.
    Doing this will include both the gmouse_lld_FT5336_board.h and board_STM32LTDC.h into your project.

    One tip I was planning to add in the tutorial:

    Easily_exclude.thumb.png.eabf57e95479d4df35a4c4c4c52f3b90.png

    If you want to easily exclude files from your build without having to constantly go back to the filter, you can select them in your Project Explorer, right click and choose Resource Configurations -> Exclude from Build...
    That will give you this dialog:

    Easily_exclude2.png.458197161801a8382f152da64d9e4085.png

    Deselect all the check boxes here and click OK. The files should now be included in your project.

    If you want to exclude them again do the exact same thing, but check all the check boxes in the "Exclude from build" dialog.

    I'll explain it here with the method from the guide but you can also use the above method to include the files. So next go back to Project -> properties -> C/C++ General -> Paths and Symbols -> Source Location tab. First delete the boards entry form the filter list. Now also include the boards/STM32F746-Discovery folder. Here we will have to add a filter also because there are files SW4STM32 already generated that are also in the folder and keeping them both will give conflicts.
    So in the filter exclude everything in the boards folder except for the following files in the STM32F746-Discovery folder:
    - stm32f7_i2c.c
    - stm32f746g_discovery_sdram.c
    - stm32f746g_raw32_system.c
    - stm32f746g_raw32_ugfx.c

    Now you should be able to enable #define GFX_USE_GDISP without getting compiler errors.

    Let us know if this doesn't work out!

    Edit: One thing I didn't see is if you included the driver folders (STM32LTDC and FT5336) to your Includes.

  8. In your makefile you specify OPT_CPU = stm32m1, but this should be stm32m3. In your main file you do not need to include:

    #include "board_SSD1289.h"
    #include "ginput_lld_toggle_board.h"

    What version of the ugfx library are you using?

  9. 2 hours ago, steved said:

    Your FSMC initialisation doesn't look quite right; for the SSD1963 I had the following as your lines 77, 78:

    
    		/* FSMC is an alternate function 12 (AF12) */
    		palSetBusMode(&busD, PAL_MODE_ALTERNATE(12));
    		palSetBusMode(&busE, PAL_MODE_ALTERNATE(12));

     

    In this case I don't think that will help much as he is using a STM32F1xx target and it only has one alternate function.

    @ep.hobbyiest You should keep the second and third change if you changed the pin configurrations in your application.
    That error you are getting is a problem though. It could indicate that something is wrong with your configuration and that not all the correct files are included.
    Are you using the Makefile approach or the 'single file inclusion mechanism'? And what IDE are you using?

  10. 3 hours ago, ep.hobbyiest said:

    there are two CS pins and names are as CS and F_CS.  Here i am confused.

    You must use the CS-pin. the F_CS is acturally T_CS which is used for the touchscreen of the display.

    As for your code there is an example in boards/addons/gdisp for your driver which has a slightly different configuration than yours. Maybe try those settings out also and see if it gives any difference?

  11. 2 hours ago, Mad River said:

    Have you finished testing the uGFX in Eclipse?

    I am getting a wierd behaviour from my Eclipse.

    The IDE is graying out code that should be "visible". The wierd thing is that the IDE is doing it to some parts and not for others.

    First note that this is a build in function of Eclipse and it has nothing to do with how the project is compiled.
    What Eclipse does is look at the paths defined in 'properties -> C/C++ General -> Paths and Symbols -> Includes' under the GNU C language tab. Eclipse will look at every define found in the files located at these paths. So if the path where your 'gfxconf.h' is located is defined here this should work fine.
    If not maybe try indexing the project with 'Index -> Rebuild'.

  12. gdispSetBacklight(50);  // set backlight to 50%
    gdispSetContrast(50);   // set contrast to 50%

    You can also change brightness and contrast at runtime with these functions.

    Good to see you got it working!!!

  13. 8 hours ago, Joel Bodenmann said:

    Our community member and IDE expert @cpu20 is currently in the process of writing an official & very detailed guide on how to add the µGFX library to an existing eclipse project. I'm sure he could help you out here already if you have problems doing just what the guide linked above explains and demonstrates.

    I am not really an expert, more like a hobbyist ;) The guide is coming soon.

    8 hours ago, Joel Bodenmann said:

    In general: Just don't add any files you're not explicitly being told to add.

    Exactly, the only thing you should add is the 'gfx_mk.c' and the drivers you want for your project. So first go back to the initial stat where you excluded everything except that file. Now into your project properties go back to 'Paths and Symbols -> Source location' and edit the uGFX filter you've added.

    Remove_from_filter.png.be45421c93a492bf6837a82df5d80778.png

    Here remove the 'drivers/' entry.

    Now choose 'Add Multiple' again and exclude everything in the 'drivers' folder except for your driver like this:

    Exclude_all_but_ST7656.thumb.png.837d212b74c4a2905d5357ec5377cf3b.png

    Don't forget to exclude ginput, gadc,...

    The last step to get it working is to add the folder 'drivers/gdisp/ST7565' to your include paths:

    Include_driver_directory.png.e579cb0c6990d106a0e563b95cfa7c43.png

    Do this for all three languages!

    driver_active.thumb.png.86e059edc2ad929fafe677d7a30912ae.png

    This should be the result in your uGFX directory.

    What you also must do is copy your own made board file for the ST7565 to your includes directory.

    Add_board_file.thumb.png.9cb6195b84a898ae00e91f74cdcb4148.png

    This should compile and work as expected. Note that it doesn't compile for me because I haven't setup GOS correctly.

  14. 2 hours ago, Mad River said:

    I am using version 2.7, which I downloaded from the uGFX official site. isn't it the lastest version?

     

    The 2.7 version is the stable release. To have the latest version of µGFX you should use the git repository. You can find more information about this on this wiki page.

  15. @Joel Bodenmann thanks for those recources!!! They are really usefull!
    The only thing I can't get working is the generation of the .map file using the makefile approach.

    When I add the flags: -Map=filename.map to the linker flags in my 'single file inclusion mechanism' projects it generates the .map file as expected. But adding -Map=filename.map to the LDFLAGS in the makefile throws me an unrcognized option. Any idea how to solve that?

  16. In your provided screenshots you did everything correctly to include µGFX into your project. The conflicts you are seeing with the colors Red, Green and Blue are probably due to a redefinition in your application. Can this be resolved by renaming them in your application?
    Are those the only problems you are still having when compiling with IAR? Because you should be really close now to get a successful build.

×
×
  • Create New...