TinyCLR Feather Candidate

I just came across this feather device from Adafruit. I could not resist the temptation, but has purchased one in anticipation of TinyCLR 2.0.

From Adafruit’s site:

This Feather has lots of goodies:

  • STM32F405 Cortex M4 with FPU and 1MB Flash, 168MHz speed
  • 3.3V logic, but almost all pins are 5V compliant!
  • USB C power and data - our first USB C Feather!
  • LiPo connector and charger
  • SD socket on the bottom, connected to SDIO port
  • 2 MB SPI Flash chip
  • Built in NeoPixel indicator
  • I2C, UART, GPIO, ADCs, DACs
  • Qwiic/STEMMA-QT connector for fast I2C connectivity
  • We use the built-in USB DFU bootloader to load firmware. It does not come with a UF2 bootloader.

I have a question, would this need the Bootloader V2 loaded prior to loading the TinyCLR OS firmware?

TinyCLR 2.0 ONLY runs on SITCore chipsets/modules. The adafruit board runs ST chipset, not a GHI SITCore chipset :slight_smile:

That doesn’t mean we will not offer a feather board with SITCore chipset running TinyCLR … but we should not talk about that now :wink:

at 12 mhz you can port (already firmware for cerb TinyCLR 1.0)

That’s a bummer :cold_sweat: :cry: :sob: I should have just waited until more information on TinyCLR 2.0 and products are publicly available.

Thanks.

Will try this port and also the WioLTE as these are based on the STM32F405 chip making the necessary modification(s).

for Adafruit Feather STM32F405 Express
just modify properties you need for this board on TinyCLR-Ports/Devices/Cerb/Device.h at dev · ghi-electronics/TinyCLR-Ports · GitHub

and on TinyCLR-Ports/Devices/Cerb/Scatterfile.gcc.ldf at dev · ghi-electronics/TinyCLR-Ports · GitHub

change from

LR_FLASH : ORIGIN = 0x08008400, LENGTH = 0x000B7C00        

}
SECTIONS
{
ER_FLASH 0x08008400 :
{
* (i.EntryPoint)

to

LR_FLASH : ORIGIN = 0x08000000, LENGTH = 0x000B7C00        

}
SECTIONS
{
ER_FLASH 0x08000000 :
{
* (i.EntryPoint)

than do compile firmware and upload on your board as dfu

3 Likes

Awesome! Will start getting TinyCLR loaded sometime tonight; that is, if my 5yrs old daughter allows it to happen.

2 Likes

I just received my Feather board and loading TinyCLR OS was a success. Starting with a copy of the Cerb as the base, I modified the ScatterFile as mentioned above, and then comment out the support for CAN in device.h at this time. Build the new device and voila it produces a [your device].hex, and a [your device].bin; I did create a .dfu file from either of these files, but opt to use the STM32CubeProgrammer that uploads either of these files and flashes the chip.

The test. Why waste time blinking LEDs when you have plants that are dying from dehydration? From the sensor collection box, comes the Stemma soil moisture level sensor to the rescue.

class Program
    {
        static void Main()
        {

            var i2cController = GHIElectronics.TinyCLR.Devices.I2c.I2cController.FromName(Cerb.I2cBus.I2c1);
            var soil = i2cController.GetDevice(new GHIElectronics.TinyCLR.Devices.I2c.I2cConnectionSettings(0x36, GHIElectronics.TinyCLR.Devices.I2c.I2cBusSpeed.FastMode));
            var tempReadCmd = new byte[] { 0x00, 0x04 };
            var touchReadCmd = new byte[] { 0x0F, 0x10 };
            var buf_1 = new byte[4];
            var buf_2 = new byte[2];
            while (true)
            {
                
                
                soil.Write(tempReadCmd);
                soil.Read(buf_1);
                var read = (buf_1[0] << 24) | (buf_1[1] << 16) | (buf_1[2] << 8) | buf_1[3];
                double temp = (1.0 / (1UL << 16)) * read;

                temp = Math.Round(temp);
                Thread.Sleep(200);
              
                soil.Write(touchReadCmd);
                soil.Read(buf_2);
                var read1 = (buf_2[0] << 8) | buf_2[1];
                               
                System.Diagnostics.Debug.WriteLine($"Soil temp {temp}°C|{temp * 1.8 + 32}°F, Moisture level: {read1}");
                Thread.Sleep(1000);
            }
        }
    }

3 Likes

Well done - your port is probably #2 for a Feather running TinyCLR :slightly_smiling_face:

This is awesome! I am starting to love the Feather compact form factor over the duino style boards. Over the past year, I have been getting fat from eating too many RPi3 A’s with Raspian fillings and dotnetcore toppings. Porting and running TinyCLR OS (thanks @valon_hoti_gmail_com) has proven to be a delightful change in diet, as it is lean and comes with no empty calories.

Only downside, it may be stuck running TinyCLR 1.0 for a long time, even after 2.0 have been grandfathered and 4.0 is in the works (taking a page from Microsoft here).

2 Likes