OSHW Firmware on custom STM32F4 base board : How to deploy Hex Files using the SWG Interface provided by the Discovery?

Hi All,

I received my customzied boards today, and I made some tries with deploying the several Hex on the target STM32F407VGT6.

First round :

It comes fine using the firmware provided with the Discovery board, using DFU, and I can run a program that plays with I/Os. But as I need to make some tests with Ethernet that is not provided in the Discovery firwmare (I’m not sure of that also…), I want to use GHI OSHW firmware…

Second round :

I try to use the SWG interface provided by my board (already the same used for the discovery firmware upload), in conjunction with the STLINK interface provided by the discovery to upload the GHI OSHW 4.2 QFE2, but something is going wrong, so, here s the steps :

Use STLINK Utility to load the Tinybooter (previously converted from dfu to hex with DFU Convertter). The upload comes fine…
Then Upload the Firwmare and Config.Hex from OSHW (FEZ Cerb family / Ethernet version. The upload comes fine…
Shutdown the board, unplug the SWG and plug the USB (PA11/PA12 on the board) => Driver is not recognized, even if I try to upgrade it from the Premium Library…

Maybe I’m missing something, or maybe I must do that from DFU ?..If anyone has an Idea…Would be great !

It would be nice for me to show you my board working on !

Have you recompile the GHI firmware for your board?

@ Architect -

Not at all. Do I need even if no changes are made to the platform_selector ?

So your custom board is exactly the same?

@ Architect -

Yes it is. the only things was to change the physical look !

you can have a look here :

1 Like

Wow! Nice!

So how exactly are you uploading Firwmare and Config.Hex?

Thanks !

Well I try yto do the same as for the Discovery, meaing via STLINK Utility…First the TinyBooter, then Config, then Firmware, then reboot the board…

All the Write operations are fine, but after that, no USB driver is avaiable to me, only the “Unkown device”…

The program running on the board in the video is based on the Discovery firmware as well, and it works fine. The only thing is that I’m thinking about replacing the RS485 by a kind of “private sub network” between my boards…Something like EtherCat, but much less complex !

@ LouisCpro - Looks nice… and even the relays switching at the beat of the background music :wink:

@ LouisCpro - Nice! That’s a seriously sexy project. What kind of devices will you be controlling with it? Irrigation system?

Thanks All,

I’m trying to achieve several things :

Couting my several fluid and energy consumptions in cunjonction with the pulse provided the suppliers (ERDF, VEOLIA, and so on…),
Make a survey on several critical disjonction status when I’m in vacation (SD contacts near the differentials),
Acting on my lighting tele-rupting systems, to switch on and off the lights at given presets and situations (switch on on intrusion and so on…),
Do that via an Http web site, and from everywhere of course…

But In fact it could be applied with any situation where Relays and opto isolated inputs can operate…

I’m also preparing other types of modules (reason of the side connector), but it is yet in my brain…

Than I was thinking of 2 main possibilities :

One module that has the Ethernet connectivity and deal with the other as a “Master”,
Improve the Net on each module and play with a simple ethernet switch…Not master, no slave, and much more scalable…

@ LouisCpro -

…And if time is given to me, maybe a Metronom for Robvan :slight_smile:

Regarding to the intial problem, can the Quartz frequency be the source ?

On my board is and 8MHZ, where it seems to be 12MHZ on GHI and Mountaineer …

So it is not “exactly the same”. :wink:

Yes, that would be the first major problem.

In MicroFrameworkPK\Solutions\FEZCerberus\platform_selector.h change line 78 from:

#define SYSTEM_CRYSTAL_CLOCK_HZ         12000000   // 12MHz external clock

to

#define SYSTEM_CRYSTAL_CLOCK_HZ         8000000   // 8MHz external clock

and recompile tinyBooter and tinyCLR. If you don’t have MDK, I can post the firmware bin files for you.

@ jay -

Jay, you’re a king !

If you can do that, I will test it tomorrow soon and tell if I can get somewhere else thant nowhere :slight_smile:

@ Architect,

Effectively it seems that I’m nearest to the Discovery, than the Cerb, but I did not have a look in details in this part of the platform_selector…

@ Jay,

I think I will have to take in account that in one way or another, a compiler would be nice to me…Any suggestion on an MDK that I could use without spending all my money left :slight_smile:

MDK is very expensive. I work in a lab at a university, and we got a major discount – we only paid $500 for it. But the non-academic price is, like, $4000. I’m not even kidding. It’s outrageous.

Anyway, here are the firmware files:

http://mc2.unl.edu/uploads/discoveryCerberus.zip

I briefly tested this on my STM32F4 Discovery board, and appears to work. I’m not sure if you’ve ever flashed a NETMF image, but if not, here’s the general run-down:

[ol]First, flash the tinybooter.hex file to the board using the ST-LINK utility. I always erase the chip before I deploy it, but that may not be necessary?
Hit the reboot button on the device. It should pop-up as a USB device and may or may not install the drivers automagically. Device Manager is your friend – make sure the device is popping up and that it has drivers installed.
If not, use Device Manager to manually update the driver; point it to the GHI WinUSB drivers (found in GHI Premium NETMF v4.2 SDK\USB Drivers\GHI_NETMF_WinUsb).
Once that’s installed, you’ve got a fully-functional NETMF debugable device – but there’s no firmware on it yet. Use MFDeploy (it’s in the NETMF SDK tools folder) to connect to the device, and deploy the two files in the tinyCLR.hex folder – ER_FLASH and ER_CONFIG. Once those files are deployed, you should be good to go.[/ol]

Let us know if you have any other questions!

@ jay - Thanks Jay,

No problem for me with the frmware upload…The only thing is that as far as I’m not student anymore for centuries :), I effectivly cough a bit when I see that I need 4000$ to compile and Opensource framework :frowning:

I hope to find a solution less expensive…I hope !

I’ll tell you back tomorrow if it comes more accurate with your version ! Here it is 10PM…and my wife loves me when I’m on the computer at this time…

@ jay - MDK is not expensive! It costs less than half what RVDS costs :slight_smile:

1 Like

@ LouisCpro - Search the forum there are instructions on how to build firmware using GCC

1 Like