about reduce devo7e code size

More
20 Dec 2013 07:17 - 23 Dec 2013 05:18 #16823 by yuqiang
about reduce devo7e code size was created by yuqiang
Hi PB,
Thanks to your open source deviation firmware.
I plan to add a new protocol in devo7e, so I need print some debug information via UART.
As guide, I using "TYPE=dev" for enable UART print, but the dfu image size is bigger than 116Kb
I want to reduce some code size, Can you give me some suggests?
Thanks again~

notice: After I update code to latest version, TYPE=dev will work without any modify. update @ 12/23/2013
Last edit: 23 Dec 2013 05:18 by yuqiang.

Please Log in or Create an account to join the conversation.

More
20 Dec 2013 07:26 #16824 by PhracturedBlue
Replied by PhracturedBlue on topic about reduce devo7e code size
disable the standard mixer (HAS_STANDARD_MIXER = 0). That is the biggest reduction you'll get. Writing protocols on the devo7e is not much fun to be honest. You will spend more time fightingthe build process and trying to figue out if the module code is working, than actually working on the protocol itself. If you don't have a bigger radio, I'd recommend getting a RaspberryPi and developing the protocol there instead (see bitbucket.org/PhracturedBlue/rpi_protocols ) I haven't updated it with the most recent protocols, but generally if you develop protocols with it, they just work when you bring them to the Devo (assuming the RF chip is already supported)

Please Log in or Create an account to join the conversation.

More
20 Dec 2013 08:01 - 20 Dec 2013 08:04 #16825 by yuqiang
Replied by yuqiang on topic about reduce devo7e code size
thanks for your reply,
1. "HAS_STANDARD_MIXER = 0" I can't find anything about HAS_STANDARD_MIXER in source code;
2. using RaspberryPi is a good idea, but the protocol is too simple.

btw, Now I disable ini_handler() in model.c, just fill "Model" with a hijacked data, this will reduce the size to 112Kb.
Last edit: 20 Dec 2013 08:04 by yuqiang.

Please Log in or Create an account to join the conversation.

More
20 Dec 2013 08:20 - 20 Dec 2013 08:20 #16827 by vlad_vy
Replied by vlad_vy on topic about reduce devo7e code size
\target\devo7e\target_defs.h

#define HAS_STANDARD_GUI 0
Last edit: 20 Dec 2013 08:20 by vlad_vy.

Please Log in or Create an account to join the conversation.

More
20 Dec 2013 11:30 #16831 by HappyHarry
Replied by HappyHarry on topic about reduce devo7e code size
guys how can you build without telemetry? I can find nothing in the define file?

Please Log in or Create an account to join the conversation.

More
20 Dec 2013 16:36 #16848 by victzh
Replied by victzh on topic about reduce devo7e code size
There was a condition which turned off Standard GUI for developer builds for Devo 7E. It is still there, but commented out. May be it is safe to put it back? I doubt that people developing protocols would not be able to figure out Advanced GUI.

Please Log in or Create an account to join the conversation.

More
20 Dec 2013 16:40 #16849 by victzh
Replied by victzh on topic about reduce devo7e code size
@HappyHarry probably you can't. GUI stuff is interdependent, and while some effort was spent to cut off Standard GUI, nobody did this for many other parts. It is complicated - you need to introduce conditionals in many places around not wanted functionality, and cut it out so that the pieces you cut not used in any other places. You need to check that it works for all the platforms. So it is several (dozens) build attempts.

Please Log in or Create an account to join the conversation.

More
21 Dec 2013 10:02 - 21 Dec 2013 10:02 #16875 by kreidler
Replied by kreidler on topic about reduce devo7e code size

HappyHarry wrote: guys how can you build without telemetry? I can find nothing in the define file?

There is no switch for disabling the telemetry stuff. I did it some time ago just to get all in the 116kB before having the opportunity to disable the Standard GUI.
My attempt was quick and dirty only. If you want to test how much the advantange will be just start with removing (comment out) the following lines in menus.c:
{PAGEID_TELEMCFG, NULL, MENUTYPE_SUBMENU,  0, MIXER_ALL, PREVIOUS_ITEM},
....
{PAGEID_TELEMMON, NULL, MENUTYPE_SUBMENU,  1, MIXER_ALL, PREVIOUS_ITEM},
Do several times a new build and follow the errors given by the complier to comment the appropriate lines out until the file will be fully complied.

But I cannot remember how much space I saved.
Last edit: 21 Dec 2013 10:02 by kreidler.

Please Log in or Create an account to join the conversation.

  • rbe2012
  • rbe2012's Avatar
  • Offline
  • So much to do, so little time...
More
21 Dec 2013 10:26 #16877 by rbe2012
Replied by rbe2012 on topic about reduce devo7e code size
This will work but if you want to do this, add a "#define NO_TELEMETRY 1" line to target/devo7/capabilities.h and don't comment the lines but enclose them with "#if NO_TELEMETRY == 1" and "#endif".
With that you implement a switch which allows you to turn telemetry on again if somewhere else some space is left...
And I would look into the code if you publish it to see if we can make it a general switch (I am sure that more code could be disabled than the lines throwing errors).

Have I mentioned that I own a Devo7e since yesterday? Now I know why you guys like it - it is so mignon, but I can use it with my big paws... I have tested the actual build, but it does not fit; I had to disable the standard mixer gui (so nothing important lost ;) ).

Please Log in or Create an account to join the conversation.

More
21 Dec 2013 11:55 #16879 by kreidler
Replied by kreidler on topic about reduce devo7e code size

rbe2012 wrote: I have tested the actual build, but it does not fit; I had to disable the standard mixer gui (so nothing important lost ;) ).

I do have with b5579a0 115.75kb on Windows environment with the ARM as recommended by PB here http://deviationtx.com/forum/7-development/2407-testing-compiler-builds .

If you do not mind my preferred config is
#define HAS_STANDARD_GUI 0
#define HAS_PERMANENT_TIMER 1
#define ENABLE_LAYOUT_EDIT  1
both options will work on the 7e as well.

Please Log in or Create an account to join the conversation.

More
21 Dec 2013 13:38 #16883 by SadSack
Replied by SadSack on topic about reduce devo7e code size
+ Optimizing placement and re-linking
ROM: 0x08003000 - 0x0801faf4 = 114.74kB
RAM: 0x20000000 - 0x200027e4 =   9.97kB

Stock-devo7e.bin

 + Optimizing placement and re-linking
ROM: 0x08003000 - 0x0801dd60 = 107.34kB
RAM: 0x20000000 - 0x20002748 =   9.82kB

ENABLE_LAYOUT_EDIT-devo7e.bin

 + Optimizing placement and re-linking
ROM: 0x08003000 - 0x0801ec68 = 111.10kB
RAM: 0x20000000 - 0x200027b4 =   9.93kB

#define HAS_STANDARD_GUI 0
#define HAS_ADVANCED_GUI 1
//#endif

#define NO_LANGUAGE_SUPPORT 1
#define HAS_PERMANENT_TIMER 1
#define ENABLE_LAYOUT_EDIT  1
#define DATALOG_ENABLED 1   << copied from devo10 :-)

Maybe you should try installing GCC LINARO 4.8-2013.11.
I was able to build it under unbuntu 12.4 but haven't figured how to cross compile for windows and for me Mingw couldn't build it but that could have just been me.
Attachments:

Please Log in or Create an account to join the conversation.

More
21 Dec 2013 16:11 #16892 by PhracturedBlue
Replied by PhracturedBlue on topic about reduce devo7e code size
I added the ability to disable telemetry. I also renamed a bunch of variables to be consistent

Please Log in or Create an account to join the conversation.

More
21 Dec 2013 17:10 #16895 by HappyHarry
Replied by HappyHarry on topic about reduce devo7e code size
thanks for all the info guys, as I'm sure you've noticed I'm a novice at C/C++ but I am willing to learn. the reason I need the space is I've added the extra switches (2 x 3way, i know I can only use 1 of the 3 way switches just now) to my 7e and I need space for the current switch mod. I don't mind learning the advanced GUI, and disabling the standard if needs be, it's just the thought of having to go through the setup of 5 different heli's and 2 quads again as I don't think the model ini's are transferable?

phil

Please Log in or Create an account to join the conversation.

More
21 Dec 2013 20:36 #16901 by FDR
Replied by FDR on topic about reduce devo7e code size

HappyHarry wrote: ...as I don't think the model ini's are transferable?


They are, but the configs will be unnecessarily complex...

Please Log in or Create an account to join the conversation.

More
21 Dec 2013 21:32 #16904 by HappyHarry
Replied by HappyHarry on topic about reduce devo7e code size
heh the advanced gui is unnecessarily complex ;)

Please Log in or Create an account to join the conversation.

More
21 Dec 2013 22:05 #16907 by FDR
Replied by FDR on topic about reduce devo7e code size
No. A model config made with the standard gui is unnecessarily complex if you switch it to the advanced gui, mostly because of the CCPM config it uses...

Please Log in or Create an account to join the conversation.

More
21 Dec 2013 22:29 #16914 by kreidler
Replied by kreidler on topic about reduce devo7e code size

HappyHarry wrote: (2 x 3way, i know I can only use 1 of the 3 way switches just now) to my 7e and I need space for the current switch mod.

Latest build 115.86kB with the ARM compiler and applied 1x3sw_mod.

Just to enable some additional features with the switch mod. I just show the changes only:
#define HAS_TELEMETRY       0
#define HAS_LAYOUT_EDITOR   1
114.93kB working. So, no problem for your mod with Standard GUI.

Please Log in or Create an account to join the conversation.

More
22 Dec 2013 00:13 #16916 by HappyHarry
Replied by HappyHarry on topic about reduce devo7e code size
thanks, once patched with the 3 way patch (which i had to modify to get it to apply in tx_buttons.c) i used

HAS_ADVANCED_GUI 0
HAS_TELEMETRY 0
HAS_LAYOUT_EDITOR 0
HAS_PERMANENT_TIMER 0

and got down to 113.4kb, though i don't know if it's a functional build yet, but with your findings i can add things back in now and see where i end up :)

thanks for all the help and work guys :)

phil

Please Log in or Create an account to join the conversation.

Time to create page: 0.056 seconds
Powered by Kunena Forum