cancel
Showing results for 
Search instead for 
Did you mean: 

STemWIN + CooCox CoIDE

totti001
Associate II
Posted on September 03, 2013 at 10:47

Hello everybody,

I would like to try STemWIN library with CoIDE environment. I check that the examples only for the payed license tools. I try set up the CoiDE project but I've linker errors.

       [cc] c:/program files (x86)/gnu tools arm embedded/4.7 2012q4/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/bin/ld.exe: lcd_teszt.elf section `.ExtRAMData' will not fit in region `ram'

       [cc] c:/program files (x86)/gnu tools arm embedded/4.7 2012q4/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/bin/ld.exe: region `ram' overflowed by 403488 bytes

       [cc] ..\..\..\..\..\..\..\Users\tjo2bp\Downloads\STemWin_Library_V1.0.0\Libraries\STemWinLibrary520d\Lib\libstemwin520d_cm4_gcc.a(WM_Motion.o): In function `_AimDestinationXY':

       [cc] WM_Motion.c:(.text._AimDestinationXY+0x6e): undefined reference to `sqrt'

       [cc] ..\..\..\..\..\..\..\Users\tjo2bp\Downloads\STemWin_Library_V1.0.0\Libraries\STemWinLibrary520d\Lib\libstemwin520d_cm4_gcc.a(WM_Motion.o): In function `_MoveToNearestSnapPositionXY':

       [cc] WM_Motion.c:(.text._MoveToNearestSnapPositionXY+0x6a): undefined reference to `sqrt'

       [cc] GUIDEV_Perspective.c:(.text.GUI_MEMDEV_DrawPerspectiveX+0x168): undefined reference to `sqrt'

       [cc] ..\..\..\..\..\..\..\Users\tjo2bp\Downloads\STemWin_Library_V1.0.0\Libraries\STemWinLibrary520d\Lib\libstemwin520d_cm4_gcc.a(GUI_Valf.o): In function `_RoundHalfUp':

       [cc] GUIDEV_Perspective.c:(.text.GUI_MEMDEV_DrawPerspectiveX+0x13c): undefined reference to `sqrt'

       [cc] GUI_Valf.c:(.text._RoundHalfUp+0x20): undefined reference to `ceil'

       [cc] ..\..\..\..\..\..\..\Users\tjo2bp\Downloads\STemWin_Library_V1.0.0\Libraries\STemWinLibrary520d\Lib\libstemwin520d_cm4_gcc.a(GUIDEV_Perspective.o): In function `GUI_MEMDEV_DrawPerspectiveX':

       [cc] GUI_Valf.c:(.text._RoundHalfUp+0x36): undefined reference to `floor

Is anyone has a working project with CoIDE?

Thanks

9 REPLIES 9
Kevin Gordon
Associate II
Posted on November 09, 2013 at 18:18

Hello toth.janos

Have you succeeded with STemWIN + CooCox CoIDE

? May I have a copy of your example project folder? I may be contacted: gordonkevin117(at)gmail.com

Many thanks,

Kevin

Posted on November 09, 2013 at 18:58

At least two things going on there. First the absence of a floating point support library, and secondly with the linker script and the placement of data in the external RAM. You'd want to check the size allocated to various memory regions, and how those regions are initialized. Any data placed in RAM (statics) has to also be placed in flash and copied to RAM by the C runtime library during start up. If initialized data is too big to fit in either memory, you might need to rethink the strategy. ie Loading bitmaps, etc, from storage media.

I, personally, am not going to wade into the hot mess that is CooCox, I might be convinced to demonstrate compilation under GNU/GCC with Yagarto.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Kevin Gordon
Associate II
Posted on November 13, 2013 at 06:16

Hello Clive1,

I am interested in your comments. I visited

http://www.yagarto.org/

because I want to find the best system for me. The author of the page seems to try anything to encourage the visitor to move elsewhere. What is your opinion regarding emIDE? Next the writer sends the visitor to

https://launchpad.net/gcc-arm-embedded

which is the same toolchain used by coocox.org. Then he thanks the visitor for listening and sends them to

http://www.emb4fun.de/

which has a front page that states: ?Permanently under construction :o)?. Finally at the bottom of the yagarto page comes the link to:

http://sourceforge.net/projects/yagarto/

where the toolchain was last updated 22 Dec 2012. I then visited

http://www.emb4fun.de/

where deep in the archive I found ?GNU ARM Bare Metal Toolchain?, no mention of yagarto in the summary. Thank goodness on the page itself

http://www.emb4fun.de/archive/gabmt/index.html

the writer begins the installation. But? another attempt to divert the visitor to

https://launchpad.net/gcc-arm-embedded

. However I continued down the page and installed the tools and yagarto then compiled the test example. Success! Finally for support the writer sent the visitor to

http://embdev.net/forum/arm-gcc

which is a plus! But I then realised at the top of the page

http://www.emb4fun.de/archive/gabmt/index.html

 I had missed steps 1 and 3. Now I am on another archive page

http://www.emb4fun.de/archive/gdbserver/index.html

GDB Server which states that I need J-Link EDU

http://www.segger.com/cms/j-link-edu.html

to be able to proceed. In five days it will be delivered.

I am a little concerned that at ever step of the way the above sites tried to push me to the compiler/linker used by Coocox.org. I am definitely a beginner needing your help.

I have successfully compiled and linked my stemWin project: Note that in coIDE I have set the compiler settings for FPU to ?FPU Hard?:

GCC HOME: C:\CooCox\GNU Tools ARM Embedded\4.7 2013q3\bin

compile:

    [mkdir] Created dir: C:\CooCox\CoIDE\workspace\emWinExample1\emwinexample1\Debug\bin

    [mkdir] Created dir: C:\CooCox\CoIDE\workspace\emWinExample1\emwinexample1\Debug\obj

       [cc] 8 total files to be compiled.

       [cc] arm-none-eabi-gcc -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -Wall -ffunction-sections -g -O0 -c -DSTM32F407VG -DSTM32F4XX -DUSE_STDPERIPH_DRIVER -D__ASSEMBLY__ -D__FPU_USED -IC:\CooCox\CoIDE\workspace\emWinExample1\cmsis_boot -IC:\CooCox\CoIDE\workspace\emWinExample1\cmsis_lib -IC:\CooCox\CoIDE\workspace\emWinExample1 -IC:\CooCox\CoIDE\workspace -IC:\CooCox\CoIDE\workspace\emWinExample1\inc -IC:\CooCox\CoIDE\workspace\emWinExample1\cmsis -IC:\CooCox\CoIDE\workspace\emWinExample1\cmsis_lib\include -IC:\CooCox\CoIDE -IC:\CooCox\CoIDE\workspace\emWinExample1\Common C:\CooCox\CoIDE\workspace\emWinExample1\GUIConf.c C:\CooCox\CoIDE\workspace\emWinExample1\LCDConf.c C:\CooCox\CoIDE\workspace\emWinExample1\cmsis_boot\startup\startup_stm32f4xx.c C:\CooCox\CoIDE\workspace\emWinExample1\main.c C:\CooCox\CoIDE\workspace\emWinExample1\cmsis_lib\source\stm32f4xx_rcc.c C:\CooCox\CoIDE\workspace\emWinExample1\cmsis_lib\source\stm32f4xx_gpio.c C:\CooCox\CoIDE\workspace\emWinExample1\cmsis_boot\system_stm32f4xx.c C:\CooCox\CoIDE\workspace\emWinExample1\GUI_X.c

       [cc] Starting link

       [cc] arm-none-eabi-gcc -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -Wall -g -nostartfiles -Wl,-Map=emWinExample1.map -O0 -Wl,--gc-sections -LC:\CooCox\CoIDE\configuration\ProgramData\emWinExample1 -Wl,-TC:\CooCox\CoIDE\configuration\ProgramData\emWinExample1/arm-gcc-link.ld -g -o emWinExample1.elf ..\obj\GUIConf.o ..\obj\LCDConf.o ..\obj\startup_stm32f4xx.o ..\obj\main.o ..\obj\stm32f4xx_rcc.o ..\obj\stm32f4xx_gpio.o ..\obj\system_stm32f4xx.o ..\obj\GUI_X.o -L..\..\.. -lstemwin522_cm4_gcc

Program Size:

      text       data          bss          dec          hex      filename

     31196      20         68204      99420      1845c     emWinExample1.elf

BUILD SUCCESSFUL

Total time: 3 seconds

I have five excellent new books on embedded systems. However at this time I am ignorant about memory. ?

the linker script and the placement of data in the external RAM? The word ?external? has caused my 72 year old brain to sunder. I am using a ST32F407VG discovery board (only) with a DM-LCD35RT screen with a display controller SSD2119 (standard add-on to embest base board). I do not have a arm-gcc-link.ld file as I have:

0690X00000604uJQAQ.png

That is about it. The main.c is a small string example for testing. To complete here is one of the greatest marketing spins of all time:

?This library is a professional graphical stack library, enabling the building up of Graphical User Interfaces (GUIs) with any STM32, any LCD/TFT display and any LCD/TFT controller, taking advantage of STM32 hardware accelerations whenever possible.?

Just a little smile while thinking of the modern world.

Many thanks,

Kevin.

Posted on November 13, 2013 at 08:36

Your post deserves a long response, but it's the middle of the night here, so I'll keep it brief and come back later.

I've found GNU/GCC 4.7.2 quite serviceable for building apps on the STM32F429I-DISCO and prior boards, along with the 4.6.x before it. I'm using the command line with MAKE for both STM32 M3/M4 targets, and ATMEL ARM9 ones. The compiler, although perhaps a year old is pretty agnostic to the target chip (has intrinsic support for M3 and M4 going way back), something the IDE's seem to have keep iterating around to build templates and configurations for. CodeSourcery/Mentor has some newer builds I'm sure, but they had nag screens, and their own MAKE. I'd use Eclipse with them, and then swapped out the tool chain for the Yagarto ones.

This is the USB VCP example I put together for the STM32F429I-DISCO

https://drive.google.com/file/d/0B7OY5pub_GfIYjU3QTJtWVFHNE0/edit?usp=sharing

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Kevin Gordon
Associate II
Posted on November 14, 2013 at 09:49

Hello clive1. Thank you for your reply. I am most interested in the stm32f429i-disco but no supplies in nz until next year (76 days!).  I look forward to your reply.

Regards,

Kevin

lorenzo2
Associate II
Posted on January 31, 2014 at 10:34

Hi,

I have the same problem. When i compile, compiler show me this error:

C:\TechKnow\STemWin_GUI_lib\STemWin_Library_V1.1.1\Libraries\STemWinLibrary522\Lib\libSTemWin522_CM4_GCC.a(WM_Motion.o): In function `_AimDestinationXY':

WM_Motion.c:(.text._AimDestinationXY+0x6e): undefined reference to `sqrt'

C:\TechKnow\STemWin_GUI_lib\STemWin_Library_V1.1.1\Libraries\STemWinLibrary522\Lib\libSTemWin522_CM4_GCC.a(WM_Motion.o): In function `_MoveToNearestSnapPositionXY':

WM_Motion.c:(.text._MoveToNearestSnapPositionXY+0x6a): undefined reference to `sqrt'

collect2.exe: error: ld returned 1 exit status

I have this error only when i use function of WM_MOTION like WM_MOTION_Enable().

I've already link the STemWin library and DSP_Lib libarm_cortexM4lf_math.a and set fpu to hard but not change.

I try to include <math.h> but the resutl is the same.

I use Eclipse Kepler with GCC ARM 4.8 on STM42F429discovery

Thaks.

Lorenzo

 

frankmeyer9
Associate II
Posted on January 31, 2014 at 11:02

I try to include <math.h> but the resutl is the same.

 

No wonder, your errors are linking errors.

I'm not experienced with Coocox, but you need to add ''-lm'' to the linker flags, to actually link in the math library.

Problems with the FPU and soft/hard might appear later, but this is not yet the case ...

lorenzo2
Associate II
Posted on January 31, 2014 at 11:27

Thanks for fast reply.

I'm not using coocox ide, im using Eclipse + ARM GCC

I add ''-lm'' to linker but nothing change.

arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -ffunction-sections -fdata-sections -Wall -g -T ''C:/Users/Laboratorio/Eclipse_Workspace/SDC_p1.0.0\\STM32F429ZI_FLASH.ld'' -Xlinker --gc-sections ''-LC:\\TechKnow\\STM32F4_library\\STM32F429I-Discovery_FW_V1.0.1\\Libraries\\CMSIS\\Lib\\GCC'' ''-LC:\\TechKnow\\STemWin_GUI_lib\\STemWin_Library_V1.1.1\\Libraries\\STemWinLibrary522\\Lib'' -Wl,-Map,SDC_p1.0.0.map -lm -o SDC_p1.0.0.elf ''

[...](all file compile)

C:\TechKnow\STemWin_GUI_lib\STemWin_Library_V1.1.1\Libraries\STemWinLibrary522\Lib\libSTemWin522_CM4_GCC.a(WM_Motion.o): In function `_AimDestinationXY':

WM_Motion.c:(.text._AimDestinationXY+0x6e): undefined reference to `sqrt'

C:\TechKnow\STemWin_GUI_lib\STemWin_Library_V1.1.1\Libraries\STemWinLibrary522\Lib\libSTemWin522_CM4_GCC.a(WM_Motion.o): In function `_MoveToNearestSnapPositionXY':

WM_Motion.c:(.text._MoveToNearestSnapPositionXY+0x6a): undefined reference to `sqrt'

collect2.exe: error: ld returned 1 exit status

It can be a linker script problem? I use the .ld file there is in the STM32F429discovery example and a found section:

  /* Remove information from the standard libraries */

  /DISCARD/ :

  {

    libc.a ( * )

    libm.a ( * )

    libgcc.a ( * )

  }

If i compile with this the error is:

c:/devtools/appli/gnu_arm/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/armv7e-m/fpu\libm.a(lib_a-w_sqrt.o): In function `sqrt':

w_sqrt.c:(.text.sqrt+0x9e): undefined reference to `__errno'

w_sqrt.c:(.text.sqrt+0xa8): undefined reference to `__errno'

collect2.exe: error: ld returned 1 exit status

if i delete libm.a ( * ) the error is

C:\TechKnow\STemWin_GUI_lib\STemWin_Library_V1.1.1\Libraries\STemWinLibrary522\Lib\libSTemWin522_CM4_GCC.a(WM_Motion.o): In function `_AimDestinationXY':

WM_Motion.c:(.text._AimDestinationXY+0x6e): undefined reference to `sqrt'

C:\TechKnow\STemWin_GUI_lib\STemWin_Library_V1.1.1\Libraries\STemWinLibrary522\Lib\libSTemWin522_CM4_GCC.a(WM_Motion.o): In function `_MoveToNearestSnapPositionXY':

WM_Motion.c:(.text._MoveToNearestSnapPositionXY+0x6a): undefined reference to `sqrt'

collect2.exe: error: ld returned 1 exit status

frankmeyer9
Associate II
Posted on January 31, 2014 at 13:24

I'm not using coocox ide, im using Eclipse + ARM GCC

 

I guess I mixed this up with the previous poster ...

c:/devtools/appli/gnu_arm/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/armv7e-m/fpu\libm.a(lib_a-w_sqrt.o): In function `sqrt':

 

w_sqrt.c:(.text.sqrt+0x9e): undefined reference to `__errno'

 

w_sqrt.c:(.text.sqrt+0xa8): undefined reference to `__errno'

 

collect2.exe: error: ld returned 1 exit status

Looks like a library problem.

Admittedly I don't have much experience with your toolchain combination.

But ''

undefined reference to __errno

'' makes me think you linking against the wrong library, or miss something.

The variable ''

errno

'' is a common way for several clib functions to return specific errors to the caller. Usually, it is defined in the header ''errno.h'' as ''

extern int errno

''.

Perhaps including ''

errno.h

'' solves your problem.

PS: freaking forum software ... !!!!