Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Compiling ND+ Firmware


  • Please log in to reply
6 replies to this topic

#1 nakchak

nakchak

    Advanced Member

  • Members
  • PipPipPip
  • 404 posts
  • LocationBristol, UK

Posted 22 March 2012 - 12:12 PM

Hi All

I am trying to compile the ND+ firmware (any version as I just want to make sure my tool chain is setup correctly). Currently I have access to MDK 3.1 and 4.1 through work, so i am trying to use them. Currently for i can successfully compile and deploy the netduino solution. However despite the NetduinoPlus solution compiling successfully i can not deploy it. Here is my deployment process:

  • Erase NetduinoPlus
  • Flash compiled TinyBooterDecompressor.bin with SAM-BA 2.11 (on win7 x64)
  • Open MFDeploy and Ping Device
  • Deploy ER_CONFIG and ER_FLASH

However when i try and deploy the Netduino Plus Firmware depending on the compiler version used one of the following happens
Using MDK 4.1
Deployment hangs at Executing Application

Using MDK 3.1
Deployment succeeds however the device does not reboot, and i do not get a "Debugger Found!" message if i then disconnect the device and reconnect windows displays a "USB Device not recognised" error, and i can only connect to the device by powering on with the button pressed.

Am i missing something from my NetduinoPlus solution as the Netduino solution works fine...

Also the compiled files in tinyclr.hex seem to be considerably smaller than the "Official" firmware images i.e when i compile 4.1.0.6 from source my image sizes are as follows:

ER_FLASH
Official Release Size: 1124248
My Compiled Size (release): 954336
Delta (release): 169912 bytes difference
My Compiled Size (debug): 1122456
Delta (debug): 1792 bytes difference


ER_CONFIG
Official Release Size: 6968
My Compiled Size: 6968
Delta: 0 bytes difference

Now I know that the RVDS/MDK compilers are good and produce the smallest images but a 165Kb discrepancy between compiled (release) output is ridiculous, and a 1.6Kb difference between debug builds is disturbing especially when I have read that Secret Labs use RVDS/MDK as their compiler...

My compilation process is as follows:
  • Open VS2010 Command Prompt
  • Navigate to PK folder, and execute setenv_MDK3.1.cmd C:\Keil\Arm\
  • execute msbuild Solutions\NetduinoPlus\dotnetmf.proj /T:build /p:Flavor=Release /v:d /m
  • or msbuild Solutions\NetduinoPlus\dotnetmf.proj /T:build /p:Flavor=Debug /v:d /m

Any clues as to what i am missing?

Edited by nakchak, 22 March 2012 - 12:33 PM.


#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 22 March 2012 - 08:54 PM

Hi nahchak,

Are you including the TCP_IP_STACK=LWIP option in your build? If not, you'll get hooks into the RTIP network stack--but none linked in properly.

Try this:
msbuild solutions\NetduinoPlus\dotnetmf.proj /p:flavor=release;tcp_ip_stack=lwip /t:rebuild

Chris

#3 nakchak

nakchak

    Advanced Member

  • Members
  • PipPipPip
  • 404 posts
  • LocationBristol, UK

Posted 23 March 2012 - 09:41 AM

Hi nahchak,

Are you including the TCP_IP_STACK=LWIP option in your build? If not, you'll get hooks into the RTIP network stack--but none linked in properly.

Try this:

msbuild solutions\NetduinoPlus\dotnetmf.proj /p:flavor=release;tcp_ip_stack=lwip /t:rebuild

Chris


Thanks Chris

That sorted it, now I have got it working I think I will document the process as the missing switch in my build command seems to be cryptic knowledge i.e. if you search the forums you only find 3 other posts that reference it and I cant find a reference at all in RCLPort.chm to the TCP_IP_STACK switch (well not in the index or by searching the chm...)

Thanks Again

Nak.

#4 cca

cca

    Member

  • Members
  • PipPip
  • 11 posts

Posted 24 April 2012 - 02:05 PM

Hello all, I would like to get into the firmware. A good first step is to recompile it as nakchak do : What are the software requirements? I understand that I need Visual Studio 2010 Command Prompt So I need a complete version of Visual Studio 2010 and just not express edition, do I? Other requirements?

#5 nakchak

nakchak

    Advanced Member

  • Members
  • PipPipPip
  • 404 posts
  • LocationBristol, UK

Posted 24 April 2012 - 02:49 PM

Hi CCA you will also need a suitable toolchain to compile for ARM. I am fortunate enough to have access to Keil MDK through work but its not really a peice of software within the reach of most developers as it costs several thousands of $$$ to license and the trial version doenst support scatter files i belive (which are needed to map the resultant binaries to the correct memory locations AFAIK). I havent tried using GCC but i belive it is possible to compile the ND+ firmware with it although i have heard the resultant binaries are considerably larger than those produced with RVDS/MDK. I believe that you can use VS express as msbuild is the same regardless of version of VS (please correct me if i am wrong but the only major differences between VS's are in the frontend i.e. profiling and UML tools in ultimate etc.) however again I only use VS professional (another benefit of being a full time C#/Systems developer).

#6 cca

cca

    Member

  • Members
  • PipPip
  • 11 posts

Posted 26 April 2012 - 08:33 AM

Thanks nakchak, I will try with GCC in the few days (since I don't have the thousands of $$$ Keil MDK) , but I have also read in this forum that binaries produced are too much big and so even can't be flashed in Netduino. I don't find for the moment a sucessfull/tested way to compile firmware with gcc! But if it is possible, it means that everybody can potentially customs its firmware for free. If not, it means that firmware development is not as open as I had believed in a first time... :huh: So if anyone has roadmap / indications for compiling firmware with only free tools, I am highly interested! ;)

#7 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 26 April 2012 - 08:47 AM

So if anyone has roadmap / indications for compiling firmware with only free tools, I am highly interested! ;)

Have a look at the Building firmware with VS2010 - stuck topic, starting with post #12. Also, try searching the forum for 'GCC'...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.