Main Site Documentation

STM32F4 Discovery with Cerberus firmware


#1

Hello,
I got STM32F4 Discovery board, STM32F4DIS-BB extension board and STM32F4DIS-LCD.
This is the configuration without the camera:
http://www.armkits.com/product/images/devkit407.gif

This is what I did so far:

  1. Downloaded and installed all the software and the drivers from here:
    http://www.ghielectronics.com/support/.net-micro-framework

  2. According to this page:
    http://www.ghielectronics.com/docs/131/fez-cerberus-firmware-on-discovery
    I downloaded the hex files from here:
    http://mc2.unl.edu/uploads/discoveryCerberus.zip
    I downloaded compiled hex files, becouse I don’t know much about porting and will takes loooong time to do it.

  3. I erased my board, loaded Tinybooter.hex by STM32 ST-LINK Utility

  4. Deployed ER_CONFIG and ER_FLASH with MFDeploy.exe

  5. After rebooting the device it can be recognised by VS and FEZ Config software gives me this info for device version:
    Connecting to device…Cerb-Family_Gadgeteer
    Loader (TinyBooter) Version: 4.2.3.2
    Firmware (TinyCLR) Version: 4.2.3.2

I successfully created new console application on netmf 4.2, VS2010, and the onboard leds, user button and the serial ports are working fine.

But when I tried to create new Gadgeteer app (netmf 4.2) and debug it without adding any code, just with the default Debug.Print(“Program Started”), I got the following error:

[quote] Assembly: GHI.OSHW.Hardware (4.2.5.0) ***********************************************************************

  • ERROR!!! Firmware version does not match managed code version!!! *
  • Invalid native checksum: GHI.OSHW.Hardware 0xF75E8662!=0xF0D4135D *
    Resolving.
    The debugging target runtime is loading the application assemblies and starting execution.
    Ready.
    Cannot find any entrypoint!
    Done.[/quote]

My main target is working LCD display with the touch screen.

My questions are:

  1. Why I get this error and how can I avoid it?
  2. Can I use gadgeteer templates somehow or I have to implement the LCD by myself?
  3. If I cant use gadgeteer, can anyone link me some examples for starters for any similar LCD (16 bit parallel interface for the display and I2C/SPI interface for the touch).
    The display uses SSD2119 microcontroller.

#2

Answer for the 1st question and error.
The firmware files from http://mc2.unl.edu/uploads/discoveryCerberus.zip is outdated.


#3

Thank you for the response.
As I saw, there wasn’t any compiled hex files with the new firmware for discovery so I did the hardware modifications.
With STMicroelectronics’ DFU_File_manager I converted the .dfu file
C:\Program Files\GHI Electronics\GHI OSHW NETMF v4.2 SDK\FEZ Cerb Family\Firmware\TinyBooter_4_2_5_0.dfu to hex file and reloaded the firmware on the board

Now gadgeteer project debugging is OK!

Now I guess I have to start new Gadgeteer Mainboard project to configure the discovery board properly.

So now the main question for me is: Are there any examples or templates for any similar LCD to this STM4F32DIS-LCD.
As I read in the documentation it is 16 bit parallel interface for the display and I2C/SPI interface for the touch.
The display uses SSD2119 microcontroller.


#4

@ Mincho - I’m trying to write a driver for SSD1963 (16bit GPIO on port E, G) in a stm32f407zg board. The native code is working but including it in the NETMF firmware build is an other story.


#5

Sorry about that. I’ve been meaning to recompile the latest firmware and update that ZIP file but I haven’t had time.

To get the display working, you’ll have to implement the LCD functions. Come hang out in the native section of the forum and check on @ dobova’s progress. You’ll need to set up an environment for working with the porting kit, so you’ll need either MDK or GCC set up, in addition to the build tree. It is by no means a simple task, but once you get it figured out, you’ll be writing native interops for everything and loving it.


#6

I’ve implemented all the needed interfaces and working under simlulation code with Keil MDK. I finally I’ve my solution created and compiling. Now I need to manage settings, itemgroups and hundreds of netmf fancy includes for the build. I see tonight and/or tomorrow to run some test.
I’ve implemented also BitBltEx as per specification, but I don’t think will work in NETMF …
Need some better solution there.


#7

PS: I’m little astonish to see my board running little faster than original Cerberus … Uh is it possible ? The chip is the same family, set to 168mhz with 25mhz oscillator. I’ve just discovered that I’m using “THUMB2FP” config and not the cerb “THUMB2”. May be Keil compiler is making some better FP code ?
I’ve not time to make benchmark now, but is there some ready fp bench program for netmf?


#8

You can use the PI suite from Duke Nukem. The latest result he posted for the current firmware can be found in the following post
http://www.ghielectronics.com/community/forum/topic?id=11832&page=3#msg120641

Here is his test suite
http://www.ghielectronics.com/community/codeshare/entry/597


#9

@ taylorza - Thank you, I will test soon.


#10

@ dobova - It will be interested to see your results.

Note that according to that form post GHI are still not compiling with native FP support so I would not be overly surprised if your build is faster, it would be interesting to see by how much.


#11

Uh I get:



Program Started
Timelapse: 00:03:01.7405510
>>5493038196
Il thread '<Nessun nome>' (0x1) è terminato con il codice 0 (0x0).


But with VS2012 in debug and cerberus base firmware from codeplex in release mode. I used Debug.Print becouse I haven’t a display working (for now ach!).


#12

That was for 200 digits of PI?


#13

@ taylorza - Yep


#14

I think the test is only reliable for testing updates for the particular user as to a degree it is environment dependant…i get 2.41 for 200 digits…


#15

@ Justin - I got the idea looking same program running on both the board (cerb vs my board). But I will check better tomorrow comparing the 2 board. I tried with led on/off without VS debug and it’s lot less (on 2:35 but manually measured). I think it is comparable with your result.

In any case it’s not important, I’m engaged on other things


#16

Thanks for the replays.
Native code is kinda unknown for me, so I’ll try with the existing cerberus port and will try to handle with the managed code only for now :).
I’m still digging in the documentation and the schematics to understand pin’s usage for the display.
I don’t have much experience in netmf, only in .net and .netcf.
Windows apps and windows phone apps are very close and hardware knowledge wasn’t necessary, but netmf is kinda different.

Anyway, keep posting, I appreciate every advice and help and will try to understand all step by step.


#17

@ dobova - i removed the display and button fluff and kicked off an new thread to do the 200 digits with a debug.print of the result


#18

@ Justin - And you get 2.41? In this way I get little more, 2:44.
So I think I got an erroneus impression.


#19

@ dobova - yes 2.41 on the Octopus which us the same as the Cerb.


#20

Ok my final test side by side Cerberus (stock fw w/eth) vs my board (compiled Keil FP-on v4.70 w/eth), “process(200)” , VS2012 in debug mode, no threads, just main program:

Cerberus: 234 sec

My board: 207 sec

Exactly same program, same binary, same dll, same deploy PC, same VS2012 for both boars. The difference I felt is real, more than 10%. But this morning I’m far from Justin values, probably due to eth fw.
So I don’t waste more time on this topic, I need to get LCD working and lot of other stuff.