More news from the MBN Development Team

STM32F427, Mountaineer Prime firmware, 3 MikroBus slots.

MikroBus headers are compatible with Quail headers so that a program made for one board can run without changes on the other one.

Also, and coming “soon” (in MBN language, soon = soon), a revision 2 of the 2 sockets Dalmatian board. See attached picture for a preview.
The Dalmatian board has been modified so that it’s now also “headers compatible” with its two sisters. So a program using socket1 on Dalmatian won’t need any changes to run on a Tuatara or Quail.
It will also features a CR2032 battery holder for RTC.

Small team, thus small boards. But yet, powerful boards :smiley:

13 Likes

Neat!

I am really proud of this team! :dance:

there’s some awesomeness in those small packages !

@ Architect & @ Brett : thank you very much !
We try to add our little contribution to NETMF, because we believe in it.

@ Niels : I’m also proud to be in :-[

Here it is :

“Soon” has been delayed because of the PCB manufacturer : he has shipped the boards via USPS instead of UPS, as ordered and confirmed by mail :frowning:

5 Likes

We have introduced a new feature in the MBN Core, known as Storage class.

In short : this class allows the use of different kinds of memories to be used with a single set of instructions, either for simple storage or for file-system (using the TinyFileSystem(*) driver).

Here is a sample code that demonstrate the (ease of) use of the new Storage feature :

   private static Storage _storage1, _storage2, _storage3, _storage4;

        public static void Main()
        {
            _storage1 = new FRAMClick(Hardware.SocketTwo);
            _storage2 = new FlashClick(Hardware.SocketOne);
            _storage3 = new OnboardFlash();
            _storage4 = new EEpromClick(Hardware.SocketOne, memorySize: 256);

            TestSimpleStorage(_storage1);
            TestSimpleStorage(_storage2);
            TestTFS(_storage3);
            TestTFS(_storage4);
         
            // We could also have used TFS with the FRAM and Flash Click boards, without changing anything else :
            TestTFS(_storage1);      // See how simple it is
            TestTFS(_storage2);
                     
            Thread.Sleep(Timeout.Infinite);
        }
      
      private static void TestSimpleStorage(Storage storage)
        {
            var bArray = new Byte[3];

            storage.WriteByte(10, 200);
            Debug.Print("Read byte @ 10 (should be 200) : " + storage.ReadByte(10));
            storage.WriteByte(200, 201);
            Debug.Print("Read byte @ 200 (should be 201) : " + storage.ReadByte(200));

            storage.WriteData(400, new Byte[] { 100, 101, 102 }, 0, 3);
            storage.ReadData(400, bArray, 0, 3);
            Debug.Print("Read 3 bytes starting @ 400 (should be 100, 101, 102) : " + bArray[0] + ", " + bArray[1] + ", " + bArray[2]);
        }

        private static void TestTFS(Storage storage)
        {
            var tfs = new TinyFileSystem(storage);
            if (tfs.CheckIfFormatted())
            {
                Debug.Print("Filesystem OK. Mounting...");
                tfs.Mount();
                Debug.Print(" Now reading settings.dat file...");
                if (!tfs.Exists("settings.dat"))
                {
                    Debug.Print("File does not exist");
                    return;
                }
                using (var fs = tfs.Open("settings.dat", FileMode.Open))
                using (var rdr = new StreamReader(fs))
                {
                    string line;
                    while ((line = rdr.ReadLine()) != null)
                    {
                        Debug.Print(line);
                    }
                }
            }
            else
            {
                Debug.Print("Formatting");
                tfs.Format();
                Debug.Print("Creating file");
                using (var fs = tfs.Create("settings.dat"))
                {
                    using (var wr = new StreamWriter(fs))
                    {
                        wr.WriteLine("<settings>");
                        wr.WriteLine("InitialPosX=200");
                        wr.WriteLine("InitialPosY=150");
                        wr.WriteLine("</settings>");
                        wr.Flush();
                        fs.Flush();
                    }
                }
                Debug.Print("FileCreated");
            }
        }

Here is a screenshot of the result on a 256KB EEprom Click board :

What does that mean ? It means that you can use almost any memory storage device with MBN and store data on it in a common and very simple way. As long as you know their capacities and how to read/write an array of byte on it, then you are ready !
And now that the drivers already exist for the most common memory kinds (see http://www.mikrobusnet.org/downloads-2 ), you even only have to change the capacity in one driver to have a storage device available in seconds !

Of course, you should be careful to not use the same chip with both TFS and simple storage. Their uses are obviously mutually exclusive.

An example of such setup can be found on the attached picture, where you can see a Flash Click board, a FRAM one and our Quail board with an onboard 8MB Flash chip.
Then, code like the following code can be used :

public static void Main()
        {
            _storage1 = new OnboardFlash();
            _storage2 = new FlashClick(Hardware.SocketOne);
            _storage3 = new FRAMClick(Hardware.SocketTwo);

            _storage1.WriteByte(10,value);
            var _otherValue = _storage2.ReadByte(20);
            var _tfs = new TFS(_storage3);
            if (tfs.Exists("settings.dat")) { Debug.Print ("File found"); }

            Thread.Sleep(Timeout.Infinite);
        }

This has had some implications on the MBN Core assembly and the different “memory devices” drivers (EEprom, Flash, FRAM, Onboard Flash).
Onboard Flash is not a internal static class anymore but rather a single driver like any other. So if you do not need Onboard Flash support, then it will save you some memory for your program.

All this has made MBN Core assembly to change its version from 2.0 to 2.1. All the download links are now updated and we recommend you to switch to this new revision.

(*) TinyFileSystem (TFS) driver has been heavily modified by MBN but credits for the original driver go to Chris Taylor (Taylorza).

8 Likes

Great to see the file system being put to some use.

If you find/fix any issues in the driver it would be appreciated if you share those so that the original codebase can be improved as well.

2 Likes

The complete source code is (and has been) always available in the “Download” page ( http://www.mikrobusnet.org/downloads-2 ), where you can find the source code of all drivers and the MBN Core.

I would not say we have fixed some bugs (maybe we even added some :slight_smile: ) so I will not pretend to improve the codebase.

However, it has been enhanced in some ways like using a SPI bus instead of a single SPI configuration which allows sharing of the SPI lines. This “fix” was the first one introduced in your driver.

1 Like

And for those who are thinking “your code is nice but I am not using MikroBus sockets so it is useless for me”, here is a way to use our drivers with any module :

var vds = new Hardware.Socket
         {
             Cs = Pin.PE7,
             Sck = Pin.PB3,
            Miso = Pin.PB4,
            Mosi = Pin.PB5,
             Name = "VirtualFlashMemorySocket"
            };

       Storage _myCustomFlashModule = new CustomFlashModule(vds);

       _myCustomFlashModule.WriteByte(address,value);

Of course, change the pins depending on your board design.

4 Likes

Look at what I have received today :slight_smile:

10 Likes

Nice boards.

1 Like

G-Adapters are from TKA.

3 Likes

Must have been a nice BD present from TKA. Happy belated Birthday by the way! ;D

3 Likes

Thank you :wink:

@ Bec a Fuel - Nice!

On a similar note, I received these yesterday. Any guesses? (except from the “Short Bus Clan”… you know who you are. :wink: )

@ bec a fuel - very nice work :clap:

Generic screw terminal adapter modules?
Or is that one gigantic module that takes 49 sockets?

MikroElektronika makes some really nice products. I have a few of their larger dev boards.

Their IDE could use some work, though :slight_smile:

Woah. I just noticed the “powered by”. Cool! Congratulations. :slight_smile:

Pete

@ Bec a Fuel - I have a personal rule, ‘no sockets, no interest’ as I’m a software dude but now I see a Gadgeteer socket there, my interest level just went up. Tell me more.

And yes congrads on the Mountaineer thing…