cancel
Showing results for 
Search instead for 
Did you mean: 

STemWin GUI_Init() crashed

mail2
Associate II
Posted on July 29, 2013 at 13:43

Hi,

I have Downloaded STemWin from the STM Website and i have tried to build a simple ''Hello World'' Application on my STM32F207 with KEIL 4.72a, but my Application goes into an infinite Loop in GUI_INIT().

I have found a hint onn the Segger Website, that GUI_Init() tries to acces the provided memory area with 8, 16 and 32 Bit accesses. This memory Area will be assigned by a call to GUI_X_Config() (provided by my code), but GUI_X_Config will never be called by GUI_Init().

I used the Library files STemWin520d_CM3_Keil.lib (without OS) and STemWin520d_CM3_OS_Keil.lib (with OS support). What can i do to find the problem?

Thanks

Martin

#stemwin
17 REPLIES 17
mail2
Associate II
Posted on August 01, 2013 at 15:44

Thank you for your help clive1,

As far as i understand the application note 4323 for STemWin this library is not locked for a specific STM32 part.

To the Register Values:

GUI_Init:

0x0800066C 4812      LDR      r0,[pc,#72]  ; @0x080006B8

-> R0 = 0xE0002000

0x0800066E B510      PUSH     {r4,lr}

0x08000670 6801      LDR      r1,[r0,#0x00]

-> R1 = 00000261

0x08000672 F0210101  BIC      r1,r1,#0x01

-> R1 = 00000260

0x08000676 6001      STR      r1,[r0,#0x00]

0x08000678 4810      LDR      r0,[pc,#64]  ; @0x080006BC

-> R0 = 40023000

0x0800067A 2101      MOVS     r1,#0x01

-> R1 = 00000001

0x0800067C 6081      STR      r1,[r0,#0x08]

0x0800067E 4910      LDR      r1,[pc,#64]  ; @0x080006C0

-> R1 = F407a5c2

0x08000680 6001      STR      r1,[r0,#0x00]

0x08000682 6800      LDR      r0,[r0,#0x00]

-> R0 = 00000000

0x08000684 490F      LDR      r1,[pc,#60]  ; @0x080006C4

-> R1 = b5e8b5cd

0x08000686 4288      CMP      r0,r1

0x08000688 D000      BEQ      0x0800068C

0x0800068A E7FE      B        0x0800068A

Martin

Posted on August 01, 2013 at 17:04

Add

  /* Enable CRC clock */

  RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_CRC, ENABLE);

Prior to calling the function.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Nickname12657_O
Associate III
Posted on August 01, 2013 at 17:14

Hi Clive,

Thank you. This is correct and mentioned in our documentation to call that function prior to use GUI routines.  I thought that the default examples are used, which is active by default. 

Cheers,

STOne-32.

mail2
Associate II
Posted on August 01, 2013 at 17:31

Yes, that's it.

And yes, after searching for ''CRC'' in the documentation, i found a footnote(!) on page 6 of AN4323 about it.

Thank you again clive1.

Martin

Posted on August 01, 2013 at 17:42

I'm working blind with the register data you provided, the library is locked to STM32 hardware with this, presumably the F2 and F4, I didn't check the location on the F1

I think the documentation would have been a lot stronger if the main() example explicitly included this code. That note on the diagram is totally lost.

http://www.st.com/web/en/catalog/tools/FM147/CL1794/SC961/SS1743/PF259225

0690X00000604rJQAQ.png

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
ekondratiev
Associate II
Posted on December 14, 2013 at 12:56

Hello!

I had the same problem with GUI_Init(). MCU is STM32F103RC and all ports and all necessary buses are enabled. Display driver is S1D13700.

And it was solved after I've put 'alignment' attribute to emWin memory buffer.

U32 aMemory[GUI_NUMBYTES / 4] __attribute__((aligned (4)));

But now emWin halts on GUI_DEVICE_CreateAndLink !!!

P.S. emWin library from KEIL software.

Posted on December 14, 2013 at 13:32

I checked the CRC unit address, it is the same for the F1

The other issue could be an error or issue related to the buffer, the library can generate ASCII error messages, but you need to create a call back. You should also be able to dump the memory address via a memory view window and observe the error there.

https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https%3a//my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/the%20STemWin%20used%20external%20SDRAM%20can%27t%20pass%20the%20GUI_Init&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3C...

Or it could be something different, but I'd need to see the code involved, and the registers.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
jiri
Associate II
Posted on February 02, 2015 at 10:03

Thank you, clive1, I also crashet on CRC.

 I have a problem with oriented data storage in memory. I use library GUIDRV_LIN_1. Horizontal line is saved as 0xFF, 0xFF, ... and I need as 0x80, 0x80, ... I wanted to correct the orientation of the display in memory. Unfortunately, the options listed in heder file GUIDRV_Lin.h  such as GUIDRV_Lin_OS_1_API, GUIDRV_Lin_OY_1_API, GUIDRV_Lin_OX_1_API, ... not defined in STemWin524b_CM4_xxx.xxx library. It is available settings for STemWin some  that affect how store data in memory? Thanks for the answer. Jiri Svabik