Mountaineer.Stm32.Hardware namespace?


So I got my hands on the Mountaineer Ethernet Mainboard. I’m using it as an early prototype board for a project at my school regarding home automation.

Because it’s a school project I want to keep it as much “plain vanilla NETMF” as possible. To initialize I/O ports I downloaded the Mountaineer.Netmf.Hardware namespace from but this is obviously “socket-oriented”. In the documentation at the top it says:

“4) For “plain vanilla” NETMF programs, without Gadgeteer libraries
/// but with a microcontroller pin-oriented view on hardware features:
/// You want your application to directly depend on the
/// microcontroller’s pinout only, so that you can most easily
/// migrate to a custom board with the same microcontroller
/// later on.
/// Use the Mountaineer.Stm32.Hardware namespace.
/// With that approach, you don’t need this namespace here.”

The only problem is that I can’t find the Mountaineer.Stm32.Hardware namespace anywhere. Anyone have an idea/download link?

Best regards
Troels Vest

Google for “using Mountaineer.Stm32.Hardware” got me here where I saw

using using Microsoft.SPOT.Hardware.STM32F4;

which has the pin definitions

Nope. I want to do it without the Gadgeteer libraries and it should be possible, as stated in the Mountaineer.Netmf.Hardware namespace I found.

@ tr0lle - It is just the project they have on their site

You can build this class library and start using it in your plain vanilla NETMF apps.

This is still the Mountaineer.Netmf.Hardware namespace which has a socket-oriented view on hardware features and not the Mountaineer.Stm32.Hardware namespace which has a pin-oriented hardware view… Later on I will produce my own PCB and this will not have the Gadgeteer sockets. This is why I don’t want to use the Mountaineer.Netmf.Hardware namespace with all the Socket-classes.

Yes. But you need the Gadgeteer Core to install the Mountaineer Gadgeteer SDK

I’m not sure I follow? Can you please clarify what you mean? :slight_smile:

I’ve installed the Gadgeteer Core and Mountaineer Gadgeteer SDK now but still no sign of the Mountaineer.Stm32.Hardware namespace anywhere.

@ tr0lle - Why are you so fixed on Mountaineer.Stm32.Hardware?

You need to take a look at the Mountaineer.Netmf.Hardware I have mentioned earlier. You said it uses Socket, but it is not a Gadgeteer socket it just another “local” class to group the pins according to their layout on the board.

For example here what Socket1 class is:

    /// <summary>
    /// socket 1 (type CY)
    /// </summary>
    public static class Socket1
        /// <summary>
        /// socket 1 (type CY), pin 3, PD11
        /// </summary>
        public const Cpu.Pin Pin3 = (Cpu.Pin)59;

        /// <summary>
        /// socket 1 (type CY), pin 4, PD1/CAN1_TX
        /// </summary>
        public const Cpu.Pin Pin4 = (Cpu.Pin)49;

        /// <summary>
        /// socket 1 (type CY), pin 5, PD0/CAN1_RX
        /// </summary>
        public const Cpu.Pin Pin5 = (Cpu.Pin)48;

        /// <summary>
        /// socket 1 (type CY), pin 6, PD10
        /// </summary>
        public const Cpu.Pin Pin6 = (Cpu.Pin)58;

        /// <summary>
        /// socket 1 (type CY), pin 7, PE3
        /// </summary>
        public const Cpu.Pin Pin7 = (Cpu.Pin)67;

        /// <summary>
        /// socket 1 (type CY), pin 8, PE4
        /// </summary>
        public const Cpu.Pin Pin8 = (Cpu.Pin)68;

        /// <summary>
        /// socket 1 (type CY), pin 9, PE15
        /// </summary>
        public const Cpu.Pin Pin9 = (Cpu.Pin)79;

Ok, if you want to use pins by their name like PA0, PB12, etc.
you can use this class:

The convention is:

You just need to copy the cs file to your solution. You can change namespace to whatever you want by the way it can be Mountaineer.Stm32.Hardware

Thank you! This was in someway what I was looking for. I can definitely use this! :slight_smile:

You are welcome! Looking forward to hear more about your custom board.

Sorry for the oversight, we’ll fix that in our next firmware release, due “soon”.

Thanks and best regards


1 Like

In the Mountaineer SDK 4.3 we have added the namespace to the Mountaineer assembly. So you can now choose between Gadgeteer socket-oriented pin names (Mountaineer.Netmf.Hardware) and CPU-oriented pin names (Mountaineer.Stm32.Hardware).

1 Like