
Questions about Netduino+2, realtime and netmf
#1
Posted 26 November 2012 - 09:51 AM
#2
Posted 26 November 2012 - 03:41 PM
Hi ElleNearMelloIs it possibile to have a "task layer" that switches task, even if no realtime will be garantied?
The superloop is easy for simple programs, but is a failure for more complex projects.
Don't you think it's better to organize code in "tasks" (each of which is a while(1)) that netmf switches automatically every 20ms?
...
If I have a Cortex M4 without FPU, will it work? Or a cortex M3?
Welcome to the Netduino forum!
As a partial answer to your questions:
NETMF supports multithreading, and NETMF threads are in fact relatively inexpensive. Incidentally, the NETMF scheduler switches threads every 20 ms. So I guess the task layer that you mention is already built in. See http://blogs.msdn.co...s-in-netmf.aspx for an introduction to NETMF threads.
There is Cortex-M3 / M4 support for NETMF, in our NETMF for STM32 port (http://netmf4stm32.codeplex.com/). From a NETMF porting perspective, M3 and M4 are the same, modulo compiler switches in the ARM tool chain (e.g., to use the single-precision FPU in the STM32F4). You can also work with MCUs that have no hardware floating-point support. Here some more information: http://www.codeplex....wnloadId=390434
Best regards
Cuno
#3
Posted 26 November 2012 - 04:16 PM
1. Where is the advantage of using netmf over C for microcontrollers?
Given that micro-controllers are very small and "simple", it's not so hard to develop firmware with various IDE (keil and eclipse are my favourite).
I think visual studio is superior, some IDE are really obsolete (expecially in the 8-bit microcontroller's world), but overall I can see that developing in C is not that hard-for-nerds-only, even on bare-metal with "superloop" architecture (that is "while(1) + interrupts") or with small real time OS (freeRtos).
People are often frightened by struct, enum, bit-aritmetic, but it is really easy.
So where are the advantages of netmf? considered that netfm eats up significant resources (ram + flash space + cpu cicles) off an alreay limited device.
Also welcome in the Netduino world.
This question could be answered thinking how long (i.e. expensive) takes writing a relatively complex application. Of course, if you just wanna blink a led the NetMF is an overkill, but what if you want to create a small app collecting data and exposing a simple web-service/page?
If you don't like this answer, I'll make this one for you: if you were creating a desktop Windows application, would you use C/C++ or C#?
Cheers
#4
Posted 26 November 2012 - 04:21 PM
#5
Posted 26 November 2012 - 08:51 PM
#6
Posted 26 November 2012 - 10:05 PM
#7
Posted 27 November 2012 - 08:07 AM

#8
Posted 27 November 2012 - 08:26 AM
1) correctSo for example if I am interested in this:
STM32F051R8T6 ARM Cortex-M0 32-bit microcontroller with 64KB of Flash memory
1) it is not enought to run netmf
2) if I want to develop on that cortex-m0 my only option is to buy expensive compiler suite + ide, for example Keil has the free limited to only 32kb. The first option is the "basic" @ 2000euros![]()
correct?
so with netmf I spend a little more on CPU (Cortex M4 is 7$ for 1000pcs), but I save huge on IDE+tools?
2) wrong. You can go with the free and open alternative: gcc toolchain for arm + openocd + eclipse cdt. Just takes a little more work and knowledge to get things up and running. There are also other free "bundles", such as CoIDE(http://coocox.org/)
#9
Posted 27 November 2012 - 08:42 AM
Free size-limited toolchains are fine for most of the hobby development, especially when you work with a microcontroller that has less flash than the limit. Beware of the license though, usually it does not allow commercial development.
You can use free Visual C#/VB.NET 2010 Express or any higher Visual Studio 2010 edition to develop .NET Micro Framework applications, Visual Studio 2012 will be supported in .NET MF 4.3. There is also experimental Mono support. But in case you want to modify the firmware, you'd need one of the ARM toolchains mentioned above, most likely very expensive one for Netduino/Mini/Plus (due to limited flash size), the firmware for STM32Fx can be developed using GCC-based toolchains.
#10
Posted 08 March 2013 - 09:24 PM
#11
Posted 12 March 2013 - 02:42 AM
...i now stumbled around for at least an our to find some information about freertos and how to install it on the net+2 - maybe someone could...
you may be the one! Its certainly doable (dumping the netmf and going native), though I think most folks stick with the netmf because thats why they're here to begin with -- for the dotnet. but the netduino is a perfectly lovely hardware platform in its own right irrespective of netmf, and certainly deserves some lower-level love.
I have used FreeRTOS, but not on the ST32F4 (I used it on a PIC32, with way less resources than the st32fx). Its quite serviceable for many applicaitons and the price is right, and I really enjoyed having tasks and not having to write yet another timer isr task manager myself. A lot.
That being said -- and I am not a dotnet fanboy by trade -- event more so I really really really like having the high level constructs of threads, synchronization objects, exceptions, string manipulation routines (its the little things in life), regexes (gasp!) at my disposal in an embedded environment. Its so luxurious I feel ashamed at times.
both have their merit; but if you can afford the time to try some new things, I do recommend you try the netmf way. and this is coming from a sceptic!
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users