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's Content

There have been 17 items by timothyp (Search limited from 29-March 23)


By content type

See this member's

Sort by                Order  

#63003 Adding binary library to the native code

Posted by timothyp on 02 June 2015 - 03:20 AM in Netduino Plus 2 (and Netduino Plus 1)

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

 

 




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

Posted by timothyp on 18 March 2015 - 03:49 AM in Netduino Plus 2 (and Netduino Plus 1)

That seemed to work :-)

Is the source for the Netduino Update application available by any chance? 




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

Posted by timothyp on 17 March 2015 - 08:26 AM in Netduino Plus 2 (and Netduino Plus 1)

Sweet, I'll try that.

Meanwhile everything works like a charm. Been able to modify the sources, add C++ code and get it all working together.

Once you know how it seems easy... but oh boy to get started... :P




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

Posted by timothyp on 11 March 2015 - 02:27 AM in Netduino Plus 2 (and Netduino Plus 1)

Apparently the scatterfile I was using contained incorrect address locations,

so I copied the content of the rvds scatter file. That solved the deployment via MFDeploy issue.

Still have no idea how to create the DFU files though.




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

Posted by timothyp on 06 March 2015 - 04:32 AM in Netduino Plus 2 (and Netduino Plus 1)

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

 

 

 

 




#61787 MetaDataProcessorDat fails: MPP: error MP0000: CLR_E_FAIL

Posted by timothyp on 06 March 2015 - 04:04 AM in Netduino Plus 2 (and Netduino Plus 1)

I finally figured out what the problem was, and it's quite a blunder on my part  :)

K\BuildOutput\THUMB2\MDK4.54\le\FLASH\release\NetduinoPlus2\bin\tinyclr.dat

All the paths where referring to the "release" folder, while I was compiling the debug build.




#61585 Reset N2+ to firmware

Posted by timothyp on 10 February 2015 - 02:59 PM in Netduino Plus 2 (and Netduino Plus 1)

 

 

after finishing i tried to run my old examples, but non of them worked after installing the firmware

 

Just to make sure, after upgrading to 4.3.1, did you change the project properties so it targets .NET MF 4.3 instead of 4.2?

And any time you get really stuck, the update tool will safe the day: http://forums.netdui...&attach_id=3167




#61582 MetaDataProcessorDat fails: MPP: error MP0000: CLR_E_FAIL

Posted by timothyp on 10 February 2015 - 08:12 AM in Netduino Plus 2 (and Netduino Plus 1)

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?




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

Posted by timothyp on 10 February 2015 - 08:12 AM in Netduino Plus 2 (and Netduino Plus 1)

post appeared twice




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

Posted by timothyp on 09 February 2015 - 09:01 AM in Netduino Plus 2 (and Netduino Plus 1)

I think I figured it out.

 

In the porting kit folder "Solutions\NetduinoPlus2" you can edit the dotnetmf.proj file

and exclude all projects you don't need.

 

It seems to build and the result is a smaller firmware.




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

Posted by timothyp on 07 February 2015 - 07:57 AM in Netduino Plus 2 (and Netduino Plus 1)

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?

 

 




#61400 Native code interop

Posted by timothyp on 28 January 2015 - 08:50 AM in Netduino Plus 2 (and Netduino Plus 1)

That is correct, in the current implementation of .NET Micro Framework, managed code (CIL) is interpreted (there is no JIT).

 

Wow! I had no idea. My mistake :)




#61395 Native code interop

Posted by timothyp on 28 January 2015 - 02:50 AM in Netduino Plus 2 (and Netduino Plus 1)

This looks quite promising! I was a bit put off by the fact that he says C# is interpreted but I'll write that down to a language barrier :-)

We've already compiled the netduino firmware and put it on an empty STM chip, so it should be a small step from there.

 

Thank you!




#61381 Native code interop

Posted by timothyp on 27 January 2015 - 04:02 AM in Netduino Plus 2 (and Netduino Plus 1)

HI,

 

Does the netduino firmware support any kind of native code interop.

I've seen some references and promises on the forum but those date back to years ago.

 

Side question: Is the netduino firmware still under active development? 

 

 




#61380 Generating random numbers (utilizing the STM32 features)

Posted by timothyp on 27 January 2015 - 03:53 AM in Netduino Plus 2 (and Netduino Plus 1)

Hi,

 

According to this http://www.st.com/we.../DM00073853.pdf

The STM32 chip used on the NetDuino has a built-in random number generator.

 

Other .NET MF boards have firmware which expose this through the RandomNumberGenerator class
in the System.Security.Cryptography namespace. Does the NetDuino firmware exposes this
in any way?

 

If it is exposed through the classes in System.Security.Cryptography it won't help at this point
since I can't even load those assemblies on the NetDuino at this time.

 

If there was a way to call C code from C# that would provide a solution, but not sure NetDuino supports that?

 

 

 




#61366 Adding a reference to System.Security

Posted by timothyp on 25 January 2015 - 03:12 PM in Netduino Plus 2 (and Netduino Plus 1)

Indeed. After adding the reference it tries to reboot for the application to start and the debugger to connect,

but after that it is dead. It does not complain about the size of the assemblies (that was my first guess, that they were to big) either.

 

The only thing I can do then is use the DFU tools to erase everything and flash .NET MF 4.3.1 again.

Then I simply remove the reference, start it again and verifies it works. I do not change the code as it doesn't actually
use any of the code in those assemblies yet (since it is a test)




#61244 Adding a reference to System.Security

Posted by timothyp on 14 January 2015 - 06:40 AM in Netduino Plus 2 (and Netduino Plus 1)

I created a new project for the Netduino Plus 2, running 4.3.1 (http://forums.netdui...-firmware-v431/)  and made the led blink.

 

Works like a charm, obviously  :D

However, as soon as I add a reference to System.Security.dll and try to deploy trouble kicks in.

The device is rebooted because it's not in the correct state and after that it shows up in 
Windows as a device that is malfunctioning / cannot be recognized.

 

The only thing to do at this point is to reboot it in DFU mode and erase the application.

Removing the System.Security.dll reference solves the problem.

 

At first I thought it might be to big, but looking at the dll it's not that big (33k) and
the netduino plus 2 has 384kb available (?)  

 

When adding a reference to System.IO.dll instead (27kb) there are no issues (just as an example).

 

(Also I'm wondering if System.Security.dll isn't already available as part of the firmware itself)

 

So... I have no idea what's causing the issues, any suggestions?

 





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.