.NET for the STM32 F4 Discovery board

Here’s a technique that will let you use the .NET framework on an STM32 Discovery board. [Singular Engineer] was happy to learn that the .NET Micro Framework had been ported for STM32 chips. It’s doesn’t look like the port has hit a stable version yet, but these instructions will be enough to get you up and running. This lets you use managed code in the C# language to program an embedded device: the STM32 F4 Discovery board.

After flashing a new bootloader to the board a driver needs to be added for Windows to communicate with it. Above you can see that the board will enumerate as ‘STM32 .Net Test’. Once the driver is installed the rest of the firmware can be loaded on the board using a GUI supplied with the NETMF for STM32 package. That takes care of prepping the hardware, the rest is a painless process of configuring Visual Studio to use the board as a target. The ‘Hello World’ application then uses C# to blink an LED.

Comments

  1. Jeff Patton says:

    Hot damn! When my boards eventually arrive, I will certainly give this a go!

  2. Necromant says:

    OMG! Not this sh*t.

  3. Tom says:

    Awesome. This could not have come at a better time! My department just got a .NET gadgeteer kit to play with, so I have Visual Studio set up already.

    I’ll definitely be giving this a try tomorrow with my F4 board!

  4. qwerty says:

    Same as Java on MCUs: two thumbs up for the effort, a dozen thumbs down for the implications.

  5. Radix says:

    Curious on the memory requirements to implement this on micro without 1MB of flash.
    Also wondering how precise this could be time-wise for a real time system.

  6. akismet-40ce12ddb2623e473d03ba906b3f75cb says:

    There already is a STM32 board running .NET MF: the Netduino Go…

  7. eroomde says:

    Next on hackaday, how to modify the the controls of a passenger airliner so your dog can fly one!

  8. George says:

    Ugh. Do not want. The only reason an engineer would use this is because they learned C# as their first language and are too inflexible to move on. From an embedded systems standpoint, if I hired someone to design something and they based a prototype on .NET, I’d find someone else because I wouldn’t want my product chained to Microsoft.

    • qwerty says:

      I would be VERY suspicious of an engineer working in embedded electronics who knows C# or Java as their first language.

      • Anjello says:

        Those programmers didn`t learn half of the programming – memory management. .Net is so popular because M$ needs to be in full control of everything – from tools to the final products; to capture and reimplement every good idea into their software and to kill other software companies by offering Everything from One company – better integrated with .. itself`s products.

  9. Skewworks says:

    So odd to see so much hostility towards any NETMF posts here on hack-a-day. You’d think anything that made it easier for more people to hack would be welcomed.

    Yes NETMF is going to chew up more resources that compiling code with GCC. You know what else it’s going to do? Let my 9 year old son program a device with a 7 inch multi-touch cap screen to play pac-man in under an hour.

    It also reduces development costs for companies where .NET programmers are much more plentiful in the job market.

    • Radix says:

      Job security, we can’t have 9 year olds taking our jobs away!
      But seriously with highly spec’d micros getting cheaper and cheaper, you might as well throw all this crap on to blink a light when the HW cost the same or less. That leaves development cost to cut, which I would imagine is a big incentive to use something like this.

    • Aaron says:

      “You’d think anything that made it easier for more people to hack would be welcomed.”

      I think you hit the nail on the head. :)

      In the mid-90s, I developed network software for Win95 that provided a TCP/IP stack and a winsock.dll. Microsoft decided to eliminate all third party network software on Windows and added code to Win98 to treat third-party commercial TCP/IP stacks as viruses and remove them if a windows user purchased and tried to install one. It killed a $20 million-a-year product and 70 programmers’ jobs. Other companies in the same space were hit much harder. Some ceased to exist. 6 months later, the DoJ went after Microsoft for similar practices in that and lots of other areas, but the damage was done and the lesson was clear – think carefully before you do anything that makes you (or your 9 year old son) dependent on Microsoft, because they will destroy a platform that you have come to depend on without hesitation if they think it’s strategic or means another dollar for them if they do. As to the value of .NET and C#, remember how they came into being. It was not a technological advance, it was a paranoid reaction to the threat that Microsoft perceived Java to be. Nowadays, .NET is about about lock-in. Making it easier for people to hack is not what .NET is about, and that’s why you’ll see some hostility toward it from some people. That’s not to say that it doesn’t have good things going for it or that it’s not useful – just go into it knowing what the deal really is.

      • Kris Lee says:

        You are so true. This is the reason I avoid developing anything that runs only on MS platform like a plague.

        Unfortunately I am afraid that the same fate follows the Java because of Oracle.

      • Skewworks says:

        And Apple uses forced child labor. Your example, 2 decades ago. My example, today.

        As soon as you have a large corporation it will do something bad eventually. Not if, when. The hope is that eventually they care enough to fix it.

  10. mikep says:

    The Netduino Go (http://netduino.com/netduinogo/specs.htm) has been out for a few months and is based on the same chip. You have about 100KB of RAM and 384KB of ROM left over for your own code. Having the NETMF on these boards is not so much intended for real-time processing but rather tasks that are not time-critical. And you get the conveniences of the .net Micro Framework (threads, garbage collection, C#) and debugging with Visual Studio. It’s probably even fast enough for home automation or simple robots.

  11. luuko says:

    Points to the first person to get a Java JVM written in csharp running on it.

  12. Anjello says:

    This is crazy. Something as useful as this:
    A genius guy made ARM emulator on ATiny with sdram tied to gpios.
    It booted Linux kernel in 4 hours.
    [http://dmitry.co/index.php?p=./04.Thoughts/08.%20uM0]

  13. Pedantite says:

    This is pretty cool, I did the same thing, for experimenting, but ultimately slapped ChibiOS/RT on it, which has really solid support for this board, and has a really nice balance between system abstraction and letting you get “as close to the metal” as you want. .Net is more slanted toward abstraction, though you can also get very low level.

    I was going to respond negatively to the negative reaction to .Net, but I put it on my blog instead.

  14. NewCommentor1283 says:

    .NET on a uC ??? you GOT to be kidding me!

    okay, so skipping the trolling/hate/insults/ect…

    most people who program uC’s as a hobby do so
    TO GET AWAY FROM THE BLASTED .NET !!!

    it’s a ploy to get you to buy 19$ uC’s PLUS THE COST OF A SOFTWARE/FIRMWARE LICENSE, instead of 1.5$ uC’s. and its a ploy to get you to buy the newest version of windows for your desktop computer, without the newest .NET updates, you’d never be able to communicate with the darn chip, and everytyhing on the internet the chip USED to work with is now broken! why? cuz u need .NET update, which is 3x larger file then before. so you need uC with 367mb so install .NET, before it was 100mb.

    when the update hits the net, anyone selling a cheap(er) uC go out of buisness overnight, why? the .NET is too old and the chip wont accept the newest update.

    now you can ONLY flash an LED with a powerful uC and all the hurt script kiddies rejoyce because they are now better then (real) hard-core programmers.

    whoever invented this is either working for microsoft, butthurt, or just plain evil.

    PS: cool internet radio thingy, it will last as long as microsoft holds off the next .NET update, then its garbage or scrap.

    PPS: im FUMING mad at whoever invented .NET for uC, and im SO mad i wont begin to describe, i’d go to jail, or just get banned. im sure there are people who feel the same way

    even in his demo-picture it says error, maybe we can call it “.NETRROR”

    • karllukacs says:

      NewCommentor1283,

      Your comment makes absolutely no sense whatsoever. Have you actually worked with .NET Micro Framework?
      Obviously not. FYI, it is open sourced under the Apache License, but I guess that is just another ploy.

  15. What about the FEZ Cerberus from GHI Electronics.
    That one is using the STM32F4 device.

    They have actually also made a page describing how to install their .NETMF port to the STM32F4DISCOVERY board: http://wiki.tinyclr.com/index.php?title=FEZ_Cerberus_Firmware_On_Discovery

  16. Angello says:

    .Net is not to allow people to hack but the opposite – to hide the know-how and hardware behind a thick layer of API for “everything” over the WinAPI layer over the HAL miniports layer over the…. So one to be unable to create something w/o them.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 97,808 other followers