GHI's Open Source NETMF Ports

Is there any indication as to when GHI might update the codeplex sight with the latest firmware updates for the OSHW?

Hi taylorza,

The codeplex has been updated. Thank you for the gentle reminder. :slight_smile:

@ Aron - Thank you very much!!!

I just grabbed the code. And will start building now. I want to try my hand at adding a custom class so any pointers you might have would be greatly appreciated, like where to start :slight_smile:

Are you wanting to add your own Interop Library Class similar to how we have the OSHW libraries?

EDIT: Wow, I should have asked sooner :slight_smile: I got it working!!!
My first attempt I used the same prefix as GHI ie. HAL, I suspect that caused an issue. My next attempt was with a new prefix, that is when I stopped getting the NotImplementedException, but still no return value.

So what made it work, well what does any self respecting C programmer do when things do not work, you do a clean and full build :slight_smile: Hey presto, it worked. It looks like there is a dependency issue, something was not building that should build when adding new code. Now I will try modify the code and see if it picks it up without doing a clean.

[em]Yes,in fact I have made some progress with this. I have an issue however that calling into the interop code results in one of two things, either I get a NotImplementedException or the function seemingly executes but the return value is always 0 (I suspect that it is not even running my code).

Here is what I have done.

[ol]Created the managed project and generated the stubs
Copied the code from step 1 into $(SPOCLIENT)\DeviceCode\GHI\Libraries\dotnetwarrior.OSHW.System using the same structure that GHI has under this ie. Managed and Native folder.
Added the following to TinyClr.proj (C:\MicroFrameworkPK_v4_2\Solutions\FEZ_Hydra\TinyCLR\TinyCLR.proj)[/ol]

    <InteropFeature Include="GHI_OSHW_Native" />
    <InteropFeature Include="GHI_OSHW_Hardware" />
    <InteropFeature Include="dotnetwarrior_OSHW_System" />

    <DriverLibs Include="dotnetwarrior_OSHW_System.$(LIB_EXT)" />
    <RequiredProjects Include="$(SPOCLIENT)\DeviceCode\GHI\libraries\dotnetwarrior.OSHW.System\Native\dotNetMF.proj" />

Everything compiles, I check the map file and can see that my libraries have been included in the build. But when I call into the internal function I have no luck.

My internal function looks like this

INT32 FastMath::Native_Add( CLR_RT_HeapBlock* pMngObj, INT32 param0, INT32 param1, HRESULT &hr )
    INT32 retVal = param0 + param1; 
    return retVal;

All the rest of the code is the generated code from the stubs ie the marshaling code etc.

Is there something else that I need to add to a file somewhere that makes the CLR aware of my interop code?

Do you have a debugger that can step into code?

@ Aron - I have recently got a J-Link, but so far I have only used the SWD interface with the DL40. I suspect/hope I will be able to use the Jtag interface with the Hydra, but I will need to wait for the weekend before I get time to get into that.

But so far I have had success getting this going, I now have a custom interop class that does maths. Next is Ian’s SignalGenerator for the OSHW :slight_smile:

So your previous post is resolved where it now returns something other than zero?

And yes, Hydra uses the JTAG interface. You will only need to make a connector to connect to the JTAG and to socket 1 on the device. You can get the JTAG pinout online.

@ Aron - Yes thank you Aron, I did edit the post but I realized afterwards that the timeline was not clear. I should have just made a new post, sorry about that.

It works great, basically I found two things

  1. I must do a full clean and build
  2. I must restart the Hydra after deploying the new firmware

The clean/build is a bit of a pain, it takes 4.5 minutes to rebuild on my current machine.