Clarifications re how to build NETMF 4.4



@ Cuno - Thanks for sharing :slight_smile:

Stupid question.

I was able to follow the getting started guide on github and I cloned the repository and I’m able to successfully build the 4.4 framework on my local machine. So that’s good.

But if I try to open the TinyCLR.sln in visual studio it won’t load. Visual studio wants to upgrade the projects and they all fail to upgrade. Is there something I’m missing? The getting started guide doesn’t talk about how to actually open the solution file and browse the code. I’m guessing NETMF wasn’t developed in notepad, they must be using an IDE and I assume is VS.

Is there a solution file which loads up the NETMF source projects?

@ PhilH - Steve Maillet said in issue 18 (Files that do not exist in the TinyCLR_server.sln have been defined. · Issue #18 · NETMF/netmf-interpreter · GitHub):

[quote]TinyCLR_Server.sln isn’t really a supported solution, you can’t build it so at best it was a code navigation tool, but over the years was not maintained or kept up. At this point it’s debatable whether just deleting it or spending the effort to figure out all the missing content (or extra content) etc… is a better choice as it will always be a manual process until such time as we have shifted the build to where we can build the framework directly in VS.[/quote]I guess the same applies to TinyCLR.sln.

Hmm thanks. Makes it kinda painful to work with the source if you don’t have a solution file to tie the whole mess together. That and I’ve become kind of dependent on tools like go to definition and find all references.

The getting started wiki page on github makes it clear that there are a number of outdated tutorials about NETMF out there and that many are not applicable to 4.4 and later. Then it goes on to explain how to run the build process, but that’s only helpful if you want to build whats already in the repository.

If someone was new to the NETMF community and wanted to contribute, how would that person know where to begin with just a mess of files and no solution or project to tie it all together?

Seems that no one is willing or having the time to go through the effort in making a kind of “Dummies guide to build Netmf 4.4” yet …

So I guess a couple of people are on their own for the time beying … hope this will be a short as possible …

I for my part am looking for either an 4.3.1 update or for the new 4.4. port to the STM32F429I-DISCO

Reverting back to VS2012 and 4.3.0 is an option but I’d rather choose not to take that route …

Anybody ?

@ PiWi - Have you read Getting Started · NETMF/netmf-interpreter Wiki · GitHub ?

The SDK build process is rather straightforward: get the prerequisites, then build_sdk.cmd. To build a firmware solution, setenv_mdk or setenv_gcc (requires GCC 4.9.3 from GNU Arm Embedded Toolchain in Launchpad), then msbuild Solutions.…


@ CW2 - The SDK Build did go but corrupted my system in such a way that I had to remove it and reinstall 4.3.1 for the gcc build I have to give it a new go since the last time I tried it gave me just like pages of errors … although that is some time back … I’ll try again than … thanks for the updates … the stm32f407 discovery board is on its way too to play around with …

@ CW2 - Build succeeded for Solutions\Windows2 with gcc 4.9.3 … Cool thanks … took about 12 - 14 mins to build

Ehm, forgive me the maybe obvious question but to what HW can that be deployed (and how ?)

[Update] Oops, build for the MCBSTM32F400 resulted in 434 errors … and that’s exactly where it stopped last time … :wall:

@ Me - Ehm, you’d better use the Support-GCC branch if looking for building for the STM32F4DISCOVERY board :wall:

And the build succeeded for 4.4 and resulted in binaries ready for deployment … yoohoo, finally.

Now waiting for the board itself to arrive and test this all out …

PS. What deployment tool is there to advise … currently I’m using see picture …

1 Like

@ PiWi - Yes, the solution for STM32F4DISCOVERY is in Support-GCC branch. Unfortunately, there is currently an error that causes USB malfunction (see Support-GCC: Broken USB enumeration due to invalid wchar_t size · Issue #193 · NETMF/netmf-interpreter · GitHub), but I already have a working fix ready. So you’d need to fix it manually, or wait a little bit, or build version before 6/15/2015.

Yes, the easiest way to flash TinyBooter is to use onboard ST-LINK via “STM32 ST-LINK Utility” application. Alternatively, you can use DFU: create .dfu file and then switch ROM bootloader on (connect BOOT0 pin to VDD) and then use “DfuSe Demo” application to flash it.

Also, I have almost finalized solution for Wrong C# long and double formatting in GCC build with newlib-nano · Issue #164 · NETMF/netmf-interpreter · GitHub

@ CW2 - Thanks for the info and links. Since the physical HW is not in yet, I guess I can wait for a bit or i’ll try to take the ones from here

Is it correct for the SDK build to exit like in the picture ? No stats ?
I’ve gotten some yellow warnings as well, about some overflow error not being trapped ?

But in the end, all deliverables (bin, hex, MSI, VSIX) were generated and are awaiting to be deployed … what comes out of that we’ll see in the next few days when the board arives …

@ PiWi - Yesterday i gave it a try too using MDK for F400, compiled without errors. Flashed tinybooter using STM32 ST-Link Utility to a 429Discovery board. PC does not see the USB device. Not sure yet if 429 is compatible enough with the F407 or of if the firmware expect serial connection instead of USB. Ordered a 407 board today and will see if that works. Will dive into the datasheets.

The real challenge however is still to come and that is writing and debugging custom hardware drivers :wink:

Hello All,

I do have a question about the netmf 4.4 source code (DISCOVERYSTM32)

File: C:\dotNet44\netmf-interpreter-dev\DeviceCode\Targets\Native\STM32F4\DeviceCode\STM32F4_power\STM32F4_Power_functions.cpp

The statement: " __BKPT(0);"

is some sort of macro to insert an inline assembler code to cause a breakpoint.

This does not compile for MDK5.05. Does anyone know the correct syntax for Keil MDK 5.05?


@ Dale Lyons - line is correct - works fine here with MDK5.x

Must be other fluff in the clack valve…

What is the error the compiler gives you?

@ Dale Lyons - You are most likely missing the CMSIS package. There was Install-CMSIS.ps1 script introduced in a recent change that should do it (I have not tested it myself though).

Just to clarify, I do have CMSIS installed. I can build the dotnet 4.4, deploy and run netmf programs.
I need to comment out the BKPT instruction in order to get a good build.

I have seen the BKPT macro defined in the CMSIS code however I am not sure how to include it properly.


this is the actual code:

void HAL_AssertEx()
while(true) { /nop/ }

this is the compiler output:

“C:\dotNet44\netmf-interpreter-dev\DeviceCode\Targets\Native\STM32F4\DeviceCode\STM32F4_power\STM32F4_Power_functions.cpp”, line 123: Error: #20: identifier “__BKPT” is undefined

And the monster compiler statement:

“C:\Keil_v5\ARM\ARMCC\bin\armcc.exe” --cpp --diag_suppress 2874,111,161,550,C3011,C4052 --diag_suppress 66,161,230,1293 --split_sections -DMDK_V3_1 -DARM_V3_1 --feedback C:\dotNet44\netmf-interpreter-dev\tools\make\Feedback\ -DHAL_REDUCESIZE -DTINYCLR_ENABLE_SOURCELEVELDEBUGGING -DCOMPILE_THUMB2 -DVERSION_MAJOR=4 -DVERSION_MINOR=4 -DVERSION_BUILD=0 -DVERSION_REVISION=0 -DOEMSYSTEMINFOSTRING="“STM32F4DISCOVERY by CW2"” -DPLATFORM_ARM_STM32F4DISCOVERY -DTARGETLOCATION_FLASH -DLITTLE_ENDIAN -D__CORTEX_M4F -DCORTEX_M4 --cpu Cortex-M4.fp --littleend -g -O0 --inline -DDEBUG -D_DEBUG -IC:\dotNet44\netmf-interpreter-dev\DeviceCode\Targets\Native\STM32F4\DeviceCode\STM32F4_Power -IC:\dotNet44\netmf-interpreter-dev\DeviceCode\include -IC:\dotNet44\netmf-interpreter-dev\DeviceCode\Cores\arm -IC:\dotNet44\netmf-interpreter-dev\Support\Include -IC:\dotNet44\netmf-interpreter-dev\crypto\inc -IC:\dotNet44\netmf-interpreter-dev\CLR\Include -IC:\dotNet44\netmf-interpreter-dev\CLR\Libraries\CorLib -IC:\dotNet44\netmf-interpreter-dev\CLR\Libraries\SPOT -IC:\dotNet44\netmf-interpreter-dev\CLR\Libraries\SPOT_Hardware -IC:\dotNet44\netmf-interpreter-dev\CLR\Libraries\SPOT_Graphics -IC:\dotNet44\netmf-interpreter-dev\CLR\Libraries\SPOT_Net -IC:\dotNet44\netmf-interpreter-dev\CLR\Libraries\SPOT_Net_Security -IC:\dotNet44\netmf-interpreter-dev\Solutions\STM32F4DISCOVERY -IC:\dotNet44\netmf-interpreter-dev\Devicecode\Targets\Native\STM32F4 -IC:\dotNet44\netmf-interpreter-dev\DeviceCode\Targets\Native\STM32F4\DeviceCode -IC:\dotNet44\netmf-interpreter-dev\CMSIS\CMSIS\Include -IC:\dotNet44\netmf-interpreter-dev\DeviceCode\Cores\arm -IC:\dotNet44\netmf-interpreter-dev\DeviceCode\Cores\arm\Include -IC:\dotNet44\netmf-interpreter-dev\DeviceCode -IC:\dotNet44\netmf-interpreter-dev\DeviceCode\Include -IC:\dotNet44\netmf-interpreter-dev\DeviceCode\Targets\Native\STM32F4\STM32F4DISCOVERY -IC:\dotNet44\netmf-interpreter-dev\Support\Include -IC:\dotNet44\netmf-interpreter-dev\DeviceCode\include -IC:\dotNet44\netmf-interpreter-dev\CLR\include -IC:\dotNet44\netmf-interpreter-dev\Crypto\inc -IC:\dotNet44\netmf-interpreter-dev\BuildOutput\THUMB2FP\MDK5.05\le\ANY_MEDIA\debug\lib -IC:\Keil_v5\ARM\RV31\INC -o C:\dotNet44\netmf-interpreter-dev\BuildOutput\THUMB2FP\MDK5.05\le\FLASH\debug\STM32F4DISCOVERY\obj\DeviceCode\Targets\Native\STM32F4\DeviceCode\STM32F4_Power\STM32F4_Power_functions.obj -c C:\dotNet44\netmf-interpreter-dev\DeviceCode\Targets\Native\STM32F4\DeviceCode\STM32F4_power\STM32F4_Power_functions.cpp

I took a look at the STM targets at

and replaced the HAL_AssertEx() function with:

__asm void HAL_AssertEx()
L1 B L1
BX lr

and compiles fine. now.
I will try some testing and see if this actually works.