Need help from native-guys

I’m looking around the PK (4.2) for now and I can compile without any problem.
I’m going to realize an FTDI FT800 Eve board for Gadgeteer, I’ve just done schematic but documentation is very poor for the moment about software, so need a little bit more time to have infos.
So I’m going to work on a different board with STM32F407 chip that has SSD1963 LCD driver. This chip is amazingly fast with a display of 480x272, but need native driver.

I’ve realized a working native driver for the chip (parallel 16bit bus), but I really get confused how to integrate in the tinyclr and using it with Microsof.SPOT.Media, Presentation and so on.
Any help is welcome …

How much RAM do you have on your board? If under 1MB then you really can’t use it nicely.

@ Gus - Yes …I know that !! (this board is 1MB standard flash). The idea is to have something like SimpleGraphics features first, than we are going to make new board with sram added if the project will go on.
But still I would like to understand how it is integrated in the porting kit.

see my question again :slight_smile: 1MB RAM not FLASH.

@ Gus - sorry I say flash but I intended RAM is standard STM32F407 and 1MB flash, by now.

I’m not interested really in bitmaps, so I’d like to manage just some text primitives and some graphics primitives and eventually colors. That is usable with STM32 memory. The Microsoft.SPOT.Presentation layer is too heavy probably. So SimpleGraphics is more than enough for now.

It won’t work with native NETMF, you need at least one frame buffer, that is 2 bytes per pixel.

480x272x2 = 260KB

You can add other native functions but not the standard NETMF ones.

@ Gus - I was looking exactly this limitation when you responded!! Thank you in any case. My idea is to manage display like a peripheral, not as standard NETMF graphic surface.

NETMF doesn’t needed access to the framebuffer itself, it just needs to be able to update certain parts of it. I’m not sure why Gus thinks otherwise.

Actually, I think there might be an SSDxxxx display driver built-in to the porting kit. Add the tinycore feature in solution wizard and it should show you a list of supported graphics controllers. If the SSDxxxx controller doesn’t appear, just choose Generate Template, and it will create the LCD stub functions in your solution folder. Implement them, and you should be good to go.

@ jay -
Hi Jay, exactly I’m using a SSD1963 chip attached to a Himax LCD driver. I use it in C++ Keil MDK and it works fine. I just can make a SSD193Lib namespace and the underlying native c code.
The SSD1963 chip uses some pin of port F and data are on port G (144pin mcu).

Were you able to figure out how to add the graphics driver to the solution?

Gus, in case it’s not clear, this driver IC has onboard framebuffer RAM, so the MCU doesn’t need its own framebuffer, at least for SimpleGraphics type stuff.

Still, you need the image (“Bitmap” object) in your RAM before sending to the display.

It can be done, it is just not going to be done right.

No, not yet. For some reason display template remains in devicecode main tree as stubs. It’s not created in the solution. Probably this is how it works solution wizard.
Tomorrow I will check better.

@ gus, you are right but this LCD controller has some nice chunk management, so you can work with smaller screen area and not the whole display.

Finally I got some step ahead.
Solution wizard doesn’t setup a display driver DeviceCode\Display in your solution dir, but you must create your own code in Solution\DeviceCode or use global DeviceCode directory.

In any case I’m now implementing required NETMF interface API, but the very confusing part will be the dotNetMF.proj file to include all the staff … Will see…

I got it working the display and it is fast enough.
Basic geometric rendering (Pixel, Line, Rect, Circle, Fill, Clear, Text, DrawImage ) is working and, although Bitmap is limited in mem dimensions, it works fine. I used TinyBitmap from a GHI idea (thanks guys)… I implemented a text writer using netmf included font8x8 so the fw doesn’t increase in size.
I writing more native API now…

Does NETMF use a managed framebuffer in addition to the actual framebuffer?

NETMF has a framebuffer for WPF-like screen, it requires a specific interface to be implemented to adhere to Microsoft.SPOT.Presentetion. I spend long time to weight what’s the best solution for STM32f4xx where memory is very low. At the end I have implemented a driver that is not integrated with SPOT.Presentetion, but I made my library to interface with it from managed code.
Coming to your question, I really didn’t understood very well what’s going under the hood of SPOT.Presentation nor I dedicated too much time to that.


... // sample interface code
            Debug.Print(Resources.GetString(Resources.StringResources.String1));
            Font f = Resources.GetFont(Resources.FontResources.NinaB);
            led1 = new OutputPort((Cpu.Pin)GHI.Hardware.FEZCerb.Pin.PB3, true);
            led2 = new OutputPort((Cpu.Pin)GHI.Hardware.FEZCerb.Pin.PB4, true);
            //OutputPort led3 = new OutputPort((Cpu.Pin)GHI.Hardware.FEZCerb.Pin.PC10, true);
            //OutputPort led4 = new OutputPort((Cpu.Pin)GHI.Hardware.FEZCerb.Pin.PC11, true);
            bool state = false;
            EasyDisplay.Initialize(Orientation.Landscape);

            EasyDisplay.DrawRectangle(1, 1, 479, 271, Microsoft.SPOT.Presentation.Media.ColorUtility.ColorFromRGB(0,255,0));

            EasyDisplay.DrawText("Test native NETMF display", 2, 50, ColorUtility.ColorFromRGB(255, 128, 0));
            byte[] buffer = Resources.GetBytes(Resources.BinaryResources.music_add);
            Bitmap bmp = new Bitmap(buffer, Bitmap.BitmapImageType.Bmp);
            TinyBitmap tbmp = new TinyBitmap(bmp);
            int x = 10, y = 10;
            int cc = 0;
            string text = "NETMF Bitmap Text";
            EasyDisplay.Draw(text, x, y, f, ColorUtility.ColorFromRGB(0,255,0), ColorUtility.ColorFromRGB(255,255,255));
            while (true)
            {
                led2.Write(state);
                //led4.Write(state);
                state = !state;
                led1.Write(state);
                //led3.Write(state);
                EasyDisplay.Draw(tbmp, x, y);
                Thread.Sleep(20);
                x += 2; y += 2;
                if (y > (MaxScreenY - tbmp.Height)) 
                    y = 10;
                if (x > (MaxScreenX - tbmp.Width)) 
                    x = 10;
                cc++;
                if (cc > 1000)
                {
                    cc = 0;
                    EasyDisplay.ClearDisplay(0);
                }
            }