ROM Space XBee Programmable

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

No there is no option to reduce the code via the compiler. You must do it within your code.

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_Xbeev_ADC_Xbeev_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_Xbeev_ADC_Xbeev_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.