SDK Package R3

Hmm, executing GC after each cycle sems to extend the runtime a little bit, but after 2,5h it was not really responding anymore.
Most Network Connections were down. Only one was working a Little bit.
I got out of Memory exceptions all the time.
I connected with MFDeploy and could fetch a GC print. only 30k left.
After 1st program cycle I have about 337xxxx Bytes available.
I monitored this for half an hour and it was more or less stable (goes up and down a bit all the time).
I give it one more try. If I run out of Memory again I go back to 4.2.11.0 and try again.
Keep fingers crossed, I have to ship this on Monday. Starting on Wednesday it needs to run 24/7.

At Last I figured out what was wrong, and I hope this helps narrow down the big issue with DHCP:

the thing is that ALL MAC Addresses assigned to any NETMF Board must start with an empty byte to be accepted and assigned an IPā€¦ this is whatā€™s happening with my router and the boards belowā€¦ any MAC that doesnā€™t start (prefix) with an empty byte (hex value of 00) never receives an IP through DHCP:

Spider.
Cerbuino.
I have the hydra, Cerberus, Mountaineer but didnā€™t test them I figured the two above suffice, but I would if necessaryā€¦

here is a good MAC : 00-DD-3A-E7-9F-2E
here is a bad MAC: 8C-C2-1E-B7-82-73

so after fixing the MAC address issue, here is what happens which I canā€™t fix and GHI will need to help us figure it outā€¦

the problem is, when the board boots before it even gets to my code it sends a request for an IP, the router assigns me an IP, but when I update the MAC with a new one, the IP I received earlier lasts for 5 seconds and gets dropped which is the correct since the MAC has changed, but I never get a new IP assigned, iā€™ve tried RenewDhcpLease(); but it didnā€™t helpā€¦ so the only way to get an IP is by resetting the board with the SAME MAC ADDRESS.

now the code to generate the proper MAC Address:


          var myMac = new byte[6];
            var r = new Random();
            r.NextBytes(myMac);
            Microsoft.SPOT.Hardware.Utility.InsertValueIntoArray(myMac, 0, 1, new byte());//replace the first byte with 00 so the newly generated MAC is accepted.
            _networkInterface.PhysicalAddress = myMac;

So in Short the issue with DHCP at hand right now is :

  1. figuring out how to get a new IP Assigned after the MAC has been updated without resetting the board.
  2. Do some Error handling and notify the user when he/she tries to Assigned a MAC address that doesnā€™t respect the above findings, of course after you confirm themā€¦ to extract the first byte use this code:

var MACfstValue = Microsoft.SPOT.Hardware.Utility.ExtractValueFromArray(myMac, 0, 1);

I hope someone from GHI can confirm the above findings and find a way out :slight_smile:

Next is to figure out the Memory leak issues that may have been introduced to 4.2.11.1

Cheers,
Jay.

@ Jay Jay - you are using an invalid Mac address

Also the mac should not change on the fly without a reset. We do not support that.

Let us know if you have any other questions please.

Ok, my app ran all night with the R3 FW.
The Memory usage increased a litlle bit (120k).
This is ok so far, by this it will run about 2 weeks before I run out of RAM.

The only difference is that my own Monitoring tool, which gets the log Messages via Ethernet was not running along.
Later this will be necesarry because it is not planed to have any Computer connected to USB all the time.

What this Monitoring tool does:
It connects to a TCP Server on the G120, sets a flag that it wants log Messages and the G120 sends all Messages logged with a Special method i made to the connected Client.
There are less than 30 Messages per Minute which are quite short (less then 80 chars for the longest).

There are two possible reasons, why this Fails:
My code for that is not good (Iā€™ll check that again)
Iā€™m just at the Limit what the ENC28 and/or NW stack can take.
Iā€™ll kep you informed. If it stays like this, then Iā€™m happy :slight_smile:

My app lost about 264k ram in about 22 hours.
Most of it in Type 12 (VALUETYPE).
Can anyone give me a hint where too look for those?
Well I know what a value type is, but I thought most of them should be part of a class.
Or does this mean that I have to look for ā€˜lostā€™ structs?

Or can anyone read more out of these two GC Outputs?

26th 21:31:46.760
GC: 277msec 3957720 bytes used, 3381948 bytes available
Type 0F (STRING              ): 398724 bytes
Type 11 (CLASS               ): 1739256 bytes
Type 12 (VALUETYPE           ): 180660 bytes
Type 13 (SZARRAY             ): 845664 bytes
  Type 02 (I1                  ):     24 bytes
  Type 03 (U1                  ):   3960 bytes
  Type 04 (CHAR                ):    420 bytes
  Type 05 (I2                  ):     24 bytes
  Type 06 (U2                  ):     24 bytes
  Type 07 (I4                  ):     60 bytes
  Type 08 (U4                  ):     84 bytes
  Type 09 (R4                  ):     24 bytes
  Type 0F (STRING              ):    648 bytes
  Type 11 (CLASS               ): 840396 bytes
Type 15 (FREEBLOCK           ): 3381948 bytes
Type 17 (ASSEMBLY            ):  49332 bytes
Type 18 (WEAKCLASS           ):     48 bytes
Type 19 (REFLECTION          ):    384 bytes
Type 1B (DELEGATE_HEAD       ):   9504 bytes
Type 1C (DELEGATELIST_HEAD   ):    372 bytes
Type 1D (OBJECT_TO_EVENT     ):   1872 bytes
Type 1E (BINARY_BLOB_HEAD    ): 699300 bytes
Type 1F (THREAD              ):   7680 bytes
Type 20 (SUBTHREAD           ):    960 bytes
Type 21 (STACK_FRAME         ):  15936 bytes
Type 22 (TIMER_HEAD          ):    360 bytes
Type 26 (WAIT_FOR_OBJECT_HEAD):    384 bytes
Type 27 (FINALIZER_HEAD      ):   1344 bytes
Type 28 (MEMORY_STREAM_HEAD  ):     36 bytes
Type 29 (MEMORY_STREAM_DATA  ):    396 bytes
Type 31 (IO_PORT             ):   1476 bytes
Type 34 (APPDOMAIN_HEAD      ):     72 bytes
Type 36 (APPDOMAIN_ASSEMBLY  ):   3960 bytes
GC: performing heap compaction...

27th 19:42:59.304
GC: 300msec 4222428 bytes used, 3117240 bytes available
Type 0F (STRING              ): 399132 bytes
Type 11 (CLASS               ): 1747248 bytes
Type 12 (VALUETYPE           ): 345132 bytes
Type 13 (SZARRAY             ): 932172 bytes
  Type 02 (I1                  ):     24 bytes
  Type 03 (U1                  ):   7644 bytes
  Type 04 (CHAR                ):    444 bytes
  Type 05 (I2                  ):     24 bytes
  Type 06 (U2                  ):     24 bytes
  Type 07 (I4                  ):     60 bytes
  Type 08 (U4                  ):     84 bytes
  Type 09 (R4                  ):     24 bytes
  Type 0F (STRING              ):    540 bytes
  Type 11 (CLASS               ): 923304 bytes
Type 15 (FREEBLOCK           ): 3117240 bytes
Type 17 (ASSEMBLY            ):  49332 bytes
Type 18 (WEAKCLASS           ):     48 bytes
Type 19 (REFLECTION          ):    384 bytes
Type 1B (DELEGATE_HEAD       ):   9828 bytes
Type 1C (DELEGATELIST_HEAD   ):    372 bytes
Type 1D (OBJECT_TO_EVENT     ):   2184 bytes
Type 1E (BINARY_BLOB_HEAD    ): 698892 bytes
Type 1F (THREAD              ):   9984 bytes
Type 20 (SUBTHREAD           ):   1104 bytes
Type 21 (STACK_FRAME         ):  18396 bytes
Type 22 (TIMER_HEAD          ):    432 bytes
Type 26 (WAIT_FOR_OBJECT_HEAD):    480 bytes
Type 27 (FINALIZER_HEAD      ):   1368 bytes
Type 28 (MEMORY_STREAM_HEAD  ):     36 bytes
Type 29 (MEMORY_STREAM_DATA  ):    396 bytes
Type 31 (IO_PORT             ):   1476 bytes
Type 34 (APPDOMAIN_HEAD      ):     72 bytes
Type 36 (APPDOMAIN_ASSEMBLY  ):   3960 bytes
GC: performing heap compaction... 

@ Reinhard Ostermeier - I am not sure how I can help. Maybe comment out sections to see what causing this. But please let us know what you find if you found an answer or was able to narrow it down to a test program.

@ Gus - Iā€™m installing this at a customer site next week. Not sure how much time I can find to optimize this.
If possible I also want to make a comparing run with FW 4.2.11.0.
Iā€™ll help where I can to improve the FW. This is in my very own interest.

ENC28 now works with Raptor! ;D

It, however, doesnā€™t work with DHCP :frowning:

Hi Tom,
Can you please try setting you MAC To this address. See above for code, or use MFDEPLOYā€¦


00-DD-3A-E7-9F-2E

One you set your MAC reboot the device and let us know if DHCP worksā€¦

I may have a solution to this, i know why some MAC Addresses donā€™t work while others doā€¦

Thanksā€¦

Hi,

Quick question:

If I am upgrading my EMX applications onsite from R1 Update-1 -> R3, do I need to do a full upgrade: Config.hex + Firmware.hex + Firmware2.hex + myApp.hex or is it ok to simply deploy my rebuilt myApp.hex file?

Thanks.

The answer is yes but starting this release the config tool checks and tells you what needs to be updated.

Thanks for that.

Was hoping only to update myApp.hex as there are 100+ emx devices out on site and updating each fully takes a bit longer and increases downtime, but oh well.

I wonā€™t actually be using the config tool for the updates, instead doing remote updates via SystemUpdate code within the app itself.

But out of interest, is there a new version of the config tool available then Gus?

@ andre.m cheers, was the name change to Fez Config that threw me :slight_smile:

Iā€™m not sure if the new USB drivers are supposed to work w/ Win7 64bit but Iā€™ve had the worst time of it.

Whenever I try to program the Raptor it opens the connection, then hangs and tells me it canā€™t connect to the device. The problem is, it then keeps the USB connection open so nothing will close it until I restart my system.

Everything works fine until F5. I can ping it on MFDeploy, erase the firmware, etc.

Rolling back to the previous USB drivers fixes it.

@ Skewworks - VS2010 or VS2012? Only on FEZ Raptor?

VS2010. Raptorā€™s the only thing Iā€™m developing on at the moment. Working on a special project w/ the family :wink:

Can you try it with VS2012?

My Win7 machine doesnā€™t have 2012. My Win8 machine does but that wouldnā€™t help w/ Win7.

I can try putting 2012 on the W7 but itā€™ll have to wait for the weekend.

Does it work fine on your win8 machine with VS2012? We do not have problems with win7 but I am trying to understand what combinations work or do not work for you.

Honestly havenā€™t tried. My W8 machine is setup specifically for Win8 development at the moment, NETMF/Gadgeteer isnā€™t installed at all.

Iā€™ll try setting it up this weekend and see if I canā€™t narrow things down.