cancel
Showing results for 
Search instead for 
Did you mean: 

Blank Screen when STEMWIN code generated from CubeMx

AMoha.81
Associate II

Hi,

I am having this issue with STM32F469 and 769 Discovery boards. I am trying to create a project in CubeMx with ADC enabled and a STEMWIN Window created using GUIBuilder.

When I try to generate this code and run it in SW4STM32, the Discover screen stays blank. This issue has occurred for both 469 and 769 Discovery boards.

I am able to run the sample graphics code for these boards, but not code that I generated.

Can someone help me figure this out. I am attaching the .ioc file and the .zip of generated code as well.

Here is the log for this run:

Open On-Chip Debugger 0.10.0-dev-00015-gaaf1808 (2018-11-13-13:07)

Licensed under GNU GPL v2

For bug reports, read

http://openocd.org/doc/doxygen/bugs.html

srst_only separate srst_nogate srst_open_drain connect_assert_srst

Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD

adapter_nsrst_delay: 100

adapter speed: 1800 kHz

Info : clock speed 1800 kHz

Info : STLINK v2.1 JTAG v29 API v2 M18 VID 0x0483 PID 0x374B

Info : using stlink api v2

Info : Target voltage: 3.245563

Info : Stlink adapter speed set to 1800 kHz

Info : STM32F769NIHx.cpu: hardware has 8 breakpoints, 4 watchpoints

Info : Stlink adapter speed set to 1800 kHz

adapter speed: 1800 kHz

target halted due to debug-request, current mode: Thread 

xPSR: 0x01000000 pc: 0x0800b020 msp: 0x20080000

Info : Stlink adapter speed set to 4000 kHz

adapter speed: 4000 kHz

** Programming Started **

auto erase enabled

Info : flash size probed value 2048

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x20000084 msp: 0x20080000

wrote 262144 bytes from file Debug/Test_769.elf in 3.426961s (74.702 KiB/s)

** Programming Finished **

** Verify Started **

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000002e msp: 0x20080000

target halted due to breakpoint, current mode: Thread 

xPSR: 0x61000000 pc: 0x2000002e msp: 0x20080000

verified 146156 bytes in 0.110707s (1289.263 KiB/s)

** Verified OK **

** Resetting Target **

Info : Stlink adapter speed set to 1800 kHz

adapter speed: 1800 kHz

shutdown command invoked

6 REPLIES 6
Mon2
Senior III

Hi @AMoha.8​. Here is what we know about this topic but using TouchGFX (no knowledge on STEMWin):

1) CubeMX + TouchGFX + assorted kit integration including your target STM32F769 is broken. Based on your feedback and others, STM32F469 Discovery is in the same boat. They are being worked on for a proper resolution.

We have posted working procedures on how to target the STM32F429 kit using IAR / SW4STM32 tools on this forum with a step by step process.

Clark Sann has posted a similar documentation to target the STM32F746G Kit using SW4STM32.

Keil is just broken with no resolution at this time of writing.

After investing 8+ hours of debugging yesterday, trying to fix the same documentation using the STM32F769I-DISCOVERY kit. Getting closer but not working yet.

Now onto positive news:

1) If you launch the TouchGFX V4.10.0 tool as a stand alone -> select the STM32F769I-DISCOVERY kit -> the GUI designer with your custom graphics will work fine.

2) The wizard works correctly if TouchGFX is used in stand alone mode BUT if you then launch the CUBEMX IOC file that is auto-generated, the entire code base will start to break. For example, do this and then select Generate Code inside of CubeMX and return back to the TouchGFX tool to Run on the Target and the same GUI screen + LCD init code will be broken.

That is where we are at as of this writing. Hoping to resolve this soon and certainly do not wish to invest a month of debugging like was done with the STM32F429I-DISC1 kit but it was a steep learning curve (at least for us).

Summary: Many users are reporting that they prefer TouchGFX (free) tool over STEMWIN but that could be just personal chiice and experience. Being that the tool, without restrictions is free, you may be interested in a proper review of the same tool.

Good luck and post back your results if you do get this all operational for future readers.

PS: The debug approach we recommend is that you use TouchGFX to create a working story board with desired graphics -> then work to fix the IOC related issues (inside of CubeMX) to get this all to stitch together properly). It is a challenge but will work with the proper fixes. Lots of patience and coffee is required.

https://community.st.com/s/question/0D50X0000A4pPgPSQU/stm32f2429-disc1-configuration-with-touchgfx-cubemx-50

https://community.st.com/s/question/0D50X0000AAHSjZSQX/how-to-get-a-working-touchgfx-project-working-with-stm32f746gdisco-board-and-sw4stm32

AMoha.81
Associate II

Hi @Mon2​ ,

Thank you for the reply. I did try standalone TouchGFX as well, but ended up using STemWin as my graphics requirements are pretty simple. I still need you help to proceed, but it should be simpler for you to guide me. Here are my requirements:

  1. I just want one graphics screen with two text-boxes and two graphs
  2. I want to read two analog signals from two ADCs and plot them in the text box and graphs.
  3. The ADC read cycle and the screen update cycle can be as slow as 10 times per second.

Based on your response I have started with a working StemWin32 GUI code that displays "Hello World. I have modified this code to add the text boxes and graphs in the SW4STM32 environment successfully.

The next step is to integrated ADC functionality in this code. Can you guide me to which mode I need to use the ADC and how do I work on reading the ADC and updating the graphics screen.

For the sake of simplicity, let us take the Hello World example I have attached with this post. What do I need to change to this so that I display a single ADC value instead of "Hello World" in the text box.

Mon2
Senior III

Hi @AMoha.8​ . Openly have zero knowledge with STemWin. We had TouchGFX working without reading any documentation when first testing the assorted GUI tools.

Any chance you can attempt your project with TouchGFX (4.10.0 = free download)?

See here if you can on graphs & TouchGFX:

https://touchgfx.zendesk.com/hc/en-us/community/posts/115002235185-Plot-Graph

Perhaps someone else can comment on the use of the STemWin and graphs?

Still working on this and put in some more time today / tomorrow. Really wanting to conquer at least the STM32F769I-DISCOVERY kit for a proper resolution but cannot afford to waste too much time. I think we are getting closer...

Bye for now.

AMoha.81
Associate II

Thank you @Mon2​ . I will try TouchGFX with the options given in the link you pointed. Just a question. How do we specify which board/display etc we are using if we use the code given in the following link.

https://touchgfx.zendesk.com/hc/en-us/community/posts/115002235185-Plot-Graph

Mon2
Senior III

Hi @AMoha.8​ , suggest for you to close all applications -> locate the TouchGFX tool (version 4.10.0) and launch it. Create a new project by Selecting the Application Template (left side of the screen and CHANGE it to one of the kits you own). If your kit is not on the list then this becomes a more difficult of a challenge. Once you select the CHANGE -> an assorted view of the ST kits will be shown (be sure to scroll to the right to see them all) -> proceed to select your kit -> make sure the frame for your KIT is in BLUE -> then SELECT -> the wizard will proceed to import some templates from the internet and then offer you a blank canvas.

Each kit is unique so be sure not to confuse a -DISC1 with -DISCOVERY, etc. Learned this the hard way already.

Proceed to create your basic GUI (only to warm up to the tools) -> then select Generate Code -> Run on Target and/or Simulator -> does your GUI appear correctly? It should.

In summary, noting that this stand alone tool is working quite well and it is the CubeMX integration that breaks the working code. Once you have this working, proceed to review the github code and alter manually by reviewing the source code in minor steps. This stand alone option is based on a gcc compiler (not IAR, not Keil nor Atollic and not SW4STM32). But it works.

Curious, which kit are you working with now for this project?

Bye for now.

AMoha.81
Associate II

Thanks @Mon2​ .

I am working on it step by step. Once I have the graphics under control I will seek your help in getting the ADCs to work as well 🙂