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.

timothyp

Member Since 22 Dec 2010
Offline Last Active Jul 01 2015 07:50 AM
-----

Topics I've Started

Adding binary library to the native code

02 June 2015 - 03:20 AM

Let's say I compile the following code and compile it to a library for the STM32F4

int GetValue(unsigned char* pBuffer,int nSize)
{
	int nIndex = 0;
	for(nIndex = 0;nIndex <nSize;nIndex++)
	{
			pBuffer[nIndex] = nIndex;
	}
	return nIndex;
}

The result is ExampleLib.lib

 

I then include it in the project file:

<DriverLibs Include="Solutions\NetduinoPlus2\DeviceCode\Example\Example\Stubs\ExampleLib.$(LIB_EXT)"/>

During compile the binary is linked and the firmware builds without any issues, I can deploy it to the Netduino
but as soon as we do it crashes. 

 

Am I missing something here?

 

Note: I know I could just include the source code instead, but I want to understand what it takes to include a binary directly

 

 


Compiled 4.3, got ER_CONFIG & ER_FLASH, but how to deploy?

06 March 2015 - 04:32 AM

Hi,

 

I followed this http://wiki.netduino...to-GCC-4-6.ashx

and https://learn.adafru...ll#prerequisits

 

I built the 4.3 firmware and now have:

...\le\FLASH\release\NetduinoPlus2\bin\tinyclr.hex\ER_CONFIG
...\le\FLASH\release\NetduinoPlus2\bin\tinyclr.hex\ER_FLASH

According tot he guide on adafruit:

 

 

 

Then you need to follow this guide first: http://wiki.netduino...4-6.ashx?HL=gcc , but after the build finishes with no errors, you do not need to generate the DFU file.

 

Here it says I don't need to generate the DFU file and can simply deploy with MFDeploy.

 

Now the Netduino board has been prepared with the 4.3 firmware using the files and instructions
in this post: http://forums.netdui...-firmware-v431/    

Which basically means I used the NetduinoUpdate_4.3.1.0 tool to install the original firmware.

(This is also what I use whenever I manage to completely lock up the board)

 

When I use MFDeploy, it connects to the device, I can select the 2 files mentioned earlier and

it seems to be starting the flashing process but then it throws an error it cannot connect to the device.

 

Going back to the guide on the Netduino wiki (which is for 4.2, but I kept that in mind while following it)

 

 

 

Use the 'DFU File Manager' from the 'DfuSe Demo' apps, to extract a binary from a dfu, to extract the pieces of the official firmware (we only need the Tinybooter). I.e. NetduinoPlus2_Firmware_4.2.1.2_00_08000000.bin

Use the 'DFU File Manager' from the 'DfuSe Demo' apps, to generate a dfu from multiple bin files. Since these are bin file, you will need to specify their location in flash. The locations to use are:

 

This guide says I do have to generate DFU files and that pieces have to be extracted from the official firmware.
 

So here are the questions:

  1. Why does one guide tell me to flash using MFDeploy
  2. Why doesn't it work
  3. Why does the other guide tell me to extract the DFU files
  4. Where exactly can I find the official firmware files it is referring to

 

 

 

 


MetaDataProcessorDat fails: MPP: error MP0000: CLR_E_FAIL

10 February 2015 - 08:12 AM

Preface:

 

I tried compiling 4.3 with Yagarto before following the instructions on this page:

 

http://wiki.netduino...to-GCC-4-6.ashx

 

However that results in 116 errors looking exactly like this:

 

 

The command " "\-gcc.exe .................................. exited with code 9009.

 

I checked the version of yagarto, even tried different versions... didn't work.

 

After that I tried using the KEIL MDK toolchain.

Using that one I was able to compile the unmodified 4.3 sources.
(There was one error about a scatter file but it did not seem to affect the build of the firmware).

 

The problem

 

A reply to my previous question (http://forums.netdui...e-code-interop/)
guided me to this tutorial on how to use native interop with the .NET MF:

 

https://learn.adafru...tduino?view=all

 

So I went ahead, created a new .NET MF library, generated the native code files,
put everything into place and tried to recompile the firmware again, this time including
the new native code.

 

The compile process started as usual and seemed to continue all the way to the end
at which point it outputs something like this:

Skipping target "ArmCompileC" because it has no outputs.

MetaDataProcessorDat:

C:\PK\BuildOutput\public\Release\server\dll\MetaDataProcessor.exe -create_database C:\Users\Timothy\AppData\Local\Temp\tmpD8B3.tmp C:\PK\BuildOutput\THUMB2\MDK4.54\le\FLASH\release\NetduinoPlus2\bin\tinyclr.dat

MMP : error MMP0000: CLR_E_FAIL [C:\PK\Solutions\NetduinoPlus2\TinyCLR\TinyCLR.proj]

Done Building Project "C:\PK\Solutions\NetduinoPlus2\TinyCLR\TinyCLR.proj"
 (Build target(s)) -- FAILED.

Done Building Project "C:\PK\Solutions\NetduinoPlus2\dotnetmf.proj"
 (rebuild target(s)) -- FAILED.


Build FAILED.

"C:\PK\Solutions\NetduinoPlus2\dotnetmf.proj" (rebuild target) (1) ->
"C:\PK\Solutions\NetduinoPlus2\TinyBooter\TinyBooter.proj" (Build target) (2) ->

The generated C++ looks like this:

void NativeHelper::Hello( CLR_RT_TypedArray_UINT8 param0, CLR_RT_TypedArray_UINT8 param1, HRESULT &hr )
{
}

After creating the managed project for the interop library and generating the stubs,
I did not make any changes to those files. I wanted to make sure it compiled as is first,
that's why the method above has an empty body.

 

Any ideas on what might be going on?

Is the error caused by the Keil MDK toolchain or has the compilation process already completed
at the time of the error and is there something else going on?


please delete this topic (double posting again for some reason)

10 February 2015 - 08:12 AM

post appeared twice


How to compile the firmware without networking support (plus 2)

07 February 2015 - 07:57 AM

Following the information in this page (more or less as it's a bit old)

 

I compile the firmware using msbuild and the following arguments:

msbuild Solutions\NetduinoPlus2\dotnetmf.proj /T:rebuild /p:flavor=release;tcp_ip_stack=lwip

I don't need any network support for my current project, so I was hoping I'd be able to gain a little bit of space
by not including support for tcp/ip. Simply removing the argument does not seem to help, is there

anything specific I should do in order to exclude networking support?

 

 


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.