Debug/Release options

Discussions and support about ChibiStudio, the free development environment for ARM.
Tabulous
Posts: 420
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 1 time
Been thanked: 10 times

Debug/Release options

Postby Tabulous » Tue Aug 29, 2017 1:03 pm

Is it possible to pass build symbols to the make file and thus select different scatter file and compiler options ?

As you know debugging with optimization is not really good. I need to debug on a 512KB flash part, and then for release version build for 256KB with optimization.

User avatar
Giovanni
Site Admin
Posts: 10213
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 212 times
Been thanked: 197 times
Contact:

Re: Debug/Release options

Postby Giovanni » Tue Aug 29, 2017 1:34 pm

You could make 2 different Makefiles and 2 build configurations in Eclipse, the result is the same.

See the new multi-target demo for an example of how to do that, under /hal/STM32/USB_CDC.

Giovanni

Tabulous
Posts: 420
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 1 time
Been thanked: 10 times

Re: Debug/Release options

Postby Tabulous » Tue Aug 29, 2017 1:50 pm

where is "/hal/STM32/USB_CDC" just down load the latest version and cant see it

User avatar
Giovanni
Site Admin
Posts: 10213
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 212 times
Been thanked: 197 times
Contact:

Re: Debug/Release options

Postby Giovanni » Tue Aug 29, 2017 2:11 pm

You need to checkout the repository trunk, makefiles have been improved.

Giovanni

User avatar
FXCoder
Posts: 53
Joined: Sun Jun 12, 2016 4:10 am
Location: Sydney, Australia
Has thanked: 7 times
Been thanked: 11 times

Re: Debug/Release options

Postby FXCoder » Wed Aug 30, 2017 7:38 am

It's in trunk /testhal/STM32/USB_CDC

If you are using Chibistudio RoccoMarco did a nice article on using Tortoise SVN to keep in sync with trunk.

http://www.playembedded.org/blog/en/201 ... n-chibios/

Tabulous
Posts: 420
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 1 time
Been thanked: 10 times

Re: Debug/Release options

Postby Tabulous » Wed Aug 30, 2017 11:43 am

Changing to the trunk would be a task at the moment as i've got afew bits in lower level drivers changed.

All i was thinking was maybe :

have too build configs in eclipse, i.e. Debug and Release.

Each one as different # Symbols of which are passed the makefile and then i could

Code: Select all

# Compiler options here.
ifeq ($(USE_OPT),)
  ifeq ($(RELEASE_BUILD),1)
    USE_OPT = -Os -ggdb -fomit-frame-pointer -falign-functions=16
  else
    USE_OPT = -O0 -ggdb -fomit-frame-pointer -falign-functions=16
  endif
endif

User avatar
Giovanni
Site Admin
Posts: 10213
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 212 times
Been thanked: 197 times
Contact:

Re: Debug/Release options

Postby Giovanni » Wed Aug 30, 2017 1:02 pm

Environment variables are passed to make, you may use that.

Giovanni

Tabulous
Posts: 420
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 1 time
Been thanked: 10 times

Re: Debug/Release options

Postby Tabulous » Wed Aug 30, 2017 3:25 pm

Giovanni wrote:Environment variables are passed to make, you may use that.

Giovanni


please forgive my ignorance, but where in eclipse would i add these ?

C/C++ Build->Build Variables ?
C/C++ Build->Environment ?
C/C++ General->Paths and Symbols ?

Not sure you see

Tabulous
Posts: 420
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 1 time
Been thanked: 10 times

Re: Debug/Release options

Postby Tabulous » Wed Aug 30, 2017 4:05 pm

Its ok i have it working now :-)


Return to “ChibiStudio”

Who is online

Users browsing this forum: No registered users and 2 guests