Netduino Go firmware source for GCC - Beta Firmware and Drivers - Netduino Forums
   
Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Netduino Go firmware source for GCC


  • Please log in to reply
26 replies to this topic

#1 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 15 April 2012 - 08:40 PM

The alpha version of Netduino Go firmware source code that can be built with GCC-based toolchains is now available in my NetduinoGoFirmware repository on BitBucket. Please keep in mind this is still in early development stage and not recommended for general use. A few important notes:

  • The GCC-related code is in dev-gcc branch, you can grab the source directly via "zip" link in "get source" menu on the web page,
  • This is stripped-down version of the .NET MF 4.2 QFE1 + Netduino Go 4.2.0.0 source, there are no other solutions, no OpenSSL, LWIP, RTIP and a few other things,
  • The primary toolchain is Yagarto 20111119 (GCC 4.6.2), other supported toolchains are Sourcery CodeBench Lite (2011.09-69 compiles, binaries have not been tested on hardware) and devkitARM (r36 links with a few undefined reference errors),
  • The setenv_gcc.cmd has been enhanced to detect the compiler version automatically and uses proper runtime libraries for Cortex-M4 core,
  • The build system now supports side-by-side builds, in case multiple GCC toolchains are used the output will be in a specific folder (e.g. BuildOutput\THUMB2\GCC-Yagarto-4.6.2\le..., BuildOutput\THUMB2\GCC-Sourcery-4.6.1\le... etc.),
  • The Cortex-M4 hardware floating point unit is not enabled yet - it compiles when the VFP options are set, but there is missing code that actually switches the unit on at startup,
  • To run the firmware on STM32F4 DISCOVERY board only three values has to be changed to match different oscillator frequency (8 MHz vs. 25 MHz on Netduino Go), as described in Joel Kunze's post.
EDIT: I have discovered a bug in the scatterfile that causes incorrect ER_FLASH to be generated, so the DFU update process (using ST DfuSe tools) cannot be used right now, because the ER_FLASH is horribly big. Flashing tinyclr.axf directly works fine.

EDIT 2012-04-17: The bug has been fixed [hopefully].

I will post more detailed information on the repository wiki. And of course, I am looking for help - any contributions are welcome and will be greatly appreciated. The plan is to merge the changes into Secret Labs official repository when it is available; and possibly into .NET MF codebase (but only after they start accepting my patches : )

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 15 April 2012 - 08:51 PM

Hi CW2, This is awesome! One of the big things that has been needed for NETMF Cortex boards is the ability to compile with a free GCC compiler. BTW, when you say "alpha" you mean that the GCC compilation is pre-release, correct? But that it's based on the release 4.2.0.0 firmware for Netduino Go... Keep up the fantastic work! Chris P.S. I really look forward to integrating this into the Netduino source tree once the GCC build hits "release" stage. It will be wonderful to empower everyone with the freedom to compile their own firmware (with a free compiler).

#3 Valkyrie-MT

Valkyrie-MT

    Advanced Member

  • Members
  • PipPipPip
  • 315 posts
  • LocationIndiana, USA

Posted 16 April 2012 - 01:44 AM

Netduino Go firmware source code that can be built with GCC-based toolchains...

Awesome, can't wait to play! Downloading Yagarto right now!! :D

This is stripped-down version of the .NET MF 4.2 QFE1 + Netduino Go 4.2.0.0 source, there are no other solutions, no OpenSSL, LWIP, RTIP and a few other things...

So, why is it stripped down, I was hoping that the ST chip would give us plenty of room for extra features... How big is the resulting firmware file from the GCC compiler, when compared to RVDS? Will it not fit in memory without removing these features, or are they removed for other reasons?

Thanks!
-Valkyrie-MT

#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 16 April 2012 - 01:49 AM

Hi Valkyrie,

So, why is it stripped down, I was hoping that the ST chip would give us plenty of room for extra features... How big is the resulting firmware file from the GCC compiler, when compared to RVDS? Will it not fit in memory without removing these features, or are they removed for other reasons?

I'll let CW2 fill you in on the details, but I believe that this is a temporary thing...to make sure that the core works well before enabling each feature. CW2 (and KodeDaemon as well) have done quite a bit of work to work both Cortex-M3 supports into NETMF+GCC and to enable NETMF's build process to work with the newer versions of GCC.

There's lots of flash and RAM on the STM32F405 used on Netduino Go. One of our main design goals was to enable GCC-compiled firmware with all features included.

Chris

#5 ErikN

ErikN

    Advanced Member

  • Members
  • PipPipPip
  • 119 posts
  • LocationNew York, NY

Posted 16 April 2012 - 02:31 AM

Awesome job! Can't wait to get my compilers on it!

#6 Geancarlo2

Geancarlo2

    Advanced Member

  • Members
  • PipPipPip
  • 70 posts

Posted 16 April 2012 - 02:40 AM

Congratulations to everyone involved in it, I really hope you manage to make this port flexible for everyone... BTW, here goes another gcc toolchain https://launchpad.net/gcc-arm-embedded , which seems to be updated frequently and supported by ARM(couldn't find any references to support their claim...).

#7 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 16 April 2012 - 06:17 AM

The alpha version of Netduino Go firmware source code that can be built with GCC-based toolchains is now available in my NetduinoGoFirmware repository on BitBucket.

Wow - great work. Something new to play with tonight :)

Regards,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#8 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 16 April 2012 - 06:40 AM

So, why is it stripped down, I was hoping that the ST chip would give us plenty of room for extra features... How big is the resulting firmware file from the GCC compiler, when compared to RVDS? Will it not fit in memory without removing these features, or are they removed for other reasons?

The source code is not included to keep the codebase small (*), no features were removed from the NetduinoGo solution. The code generated by GCC fits into the flash using the same layout as for RVCT. Neither networking nor SSL is used in the current Netduino Go implementation, it will be added back eventually (perhaps someone is getting interested in adding and testing the networking support?) You can also copy the code over an existing .NET MF PK installation and you'll have everything in place...

(*) This is one of my bad habits: I don't like having unused code in the repository, and as I mentioned in the first post, this is code for the Netduino Go only.Thousands of source files makes it harder for me to search for things, check the differences and perform integration.

#9 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 16 April 2012 - 06:44 AM

BTW, here goes another gcc toolchain https://launchpad.net/gcc-arm-embedded

Thanks for the tip, I'll have look at it. One more toolchain in the queue Posted Image

#10 nakchak

nakchak

    Advanced Member

  • Members
  • PipPipPip
  • 404 posts
  • LocationBristol, UK

Posted 16 April 2012 - 09:06 AM

Freaking Awesome News !!! :) As soon as payday lands im ordering a GO with the intent of getting SSL going as it would be a killer feature for an upcoming project at work...

#11 Joel Kunze

Joel Kunze

    New Member

  • Members
  • Pip
  • 8 posts

Posted 16 April 2012 - 10:19 PM

The alpha version of Netduino Go firmware source code that can be built with GCC-based toolchains is now available in my NetduinoGoFirmware repository on BitBucket. Please keep in mind this is still in early development stage and not recommended for general use. A few important notes:


As everyone else is expressing, I think this is great.
Thank you and KodeDaemon for all your efforts, especially at getting this to compile with GCC.

I hope to spend some time working with/on this, but at the rate everyone is moving (compared to me) I'll likely be always behind and just get the benefit of your efforts :)

Can you give some guidance on how to flash a .axf file? I have not had much luck when using google to get answers and the ST-Link Utility does not consider it a valid hex file for me.

#12 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 17 April 2012 - 06:14 AM

Can you give some guidance on how to flash a .axf file?

I use non-GCC toolchain IDE to flash the .axf file, at this moment I work only with the GCC compiler+linker, no IDE nor debugger (GDB) is supported yet. However, it appears that I managed to fix the scatterfile bug yesterday, so the produced binaries in .bin or .hex folders are correct now. I just need to perform some more tests, then I'll update the first post and write down the guides.

#13 Joel Kunze

Joel Kunze

    New Member

  • Members
  • Pip
  • 8 posts

Posted 24 April 2012 - 01:11 PM

I have your firmware compiled with GCC running on a STM32F4 Discovery (before your most recent scatter file change I was only successful with RVDS on SecretLabs firmware). I hope you don't mind, I have made a pull request for you, and it is possible I will be making some more minor changes with more pull requests. What are your plans for the future, will the official NetduinoGo firmware be getting your GCC changes, or will your firmware always be hosted on bitbucket (with official changes merged)? Thanks!

#14 Stephen_B

Stephen_B

    New Member

  • Members
  • Pip
  • 2 posts

Posted 11 May 2012 - 09:53 PM

I am a complete newbie to compiling firmware - just used VS10 to write c# programs under .netmf 4.1 How do I compile the gcc version of the Netduinogo for a STM32F4 Discovery board with the 8Mhz crystal as delivered? I was looking to use the GNU Tools for ARM Embedded Processor 4.6 If someone had a download or link to suitable .hex or .dfu that would be handy as well. Thanks in advance Stephen

#15 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 11 May 2012 - 10:23 PM

Hi Joel,

What are your plans for the future, will the official NetduinoGo firmware be getting your GCC changes, or will your firmware always be hosted on bitbucket (with official changes merged)?

Once it's ready, the goal is to integrate the GCC compiler support into the official Netduino Go firmware source tree.

Chris

#16 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 14 May 2012 - 07:04 AM

How do I compile the gcc version of the Netduinogo for a STM32F4 Discovery board with the 8Mhz crystal as delivered?

The source now includes Joel Kunze's improvement so you'd just need to change crystal clock value:

// platform_selector.h
#define SYSTEM_CRYSTAL_CLOCK_HZ	8000000 // 8 MHz

I was looking to use the GNU Tools for ARM Embedded Processor 4.6

The build system is now being updated to support this toolchain, it should be finished in a few days or so. It will most likely become the primary toolchain, as it has newlib with long long support (unlike Yagarto) and hardware FPU (unlike free Sourcery).

#17 Cuno

Cuno

    Advanced Member

  • Members
  • PipPipPip
  • 144 posts
  • LocationZürich / Switzerland

Posted 14 May 2012 - 09:12 AM

The plan is to merge the changes into Secret Labs official repository when it is available; and possibly into .NET MF codebase (but only after they start accepting my patches : )

Are most of these changes hardware-independent? We hope that via Microsoft, portable changes will come back to our NETMF for STM32 (F4 Edition) over time.

One of our contributors has made experimental changes for GCC to our port, but the resulting code size and speed were very disappointing. Nevertheless, it would be good to be able to use GCC for projects where it does not make sense to pay several thousand dollars for a compiler first.

Cuno

#18 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 14 May 2012 - 09:46 AM

One of our contributors has made experimental changes for GCC to our port, but the resulting code size and speed were very disappointing.

According to my experiments, the latest GCC toolchains produce firmware which is only about 10% bigger than RVCT output. However, some of them require C runtime (newlib) to be recompiled with different configuration to enable significantly smaller images than the default. I have not performed any speed measurements yet - the assembly code emitted by GCC seems to be less optimal than RVCT in certain cases, so it can add up for worse performance. It does not 'feel' significantly slower, but I'd need some numbers first; and there is still a lot of options left for tweaking the output...

#19 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 14 May 2012 - 10:06 AM

Are most of these changes hardware-independent? We hope that via Microsoft, portable changes will come back to our NETMF for STM32 (F4 Edition) over time.

There is actually very little code changes required to enable GCC build, most of them are in the build system, it should not require much work to integrated them into your codebase, as it is very similar to Netduino Go. Based on my previous experience with the Microsoft team, I am very skeptical here, perhaps Oberon Microsystems and/or Secret Labs will have more luck with getting the changes back into .NET MF.

#20 Stephen_B

Stephen_B

    New Member

  • Members
  • Pip
  • 2 posts

Posted 14 May 2012 - 11:51 PM

The source now includes Joel Kunze's improvement so you'd just need to change crystal clock value:

// platform_selector.h
#define SYSTEM_CRYSTAL_CLOCK_HZ	8000000 // 8 MHz

The build system is now being updated to support this toolchain, it should be finished in a few days or so. It will most likely become the primary toolchain, as it has newlib with long long support (unlike Yagarto) and hardware FPU (unlike free Sourcery).


Thanks.
AS a newbie is there an example anywhere explaining the process. For example what command is needed to make firmware?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.