Home/Support/Support Forum/ROM Space XBee Programmable

ROM Space XBee Programmable

0 votes
Hi everyone

I have a problem. I'm developing a firmware to load in my programmable XBee. The size of the code is apparently a little more than 28 kBs, so the compiler gives me an error (the code can't be larger than 28.160 bytes)

So, does anyone know how i can reduce the size of the code? I'm talking about some configuration, the way that the compiler works, something like that.

Thanks in advance
asked Oct 4, 2015 in XBee Programmable Development by felipe New to the Community (3 points)

Please log in or register to answer this question.

1 Answer

0 votes
No there is no option to reduce the code via the compiler. You must do it within your code.
answered Oct 7, 2015 by mvut Veteran of the Digi Community (12,786 points)
As always, thanks mvut!

I fixed the error, however, i don't understand it. If i use the function pow() to power a number, it doesn't work and the compiler gives me the error not enough space in ROM.

If i multiply the variable by itself, it works OK.

WTF?
This command is used for a Floating Point processor that requires specific lib files.  I do not recommend going this rout.
Thanks mvut!

I wish to ask you for an advice. I don't understand the problem of the ROM space. Look at this:

If my code says (v_ADC_Xbee powered 3), compiles fine.

v_ADC_Xbee_3 = v_ADC_Xbee*v_ADC_Xbee*v_ADC_Xbee;

But, adding this code line

v_ADC_Xbee_2 = v_ADC_Xbee*v_ADC_Xbee;

Then the code would be

[...]
v_ADC_Xbee_3 = v_ADC_Xbee*v_ADC_Xbee*v_ADC_Xbee;
v_ADC_Xbee_2 = v_ADC_Xbee*v_ADC_Xbee;
[...]

And it doesn't compile! And the problem is supposed to be ROM space.

Do you know what is happening?
I have to find a number using polinomy approximation and can't anyway

Thanks, as always
Sorry, I am not good enough in C to answer that one.
...