Sketch Too Large

Post Reply
Fireblade
Posts: 4
Joined: Mon Dec 22, 2014 11:03 pm

Sketch Too Large

Post by Fireblade »

Hi,

Sorry about the first post being an issue, I've been lurking on here for a while getting some good advice and suggestions through other posts and working through problems so first of all, thank you to all that have inadvertently helped me out, it is very much appreciated. And thanks to Alex for the great job on the MultiWii in general.

My issue:

I want to try out MW 2.4 as it seems to have some great features for GPS but I'm having an issue with sketch size when incorporating GPS as it is too large for the FC, I get the message:

Binary sketch size: 32,010 bytes (of a 30,720 byte maximum)

I'm currently running a QUADX using a Crius SE v2.5 with I2C UBLOX GPS (with sonar) and no matter what I do to optimise the sketch size, I cannot get it to the 30.7k maximum size. I can comment out in the memory savings section:

//#define SUPPRESS_ALL_SERIAL_MSP // saves approx 2700 bytes

Or comment out the I2C GPS configuration:

//#define I2C_GPS

But that means either no GPS or, if I'm reading the memory saving comments right, no usable WinGUI interface MSP protocol settings which kind off defeats the object of cool GPS features.

I've tried optimising as much as I can, even going through and commenting out some stuff that I need to see what savings there were but nothing will give me more than a couple of hundred k at best. Combine all the useful features that I can comment out and keep the GPS then I'm still 1600k short of the target. If i'm missing something such as running the SUPPRESS_ALL_SERIAL_MSP line and using an alternative to WinGUI that doesn't use MSP then information on what that is would be cool. At the moment, I still have MW2.3 on the on the quad so I do have GPS hold & home (not sure about the sonar) but I'd love a waypoint setup for filming.

Looking forward to the replies.

config.h.zip
(21.06 KiB) Downloaded 181 times

waltr
Posts: 733
Joined: Wed Jan 22, 2014 3:21 pm
Location: Near Philadelphia, Pennsyvania, USA

Re: Sketch Too Large

Post by waltr »

The Atmega 328 is too small for any of the extended GPS features and has been even with MW2.3
Use an FC with an Atmega2650 "Mega" processor which has much more Flash and Ram space.
http://witespyquad.gostorego.com/flight ... a-3-5.html

Fireblade
Posts: 4
Joined: Mon Dec 22, 2014 11:03 pm

Re: Sketch Too Large

Post by Fireblade »

Thanks for the reply.

Tat's a shame about this board as I was getting used to it and it had some great features. I feared that it would be the case that there simply was not enough memory but it is so close, I'm sure something can go somewhere to free up the space but if there is really nothing I can do then I'll look at options for a replacement FC.

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Sketch Too Large

Post by Hamburger »

Disable the baro sensor might save enough? No alt.hold then.

Fireblade
Posts: 4
Joined: Mon Dec 22, 2014 11:03 pm

Re: Sketch Too Large

Post by Fireblade »

Hi Hamburger, thanks for the response on this. I'd be interested in knowing how to do this as the GPS can take the altitude control (indeed I believe it does have that option) so would mean the barometric is able to be sacrificed. I've had a good look through but I cannot see how to do this and my several attempts have left me with un-compilable code.

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Sketch Too Large

Post by Hamburger »

Afaik we do not support using gps info for altitude.
If you require altitude then baro m7st be activated in config.h.
Sorry.

User avatar
Leo
Posts: 372
Joined: Wed Sep 17, 2014 7:01 am
Location: Germany
Contact:

Re: Sketch Too Large

Post by Leo »

Fireblade,

I was in the same situation as you are in. I didn't want to give up my beloved 328P board. However I came to the realization that it is just not up to the tasks anymore so I decided to swap it for a Crius AIO Pro (V2.1) (I wanted to stick with 50x50 board size). I am so happy I did as now I can use all the functions MultiWii has to offer. I am so happy with the board I ordered a second one just a couple of days ago. I got mine for $32 US.

Think about it.

Leo

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Sketch Too Large

Post by Alexinparis »

Hi,

You can try Arduino 1.5.8
The code size is reduced due to a newer version of gcc
And the flash code for 328p board is increased
but in any case, test it carefully on the ground before flying.

User avatar
Leo
Posts: 372
Joined: Wed Sep 17, 2014 7:01 am
Location: Germany
Contact:

Re: Sketch Too Large

Post by Leo »

It will still tell you after compilation that the memory is too low and to use with caution.
That was too risky for me. Hence I ditched the 328p.

Fireblade
Posts: 4
Joined: Mon Dec 22, 2014 11:03 pm

Re: Sketch Too Large

Post by Fireblade »

Thanks for all the replies, I'm done some research around the post by Hamburger "Afaik (sic) we do not support using gps info for altitude" as I thought that when GPS was enabled it ignored the baro and used GPS altitude but my assumption was incorrect. Altitude is my biggest control problem, i just don't seem to have the touch for it and I'm always overcorrecting and use bro mode quite a bit to learn moves so I don't plunge. I'm going to try headfree mode as I can't wrap my head around yawing despite flying fixed wing a lot. Probably because with fixed wing it will only drive forwards :-)

Thanks for all the tips, I might just go for the mega but build a new quad around it.

waltr
Posts: 733
Joined: Wed Jan 22, 2014 3:21 pm
Location: Near Philadelphia, Pennsyvania, USA

Re: Sketch Too Large

Post by waltr »

To learn to fly a copter after flying fixed wing put it into forward motion. This is actually easier than hovering.

Post Reply