.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.

29 thoughts on “.NET For The STM32 F4 Discovery Board

  1. 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!

  2. 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.

      1. 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.

  3. 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.

    1. 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.

    2. “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.

      1. 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.

      2. 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.

  4. 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.

  5. 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.

  6. .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”

    1. 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.

  7. .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 to akismet-40ce12ddb2623e473d03ba906b3f75cbCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.