Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. .NET Microframework

.NET Microframework

Scheduled Pinned Locked Moved The Lounge
hardwarecsharpc++cssvisual-studio
32 Posts 15 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Rob Philpott

    Has anyone used this and if so had any joy with it? It seems like a somewhat half-arsed amateur attempt to me. Maybe because it is open-source MS don't see any profitability in it. I bought a Netduino Plus 2 (32bit ARM Cortex) which is a little prototyping board which hardware wise is a complete beast in comparison to its competitor - the Arduino which is a weedy 8 bit thing. 168Mhz vs. 16Mhz with a lot more flash and RAM memory. Unfortunately though, this thing is super slow, principally because it interprets the CIL rather than Jitting it. There is a jitter in the framework source but apparently it doesn't compile and they never bothered to fix it. Also, jitting isn't ideal on flash memory as you can't replace the CIL with native instructions. This would require RAM. Add in the fact the the framework will likely consume most of your flash memory, interrupt latency of up to 20ms discounting any realtime operation (who'd want that in an embedded device) and appalling documentation on MSDN and you end up with one big turkey. To get the I2C bus working on it, you have to twiddle some private members using reflection every time you want to read/write data. So, I've given up and bought an Arduino for £10 which is likely to be quicker and £40 less expensive, and hopefully won't give me a four day headache like its counterpart. *moan over*

    Regards, Rob Philpott.

    M Offline
    M Offline
    Mathew Crothers
    wrote on last edited by
    #22

    I programmed a bit on a Netduino as well but came across the same problem. Too slow. I just did away with the .net microframework and ran native on bare metal. It ran sooooo much faster running on bare metal and was still quite usable.

    R 1 Reply Last reply
    0
    • R Rob Philpott

      Has anyone used this and if so had any joy with it? It seems like a somewhat half-arsed amateur attempt to me. Maybe because it is open-source MS don't see any profitability in it. I bought a Netduino Plus 2 (32bit ARM Cortex) which is a little prototyping board which hardware wise is a complete beast in comparison to its competitor - the Arduino which is a weedy 8 bit thing. 168Mhz vs. 16Mhz with a lot more flash and RAM memory. Unfortunately though, this thing is super slow, principally because it interprets the CIL rather than Jitting it. There is a jitter in the framework source but apparently it doesn't compile and they never bothered to fix it. Also, jitting isn't ideal on flash memory as you can't replace the CIL with native instructions. This would require RAM. Add in the fact the the framework will likely consume most of your flash memory, interrupt latency of up to 20ms discounting any realtime operation (who'd want that in an embedded device) and appalling documentation on MSDN and you end up with one big turkey. To get the I2C bus working on it, you have to twiddle some private members using reflection every time you want to read/write data. So, I've given up and bought an Arduino for £10 which is likely to be quicker and £40 less expensive, and hopefully won't give me a four day headache like its counterpart. *moan over*

      Regards, Rob Philpott.

      J Offline
      J Offline
      Jan Kucera
      wrote on last edited by
      #23

      The .NET MF is here for like 8 years, came from commercial product and was close-sourced for couple of years, so I wouldn't exactly say half-arsed amateur attempt. Jitter was considered and tested in the past, that's why it is in the source. However as you noted yourself, it turned out not to be ideal (and resulted in overall worse performance), so it wasn't kept up to date with new memory model and other changes on the way. The framework was designed from the very beginning not to be realtime and any expectations in this regard must ultimately fail, indeed. There are lots of embedded applications that do not need realtime operation. The MSDN documentation is absolutely outdated though, I am with you on this. As for your I2C experience, the only private members of I2C stuff is the I2CDevice.Initialize method which is called by constructor and m_xAction with [FieldNoReflection] attribute so I am not really sure what do you mean by this as there is quite nothing you gain using reflection. Arduino is cheaper and quicker at running, for sure. But it does not have the framework - web services, user interface, SSL, reflection, XML, Unicode and more. That stuff costs space and speed.

      R 1 Reply Last reply
      0
      • M Mathew Crothers

        I programmed a bit on a Netduino as well but came across the same problem. Too slow. I just did away with the .net microframework and ran native on bare metal. It ran sooooo much faster running on bare metal and was still quite usable.

        R Offline
        R Offline
        Rob Philpott
        wrote on last edited by
        #24

        Nice! May I ask how you did that? i.e. what tools/platform you used. I'm toying with this idea as well. My concern is how to get the code on it. Wiping the flash with the 3.3v lead each time you want to deploy doesn't sound great so I guess some sort of bootloader on device might be a good idea.

        Regards, Rob Philpott.

        M 1 Reply Last reply
        0
        • J Jan Kucera

          The .NET MF is here for like 8 years, came from commercial product and was close-sourced for couple of years, so I wouldn't exactly say half-arsed amateur attempt. Jitter was considered and tested in the past, that's why it is in the source. However as you noted yourself, it turned out not to be ideal (and resulted in overall worse performance), so it wasn't kept up to date with new memory model and other changes on the way. The framework was designed from the very beginning not to be realtime and any expectations in this regard must ultimately fail, indeed. There are lots of embedded applications that do not need realtime operation. The MSDN documentation is absolutely outdated though, I am with you on this. As for your I2C experience, the only private members of I2C stuff is the I2CDevice.Initialize method which is called by constructor and m_xAction with [FieldNoReflection] attribute so I am not really sure what do you mean by this as there is quite nothing you gain using reflection. Arduino is cheaper and quicker at running, for sure. But it does not have the framework - web services, user interface, SSL, reflection, XML, Unicode and more. That stuff costs space and speed.

          R Offline
          R Offline
          Rob Philpott
          wrote on last edited by
          #25

          I absolutely love the .NET Framework, it's a thing of beauty. I am also a fan of ARM microprocessors and started using them pretty much the moment they arrived in the 80s. It should be a marriage made in heaven. But here's the thing. I read somewhere that a simple Int32.ToString() wasn't fast in netmf, so I tested it. A for loop 0 to 999, in the loop a line to convert the iterator to a string. LED on, then the same thing again, LED off. When running this, the LED blinks at a rate of about twice a second, implying that the code can execute about 4000 iterations a second. 4000 Int32.ToString()s a second on a 168MHz processor. That IMO can only be described as catastrophic performance. As far as the I2C bus goes, I just couldn't get it to work no matter what I tried. See here: http://forums.netduino.com/index.php?/topic/944-i2c-internaladdress-repeated-start-bit-support/[^] When I tried this reflection it couldn't find the private members, and I've checked the source and they don't seem to be there in any version, so I am currently at a complete loss. I might be being thick but I've just lost patience with the thing. Even if I can get it to work it's not going to be quick enough.

          Regards, Rob Philpott.

          1 Reply Last reply
          0
          • R Rob Philpott

            Has anyone used this and if so had any joy with it? It seems like a somewhat half-arsed amateur attempt to me. Maybe because it is open-source MS don't see any profitability in it. I bought a Netduino Plus 2 (32bit ARM Cortex) which is a little prototyping board which hardware wise is a complete beast in comparison to its competitor - the Arduino which is a weedy 8 bit thing. 168Mhz vs. 16Mhz with a lot more flash and RAM memory. Unfortunately though, this thing is super slow, principally because it interprets the CIL rather than Jitting it. There is a jitter in the framework source but apparently it doesn't compile and they never bothered to fix it. Also, jitting isn't ideal on flash memory as you can't replace the CIL with native instructions. This would require RAM. Add in the fact the the framework will likely consume most of your flash memory, interrupt latency of up to 20ms discounting any realtime operation (who'd want that in an embedded device) and appalling documentation on MSDN and you end up with one big turkey. To get the I2C bus working on it, you have to twiddle some private members using reflection every time you want to read/write data. So, I've given up and bought an Arduino for £10 which is likely to be quicker and £40 less expensive, and hopefully won't give me a four day headache like its counterpart. *moan over*

            Regards, Rob Philpott.

            F Offline
            F Offline
            Fabio Franco
            wrote on last edited by
            #26

            I did use the net duino plus (v1) with the .net micro framework, it made it very easy to program it. It was a simple project with a ultrasonic distance sensor and a 3 line LCD to display information. Didn't have any performance issues, but I guess it maybe because I never built any complex, performance dependent algorithms to use with it.

            To alcohol! The cause of, and solution to, all of life's problems - Homer Simpson ---- Our heads are round so our thoughts can change direction - Francis Picabia

            1 Reply Last reply
            0
            • R Rob Philpott

              Has anyone used this and if so had any joy with it? It seems like a somewhat half-arsed amateur attempt to me. Maybe because it is open-source MS don't see any profitability in it. I bought a Netduino Plus 2 (32bit ARM Cortex) which is a little prototyping board which hardware wise is a complete beast in comparison to its competitor - the Arduino which is a weedy 8 bit thing. 168Mhz vs. 16Mhz with a lot more flash and RAM memory. Unfortunately though, this thing is super slow, principally because it interprets the CIL rather than Jitting it. There is a jitter in the framework source but apparently it doesn't compile and they never bothered to fix it. Also, jitting isn't ideal on flash memory as you can't replace the CIL with native instructions. This would require RAM. Add in the fact the the framework will likely consume most of your flash memory, interrupt latency of up to 20ms discounting any realtime operation (who'd want that in an embedded device) and appalling documentation on MSDN and you end up with one big turkey. To get the I2C bus working on it, you have to twiddle some private members using reflection every time you want to read/write data. So, I've given up and bought an Arduino for £10 which is likely to be quicker and £40 less expensive, and hopefully won't give me a four day headache like its counterpart. *moan over*

              Regards, Rob Philpott.

              N Offline
              N Offline
              Nicolas Dorier
              wrote on last edited by
              #27

              Upgrading your car with .NET Micro Framework[^] ;)

              1 Reply Last reply
              0
              • R Rob Philpott

                Has anyone used this and if so had any joy with it? It seems like a somewhat half-arsed amateur attempt to me. Maybe because it is open-source MS don't see any profitability in it. I bought a Netduino Plus 2 (32bit ARM Cortex) which is a little prototyping board which hardware wise is a complete beast in comparison to its competitor - the Arduino which is a weedy 8 bit thing. 168Mhz vs. 16Mhz with a lot more flash and RAM memory. Unfortunately though, this thing is super slow, principally because it interprets the CIL rather than Jitting it. There is a jitter in the framework source but apparently it doesn't compile and they never bothered to fix it. Also, jitting isn't ideal on flash memory as you can't replace the CIL with native instructions. This would require RAM. Add in the fact the the framework will likely consume most of your flash memory, interrupt latency of up to 20ms discounting any realtime operation (who'd want that in an embedded device) and appalling documentation on MSDN and you end up with one big turkey. To get the I2C bus working on it, you have to twiddle some private members using reflection every time you want to read/write data. So, I've given up and bought an Arduino for £10 which is likely to be quicker and £40 less expensive, and hopefully won't give me a four day headache like its counterpart. *moan over*

                Regards, Rob Philpott.

                M Offline
                M Offline
                Marcel Derrmann
                wrote on last edited by
                #28

                Hello Rob, You might want to try out Atmels "AtmelStudio" IDE. It is based on MS Visual Studio, has a sensible debugger, and is a free (free means: you trade in some personal data) download. It covers most, if not all Atmel ARM products as well as the 8/32 bit Atmel cores, and the Arduino too. Use it to code in C/C++. Compiling native code, it comes without all the .NET runtime overhead. See "http://www.atmel.com/technologies/cpu\_core/arm.aspx".

                1 Reply Last reply
                0
                • R Rob Philpott

                  Nice! May I ask how you did that? i.e. what tools/platform you used. I'm toying with this idea as well. My concern is how to get the code on it. Wiping the flash with the 3.3v lead each time you want to deploy doesn't sound great so I guess some sort of bootloader on device might be a good idea.

                  Regards, Rob Philpott.

                  M Offline
                  M Offline
                  Mathew Crothers
                  wrote on last edited by
                  #29

                  Rob, I used the Yagarto toolchain with Eclipse IDE. I did have to wipe the flash everytime before doing an upload and because there was no built in JTAG interface is was difficult to debug programs but I did manage to control a Ninco slot car race track with it which couldn't be done using the .NET microframework. There is a good SDK you can download from ATMEL that will help with controlling the GPIO ports. Check out this page to download http://www.atmel.com/devices/SAM7X512.aspx?tab=overview[^]

                  R 1 Reply Last reply
                  0
                  • R Rob Philpott

                    I agree - I think you've hit the nail on the head there. This may sound odd, but the reason I try to avoid C++ is header files. It drives me mad having to put stuff in two places for every method you create. But that said, it'd be nice to look at a hex display of some memory at a memory address again rather than a kindergarten .NET byte array!

                    Regards, Rob Philpott.

                    R Offline
                    R Offline
                    RandyWester
                    wrote on last edited by
                    #30

                    I think that requiring the declaration in the header was once upon a time required so that the compiler could work with only a small amount of working memory. And more easily and quickly, from punch cards, or paper / magnetic tape.

                    1 Reply Last reply
                    0
                    • M Mathew Crothers

                      Rob, I used the Yagarto toolchain with Eclipse IDE. I did have to wipe the flash everytime before doing an upload and because there was no built in JTAG interface is was difficult to debug programs but I did manage to control a Ninco slot car race track with it which couldn't be done using the .NET microframework. There is a good SDK you can download from ATMEL that will help with controlling the GPIO ports. Check out this page to download http://www.atmel.com/devices/SAM7X512.aspx?tab=overview[^]

                      R Offline
                      R Offline
                      Rob Philpott
                      wrote on last edited by
                      #31

                      Nice one Mathew, thank you. After much distress I've got eclipse and Yagarto working now. I had to remind myself how makefiles work having not used one in 20 years. Strange how I never missed them..... It'd be good to get C++ working and I have in a sense, but without any standard library. So there is no heap, no malloc and no new operators so its a bit useless at the moment. Still thinking about what to do there. Will check the link too. Cheers.

                      Regards, Rob Philpott.

                      1 Reply Last reply
                      0
                      • L Lost User

                        BobJanova wrote:

                        A VM is fundamentally the wrong approach for an embedded device

                        I think it is too expensive to write everything in assembler. Mono works just fine on the Raspberry.

                        Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

                        B Offline
                        B Offline
                        BobJanova
                        wrote on last edited by
                        #32

                        As Lloyd says, a Pi is a small computer, not an embedded device. Check its specs versus that of an Arduino, for example. A Pi does have memory and CPU constraints but no worse than the devices the early .Net Framework and certainly the Compact Framework were originally designed for.

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups