Uday,
You should review the linker map for the details. I think that you will find that the WiFi and/or Ethernet stack take quite a bit of the firmware space. The following is a break down that based on an analysis that I did on the ATMega firmware about two months ago. Objects Size crt 1 2 libgcc 14 358 libm 23 1244 executable 9 1300 libJSON 15 3154 libWiring 45 3350 libc 34 3662 libCoAP 44 5356 libNetwork 80 8656 libCA 119 14440 libOCTB 101 23486 485 65008 Objects are the number of functions and the size is the size of the code. This does not include the static variable content. It is my understanding that the size has improved by about 2kB since I performed this analysis. Pat From: Pulleti, Uday Kiran [mailto:[email protected]] Sent: Sunday, March 15, 2015 4:48 AM To: Lankswert, Patrick; Agrawal, Sachin; Hudson, Douglas; iotivity-dev at lists.iotivity.org Subject: RE: Compiling for Arduino Mega 2560 and Due Thanks everyone for the quick and detailed replies. As mentioned by Sachin, I got the memory size for Mega to be around 60KB and Due to be 110KB which is well within their capacities. I?m assuming the Iotivity base stack to be around 90% of this size as the client server application program itself is very light. Given this, do you have any comment on the footprint for other services like control manager, soft sensor manager and protocol plugin. Do you envision Arduino to be a thin client with just the base sdk or do you think it can run other services as well. Thanks Uday From: Lankswert, Patrick [mailto:[email protected]] Sent: Friday, March 13, 2015 11:06 PM To: Agrawal, Sachin; Pulleti, Uday Kiran; iotivity-dev at lists.iotivity.org <mailto:iotivity-dev at lists.iotivity.org> Subject: RE: Compiling for Arduino Mega 2560 and Due Uday, For an even more detailed view regarding what is in the flash image, have the linker create a linker map. The linker map will tell you where every function, it?s address and size in the image. However, even the elf file contains *stuff* that will not be in the firmware image like the symbol table, etc. which is why avr-size is needed. Pat From: iotivity-dev-bounces at lists.iotivity.org <mailto:iotivity-dev-bounces at lists.iotivity.org> [mailto:[email protected]] On Behalf Of Agrawal, Sachin Sent: Friday, March 13, 2015 12:28 PM To: Pulleti, Uday Kiran; iotivity-dev at lists.iotivity.org <mailto:iotivity-dev at lists.iotivity.org> Subject: Re: [dev] Compiling for Arduino Mega 2560 and Due Hi Uday, SimpleClientServer is the elf file which is generated by linking all the *.o and *.lib. To correctly estimate its size, you need to invoke avr-size command on that file. For Arduino Mega2560 + Ethernet + Arduino-1.5.7, avr-size will return around 62K and that is what is flashed on Mega2560 flash memory by avrdude. Tip: Also, to see some logs (via cutecom/minicom) while SimpleClientServer is executing on Arduino, you may want to update this file: <iotivity>/resource/csdk/stack/samples/arduino/SimpleClientServer/ocserver/SConscript by removing the ?RELEASE? check while adding TB_LOG flag in CPPDEFINES. This will allow you to build sample application with logging enabled. Note: Compiling Iotivity stack in Debug mode for ArduinoMega2560 (with just 8KB of SRAM) MAY not be a good idea because they consume lot of SRAM and the application may display erratic behavior. Thanks Sachin From: Hudson, Douglas Sent: Friday, March 13, 2015 7:30 AM To: Pulleti, Uday Kiran; Agrawal, Sachin; iotivity-dev at lists.iotivity.org <mailto:iotivity-dev at lists.iotivity.org> Subject: RE: Compiling for Arduino Mega 2560 and Due Hi Uday, The Arduino hex file that you download to the Arduino should be: <iotivity base dir>/out/arduino/avr/release/resource/csdk/stack/samples/arduino/SimpleClientServer/ocserver/SimpleClientServer.hex Hope this helps! Doug Hudson Intel Corporation Platform Engineering Group (PEG) / Intel Communications and Devices Group (iCDG) / Louisville From: iotivity-dev-bounces at lists.iotivity.org <mailto:iotivity-dev-bounces at lists.iotivity.org> [mailto:[email protected]] On Behalf Of VanCutsem, Geoffroy Sent: Friday, March 13, 2015 6:37 AM To: Pulleti, Uday Kiran; Agrawal, Sachin; iotivity-dev at lists.iotivity.org <mailto:iotivity-dev at lists.iotivity.org> Subject: Re: [dev] Compiling for Arduino Mega 2560 and Due If I remember correctly, there are instructions printed out at the end of the build process. It involves using ?avrdude? (for the Mega2560 board) and the command-line is something like: $sudo /path/to/arduino-1.0.6/hardware/tools/avrdude -C/path/to/arduino-1.0.6/hardware/tools/avrdude.conf -v -v -v -v -patmega2560 -cwiring -P/dev/ttyACM0 -b115200 -D -Uflash:w:yourbinary.hex:i You?ll have to make sure to use parameters that match your system config. Geoffroy ----------------------------------------------- Intel Corporation NV/SA Kings Square, Veldkant 31 2550 Kontich RPM (Bruxelles) 0415.497.718. Citibank, Brussels, account 570/1031255/09 From: iotivity-dev-bounces at lists.iotivity.org <mailto:iotivity-dev-bounces at lists.iotivity.org> [mailto:[email protected]] On Behalf Of Pulleti, Uday Kiran Sent: Friday, March 13, 2015 10:39 AM To: Agrawal, Sachin; iotivity-dev at lists.iotivity.org <mailto:iotivity-dev at lists.iotivity.org> Subject: Re: [dev] Compiling for Arduino Mega 2560 and Due Thanks for the info Sachin. I?m able to compile the code. Can you let me know where I can find documentation for flashing the Arduino board and testing it. Also from the compiled code, libcoap.a is 300KB, liboctbstack.a is 600KB and SimpleClientServer is 500KB. The total flash memory size of Arduino mega 2560 is 256KB. What are the binaries that will be flashed on the board. It will be of great help if you can point me some detailed documentation. And I appreciate your patience as I?m working on Arduino for the first time. Thanks Uday From: Agrawal, Sachin [mailto:[email protected]] Sent: Friday, March 13, 2015 11:22 AM To: Pulleti, Uday Kiran; iotivity-dev at lists.iotivity.org <mailto:iotivity-dev at lists.iotivity.org> Subject: RE: Compiling for Arduino Mega 2560 and Due Hi Uday, I assume you are trying to build Iotivity stack from master branch. Download arduino-1.5.7. Download Time library from here (http://www.pjrc.com/teensy/td_libs_Time.html) and unzip in <Arduino-1.5.7>/libraries folder. For Arduino Mega2560 with ArduinoEthernet Shield: scons ARDUINO_HOME=<arduino-1.5.7 directory path> TARGET_OS=arduino BOARD=mega NET=Ethernet Thanks Sachin From: iotivity-dev-bounces at lists.iotivity.org <mailto:iotivity-dev-bounces at lists.iotivity.org> [mailto:[email protected]] On Behalf Of Pulleti, Uday Kiran Sent: Thursday, March 12, 2015 8:32 AM To: iotivity-dev at lists.iotivity.org <mailto:iotivity-dev at lists.iotivity.org> Subject: [dev] Compiling for Arduino Mega 2560 and Due Hi, I want to compile the Arduino samples for Mega 2560 and Due. As mentioned in the previous email at http://lists.iotivity.org/pipermail/iotivity-dev/2015-March/000451.html, the getting started page is not up to date. But even the command is not working $ scons TARGET_OS=arduino TARGET_ARCH=avr BOARD=mega2560. Can you point me to the steps to compile for Mega 2560 and Due. Does these two statements in the getting started page still hold good ?For Arduino ATMega 2560, <http://arduino.cc/en/Main/OldSoftwareReleases> Arduino version 1.0.5 and AVR-GCC version 4.5.3 is needed. For Arduino Due: <http://arduino.cc/en/Main/OldSoftwareReleases> Arduino Version 1.5.7 and AVR-GCC version 4.8.3 is needed? or do we need any other specific version of AVR-GCC. Appreciate if you can let me know if there is any change with Time library Arduino Time Library Download the Arduino Time Library and unzip it in the Arduino directory at <ARDUINO_DIR>/libraries/TIME. For Arduino ATMega 2560, download the Time library from <http://playground.arduino.cc/code/time> here. For Arduino Due, download the Time library from <http://www.pjrc.com/teensy/td_libs_Time.html> here. Thanks Uday -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20150316/3f5eb962/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 7198 bytes Desc: not available URL: <http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20150316/3f5eb962/attachment.p7s>
