igor 163 Posted September 16, 2014 Share Posted September 16, 2014 Tiva/Stellaris programs were compiled with optimization -Os in Energia E0012. (Optimize for size). In Energia E0013 optimization is turned off for Tiva/Stellaris and CC3200. (-O0) How do I turn optimization back on in Energia E0013? I have been working on a Arduino/Energia library which has a timing critical interrupt handler. Of course there is the #pragma route to controlling optimization. But is there a way in the IDE, or in preferences.txt, is #pragma the preferred method. On a somewhat related note, are there any release notes for the new version (which might cover changes and how to handle them)? (e.g., where I could have found out about the change in optimization). I have looked around a bit and haven't found any kind of list of what is new. http://www.energia.nu/release.html only goes up through version 12. The readme on github doesn't even mention the CC3200 https://github.com/energia/Energia/blob/master/ReadMe.md After I had problems generating a listing in the new release I did discover that debugging information is turned off by default, and there is a new option for turning debugging information on/off (in File - Preferences). But haven't found anything similar for optimization. Thanks Quote Link to post Share on other sites
spirilis 1,265 Posted September 16, 2014 Share Posted September 16, 2014 Oh geez, I know @@energia had optimization turned off for testing the CC3200 port but he intended to turn it on for the release. Will have to confirm this later... Sent from my Galaxy Note II with Tapatalk 4 Quote Link to post Share on other sites
spirilis 1,265 Posted September 16, 2014 Share Posted September 16, 2014 Confirmed... Blink sketch with TM4C123: [/home/ebrundic/energia-0101E0013/hardware/tools/lm4f/bin/arm-none-eabi-g++, -c, -O0, -w, -fno-rtti, -fno-exceptions, -ffunction-sections, -fdata-sections, -mthumb, -mcpu=cortex-m4, -mfloat-abi=hard, -mfpu=fpv4-sp-d16, -fsingle-precision-constant, -DF_CPU=80000000L, -MMD, -DARDUINO=101, -DENERGIA=13, -I/home/ebrundic/energia-0101E0013/hardware/lm4f/cores/lm4f, -I/home/ebrundic/energia-0101E0013/hardware/lm4f/variants/stellarpad, /tmp/build8593810888659232949.tmp/Blink.cpp, -o, /tmp/build8593810888659232949.tmp/Blink.cpp.o] [/home/ebrundic/energia-0101E0013/hardware/tools/lm4f/bin/arm-none-eabi-gcc, -c, -O0, -w, -ffunction-sections, -fdata-sections, -mthumb, -mcpu=cortex-m4, -mfloat-abi=hard, -mfpu=fpv4-sp-d16, -fsingle-precision-constant, -DF_CPU=80000000L, -MMD, -DARDUINO=101, -DENERGIA=13, -I/home/ebrundic/energia-0101E0013/hardware/lm4f/cores/lm4f, -I/home/ebrundic/energia-0101E0013/hardware/lm4f/variants/stellarpad, /home/ebrundic/energia-0101E0013/hardware/lm4f/cores/lm4f/wiring_analog.c, -o, /tmp/build8593810888659232949.tmp/wiring_analog.c.o] [/home/ebrundic/energia-0101E0013/hardware/tools/lm4f/bin/arm-none-eabi-gcc, -c, -O0, -w, -ffunction-sections, -fdata-sections, -mthumb, -mcpu=cortex-m4, -mfloat-abi=hard, -mfpu=fpv4-sp-d16, -fsingle-precision-constant, -DF_CPU=80000000L, -MMD, -DARDUINO=101, -DENERGIA=13, -I/home/ebrundic/energia-0101E0013/hardware/lm4f/cores/lm4f, -I/home/ebrundic/energia-0101E0013/hardware/lm4f/variants/stellarpad, /home/ebrundic/energia-0101E0013/hardware/lm4f/cores/lm4f/itoa.c, -o, /tmp/build8593810888659232949.tmp/itoa.c.o] ...etcetc... TM4C129: [/home/ebrundic/energia-0101E0013/hardware/tools/lm4f/bin/arm-none-eabi-g++, -c, -O0, -w, -fno-rtti, -fno-exceptions, -ffunction-sections, -fdata-sections, -mthumb, -mcpu=cortex-m4, -mfloat-abi=hard, -mfpu=fpv4-sp-d16, -fsingle-precision-constant, -DF_CPU=120000000L, -MMD, -DARDUINO=101, -DENERGIA=13, -I/home/ebrundic/energia-0101E0013/hardware/lm4f/cores/lm4f, -I/home/ebrundic/energia-0101E0013/hardware/lm4f/variants/launchpad_129, /tmp/build8593810888659232949.tmp/Blink.cpp, -o, /tmp/build8593810888659232949.tmp/Blink.cpp.o] [/home/ebrundic/energia-0101E0013/hardware/tools/lm4f/bin/arm-none-eabi-gcc, -c, -O0, -w, -ffunction-sections, -fdata-sections, -mthumb, -mcpu=cortex-m4, -mfloat-abi=hard, -mfpu=fpv4-sp-d16, -fsingle-precision-constant, -DF_CPU=120000000L, -MMD, -DARDUINO=101, -DENERGIA=13, -I/home/ebrundic/energia-0101E0013/hardware/lm4f/cores/lm4f, -I/home/ebrundic/energia-0101E0013/hardware/lm4f/variants/launchpad_129, /home/ebrundic/energia-0101E0013/hardware/lm4f/cores/lm4f/wiring_analog.c, -o, /tmp/build8593810888659232949.tmp/wiring_analog.c.o] [/home/ebrundic/energia-0101E0013/hardware/tools/lm4f/bin/arm-none-eabi-gcc, -c, -O0, -w, -ffunction-sections, -fdata-sections, -mthumb, -mcpu=cortex-m4, -mfloat-abi=hard, -mfpu=fpv4-sp-d16, -fsingle-precision-constant, -DF_CPU=120000000L, -MMD, -DARDUINO=101, -DENERGIA=13, -I/home/ebrundic/energia-0101E0013/hardware/lm4f/cores/lm4f, -I/home/ebrundic/energia-0101E0013/hardware/lm4f/variants/launchpad_129, /home/ebrundic/energia-0101E0013/hardware/lm4f/cores/lm4f/itoa.c, -o, /tmp/build8593810888659232949.tmp/itoa.c.o] [/home/ebrundic/energia-0101E0013/hardware/tools/lm4f/bin/arm-none-eabi-gcc, -c, -O0, -w, -ffunction-sections, -fdata-sections, -mthumb, -mcpu=cortex-m4, -mfloat-abi=hard, -mfpu=fpv4-sp-d16, -fsingle-precision-constant, -DF_CPU=120000000L, -MMD, -DARDUINO=101, -DENERGIA=13, -I/home/ebrundic/energia-0101E0013/hardware/lm4f/cores/lm4f, -I/home/ebrundic/energia-0101E0013/hardware/lm4f/variants/launchpad_129, /home/ebrundic/energia-0101E0013/hardware/lm4f/cores/lm4f/wiring_shift.c, -o, /tmp/build8593810888659232949.tmp/wiring_shift.c.o] [/home/ebrundic/energia-0101E0013/hardware/tools/lm4f/bin/arm-none-eabi-gcc, -c, -O0, -w, -ffunction-sections, -fdata-sections, -mthumb, -mcpu=cortex-m4, -mfloat-abi=hard, -mfpu=fpv4-sp-d16, -fsingle-precision-constant, -DF_CPU=120000000L, -MMD, -DARDUINO=101, -DENERGIA=13, -I/home/ebrundic/energia-0101E0013/hardware/lm4f/cores/lm4f, -I/home/ebrundic/energia-0101E0013/hardware/lm4f/variants/launchpad_129, /home/ebrundic/energia-0101E0013/hardware/lm4f/cores/lm4f/driverlib/hibernate.c, -o, /tmp/build8593810888659232949.tmp/hibernate.c.o] [/home/ebrundic/energia-0101E0013/hardware/tools/lm4f/bin/arm-none-eabi-gcc, -c, -O0, -w, -ffunction-sections, -fdata-sections, -mthumb, -mcpu=cortex-m4, -mfloat-abi=hard, -mfpu=fpv4-sp-d16, -fsingle-precision-constant, -DF_CPU=120000000L, -MMD, -DARDUINO=101, -DENERGIA=13, -I/home/ebrundic/energia-0101E0013/hardware/lm4f/cores/lm4f, -I/home/ebrundic/energia-0101E0013/hardware/lm4f/variants/launchpad_129, /home/ebrundic/energia-0101E0013/hardware/lm4f/cores/lm4f/driverlib/comp.c, -o, /tmp/build8593810888659232949.tmp/comp.c.o] CC3200: [/home/ebrundic/energia-0101E0013/hardware/tools/lm4f/bin/arm-none-eabi-g++, -c, -O0, -w, -fno-rtti, -fno-exceptions, -ffunction-sections, -fdata-sections, -mthumb, -mcpu=cortex-m4, -DF_CPU=80000000L, -MMD, -DARDUINO=101, -DENERGIA=13, -I/home/ebrundic/energia-0101E0013/hardware/cc3200/cores/cc3200, -I/home/ebrundic/energia-0101E0013/hardware/cc3200/variants/launchpad, /tmp/build8593810888659232949.tmp/Blink.cpp, -o, /tmp/build8593810888659232949.tmp/Blink.cpp.o] [/home/ebrundic/energia-0101E0013/hardware/tools/lm4f/bin/arm-none-eabi-gcc, -c, -O0, -w, -ffunction-sections, -fdata-sections, -mthumb, -mcpu=cortex-m4, -DF_CPU=80000000L, -MMD, -DARDUINO=101, -DENERGIA=13, -I/home/ebrundic/energia-0101E0013/hardware/cc3200/cores/cc3200, -I/home/ebrundic/energia-0101E0013/hardware/cc3200/variants/launchpad, /home/ebrundic/energia-0101E0013/hardware/cc3200/cores/cc3200/wiring_analog.c, -o, /tmp/build8593810888659232949.tmp/wiring_analog.c.o] [/home/ebrundic/energia-0101E0013/hardware/tools/lm4f/bin/arm-none-eabi-gcc, -c, -O0, -w, -ffunction-sections, -fdata-sections, -mthumb, -mcpu=cortex-m4, -DF_CPU=80000000L, -MMD, -DARDUINO=101, -DENERGIA=13, -I/home/ebrundic/energia-0101E0013/hardware/cc3200/cores/cc3200, -I/home/ebrundic/energia-0101E0013/hardware/cc3200/variants/launchpad, /home/ebrundic/energia-0101E0013/hardware/cc3200/cores/cc3200/udma_if.c, -o, /tmp/build8593810888659232949.tmp/udma_if.c.o] [/home/ebrundic/energia-0101E0013/hardware/tools/lm4f/bin/arm-none-eabi-gcc, -c, -O0, -w, -ffunction-sections, -fdata-sections, -mthumb, -mcpu=cortex-m4, -DF_CPU=80000000L, -MMD, -DARDUINO=101, -DENERGIA=13, -I/home/ebrundic/energia-0101E0013/hardware/cc3200/cores/cc3200, -I/home/ebrundic/energia-0101E0013/hardware/cc3200/variants/launchpad, /home/ebrundic/energia-0101E0013/hardware/cc3200/cores/cc3200/itoa.c, -o, /tmp/build8593810888659232949.tmp/itoa.c.o] Stellaris lm4f also using -O0. MSP430 doesn't appear affected. This is using the release version of Energia 13. Quote Link to post Share on other sites
spirilis 1,265 Posted September 16, 2014 Share Posted September 16, 2014 @@energia added a fix to the current master, but it will have to wait for the next release (est ~5wk from now for a bugfix release). igor 1 Quote Link to post Share on other sites
energia 484 Posted September 16, 2014 Share Posted September 16, 2014 One thing you can try is to replace the pde.jar with the one in the attached zip file. If you are on windows simply replace the one in the Energia installation forlder. If you are on OS X: Right click Energia -> Show Package Content -> Browse to Contents->Resources->Java. Make sure that you backup the original pde.jar before copying the new one. The attached pde.jar was compiled on OS X but give that it is java it should run on all platforms. Robert pde.jar.zip developer_bt, reaper7 and spirilis 3 Quote Link to post Share on other sites
igor 163 Posted September 16, 2014 Author Share Posted September 16, 2014 Thanks. Actually there was one benefit to this. Since I was trying out the pragma optimization directives anyway, I found that for my library optimize level 2 did better than level s (more interested in speed than space). Quote Link to post Share on other sites
energia 484 Posted September 16, 2014 Share Posted September 16, 2014 Did that pde.jar work for you? I will look into moving compiler / linker options into the preferences.txt. I am also looking at adopting the Makefile implementations that I did for the Wiring IDE. That will make things easier for customization. Quote Link to post Share on other sites
spirilis 1,265 Posted September 16, 2014 Share Posted September 16, 2014 That pde.jar works in Linux, had to put the "pde.jar" file it in ~/energia-0101E0013/lib ... [/home/ebrundic/energia-0101E0013/hardware/tools/lm4f/bin/arm-none-eabi-g++, -c, -Os, -w, -fno-rtti, -fno-exceptions, -ffunction-sections, -fdata-sections, -mthumb, -mcpu=cortex-m4, -DF_CPU=80000000L, -MMD, -DARDUINO=101, -DENERGIA=13, -I/home/ebrundic/energia-0101E0013/hardware/cc3200/cores/cc3200, -I/home/ebrundic/energia-0101E0013/hardware/cc3200/variants/launchpad, /tmp/build825913301492273382.tmp/Blink.cpp, -o, /tmp/build825913301492273382.tmp/Blink.cpp.o] [/home/ebrundic/energia-0101E0013/hardware/tools/lm4f/bin/arm-none-eabi-gcc, -c, -Os, -w, -ffunction-sections, -fdata-sections, -mthumb, -mcpu=cortex-m4, -DF_CPU=80000000L, -MMD, -DARDUINO=101, -DENERGIA=13, -I/home/ebrundic/energia-0101E0013/hardware/cc3200/cores/cc3200, -I/home/ebrundic/energia-0101E0013/hardware/cc3200/variants/launchpad, /home/ebrundic/energia-0101E0013/hardware/cc3200/cores/cc3200/wiring_analog.c, -o, /tmp/build825913301492273382.tmp/wiring_analog.c.o] [/home/ebrundic/energia-0101E0013/hardware/tools/lm4f/bin/arm-none-eabi-gcc, -c, -Os, -w, -ffunction-sections, -fdata-sections, -mthumb, -mcpu=cortex-m4, -DF_CPU=80000000L, -MMD, -DARDUINO=101, -DENERGIA=13, -I/home/ebrundic/energia-0101E0013/hardware/cc3200/cores/cc3200, -I/home/ebrundic/energia-0101E0013/hardware/cc3200/variants/launchpad, /home/ebrundic/energia-0101E0013/hardware/cc3200/cores/cc3200/udma_if.c, -o, /tmp/build825913301492273382.tmp/udma_if.c.o] [/home/ebrundic/energia-0101E0013/hardware/tools/lm4f/bin/arm-none-eabi-gcc, -c, -Os, -w, -ffunction-sections, -fdata-sections, -mthumb, -mcpu=cortex-m4, -DF_CPU=80000000L, -MMD, -DARDUINO=101, -DENERGIA=13, -I/home/ebrundic/energia-0101E0013/hardware/cc3200/cores/cc3200, -I/home/ebrundic/energia-0101E0013/hardware/cc3200/variants/launchpad, /home/ebrundic/energia-0101E0013/hardware/cc3200/cores/cc3200/itoa.c, -o, /tmp/build825913301492273382.tmp/itoa.c.o] Quote Link to post Share on other sites
reaper7 67 Posted September 16, 2014 Share Posted September 16, 2014 on Windows works too tnx! Quote Link to post Share on other sites
energia 484 Posted September 24, 2014 Share Posted September 24, 2014 Great to hear that the jar files worked on both Linux and Windows. Thanks for letting me know! Quote Link to post Share on other sites
MORA99 9 Posted September 28, 2014 Share Posted September 28, 2014 Works fine on my windows installation too, before I was not able to use printf because it overflowed (.heap can not fit in SRAM), with the new pde.jar "Binary sketch size: 60.152 bytes (of a 262.144 byte maximum)" Quote Link to post Share on other sites
ewidance 2 Posted October 3, 2014 Share Posted October 3, 2014 Works also fine on OSX. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.