[ell-i-developers] Problem with Array Initialization

  • From: Ivan Raul <supra.material@xxxxxxxxx>
  • To: "ell-i-developers@xxxxxxxxxxxxx" <ell-i-developers@xxxxxxxxxxxxx>
  • Date: Thu, 6 Mar 2014 21:55:48 +0100

Dear All.

Good Evening

I run into a little problem with some initialization routine that my C++
code for the Enc28J60 is generating. You can see my current progress here (
link<https://github.com/supramaterial/Runtime/tree/temp-enc-cpp-library/stm32/libraries/CoAP/arch/enc28j60>).
That is the part of the code that I have ported so far from my plain C
version.

Some part of my code, I suppose some array, is generating some
initialization routine. From my previous experience with the SPI API, I
know that if an array is not declared adequately, gcc tries to generate
code to actually copy it (IIRC it requires memcpy that is not part of the
arm-none-eabi standard libraries).

I noticed because the linker script asserts that there is no initialization
routine before actually calling the main
program(link<https://github.com/Ell-i/Runtime/blob/master/stm32/variants/ellduino/ld/flash.ld#L90>).
I will continue working on the issue, but I ask for one point concretely:

(1) Is there a concrete or specific way of declaring arrays and other
structures to make them allocated correctly and do not rely on
initialisation routines?

Thank you for your comments.

With Warm Regards, Ivan Raul

Other related posts: