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.
Copy the firmware image C:\Netduino2\BuildOutput\THUMB2\GCC4.8\le\FLASH\release\Netduino2\bin\tinyclr.hex\ER_FLASH to C:\NetduinoUpdate_4.3.1.0\Firmware\Netduino2_4_3_1_0\ER_FLASH.s19 (rename - add extension)
Open ER_FLASH.s19 in you favorite text editor and delete the first line (starts with S0), save.
Launch NetduinoUpdate.exe, plug in your Netduino 2 and update the firmware.
Important notes
GCC support added and verified only for Netduino 2 (mainly due to resource/time constraints),
Other GCC toolchains might work or need only minor changes, but make sure they have support for long-long and long-double (IIRC Yagarto does not have it by default) - otherwise formatted string output for C# long and double does not work,
Included are a few bug fixes and modifications from my NETMF Fork project (which will be released probably later this year):
I'm trying to follow the guide, but when I run 'setenv_gcc 4.8.3 C:\GCC' I get a warning saying:
Compiler: GCC 4.8.3 C:\GCC
WARNING: Could not find vsvars32.bat.
WARNING: VISUAL C++ DOES NOT APPEAR TO BE INSTALLED ON THIS MACHINE
So it appears there are some more Prerequisites that should be in the top list. I've got Visual Studio 2013 Ultimate installed, and it contains Visual C++.
Also, if I ignore that warning, and run 'msbuild...' then it says that msbuild is not a recognized command. So it would appear that msbuild isn't installed either.
Shouldn't all this have been in place after installing Visual Studio 2013 Ultimate? What else is required?
So it appears there are some more Prerequisites that should be in the top list. I've got Visual Studio 2013 Ultimate installed, and it contains Visual C++.
According to .NET Micro Framework Porting Kit 4.3 ReleaseNotes.txt "Either Visual Studio 2012 (Express edition or greater) or both .NET Framework 3.5 and Windows SDK for Windows" is required.
In order to get Visual Studio 2013 working, you'd have to modify setenv_base.cmd - add %VS120COMNTOOLS% to the block of conditions, or simply change the existing %VS110COMNTOOLS% to 12. However, I am not sure this would be enough, due to the MSBuild 2013 changes and several project files having incorrect and/or missing ToolsVersion attribute.
I noticed this flash at the top of the build process output, but it does seem to successfully build new firmware... (Highlighted in yellow) Could not locate the .NET Framework SDK. Browsing to that registry location..There's no SDKInstallRootv2.0 key there. Only InstallRoot. I do have Windows SDK v7.1 installed.
Does this affect the Netduino build? Do I need to install .Net2.0 framework?
I tried adding the key with the value: C:\Windows\Microsoft.NET\Framework64\v2.0.50727 and still get the same error.
Does this affect the Netduino build? Do I need to install .Net2.0 framework?
No, you can safely ignore this warning. IIRC it is caused by incorrect ToolsVersion attribute value in a few project files, which causes MSBuild 3.5 to be run, instead of 4.0. I have already fixed such issues, but in separate 'cleanup' branch, which will be integrated into a future release...
Another thing I noticed, the FIRST time I compiled, a lot of messages in the output window mentioned Linking.Subsequently compiling my modified firmware, it does not show this linking in the output window I even added a /t:Rebuild
Those are libraries and stubs for tools and Windows2 solution, which do not need to be rebuilt when you make changes to a particular solution (your firmware).
There are a few 'clean' targets, you can display them for example by launching
msbuild Solutions\Netduino2\dotnetmf.proj /t:Help
For a 'complete clean' build, delete the build output directory
I've made some changes the STM32_i2c_functions.cpp file located here: C:\MicroFrameworkPK_v4_3\DeviceCode\Targets\Native\Netduino_STM32\DeviceCode\STM32_I2C
It compiled with no errors, I loaded it, and code works fine...though the I2c "bug" I'm experiencing it still there...Is it really that easy? How can I be sure my changes made it's way into the compile firmware?
Well, assuming that you don't have JTAG/SWD in-circuit debugger, the options are... ...challenging
At first, modify the value of <OEMSystemInfoString/> in Solutions\Netduino2\Netduino2.settings - you can then verify (e.g. in MFDeploy) that the device is running your updated firmware,
For diagnostic output that appears in the debugger (Visual Studio or MFDeploy) use CLR_Debug::Printf(...) (#include <TinyCLR_Debugging.h> or #include <TinyCLR_Runtime.h>).
For low-level diagnostic output you could use hal_printf or debug_printf; it is usually better to reconfigure STDIO and DEBUG_TEXT_PORT to serial port (e.g. COM1) instead of USB (default).
The above functions significantly affect code timing and might not be available/should not be called in a particular context (such as interrupt handler) - there you are left with pin toggling (LED blinking, logic analyzer).
Thank you CW2 - I got all entangled in the GCC Arm tooling build problems a few months back - just wanted to add some native code for custom hardware. This is great.
One clarification please. When you say Netduino 2 only - do you mean that no support for ND Plus 2?
Any thoughts on how to keep this work up to date as new versions of the MF and SL firmware are released over time?
One clarification please. When you say Netduino 2 only - do you mean that no support for ND Plus 2?
Yes, the GCC-related modifications have been made for Netduino 2 firmware only. But the most-important ones were made in the core .NET Micro Framework source code and are shared by Netduino Plus 2 firmware too - basically, adding a proper scatterfile and fixing possible GCC compiler errors in the additional libraries the Plus 2 firmware uses (network etc.) should be all that is needed to make GCC built firmware for the Plus 2.
Any thoughts on how to keep this work up to date as new versions of the MF and SL firmware are released over time?
Well, the modifications are available under Apache 2.0 license, so both Microsoft .NET Framework and Secret Labs teams can easily integrate them into their respective code And there are always alternative ways
Don't get me wrong but can maybe also explain the advantages, why I should use that? What's the benefits or what problem is solved? Just have no clue and ask myself if I should take a look at it ;-)
Don't get me wrong but can maybe also explain the advantages, why I should use that? What's the benefits or what problem is solved? Just have no clue and ask myself if I should take a look at it ;-)
Well, you don't have to use that (if you mean the firmware source). Adding GCC support allows you to use free GCC-based toolchains to compile the firmware - otherwise, you have to pay several thousand dollars for commercial ARM toolchains (such as Keil MDK).