13
Vote

Support latest GCC compiler [was:Cortex M3 ports build failure with GCC 4.2.1]

description

Currently available PK support for GCC 4.2.1 toolchain not suitable for building Cortex M3 based solutions. Newest compiler version support is highly needed.

comments

trioflex wrote Apr 18 at 10:54 AM

I see! thanks. Yes, the RVDS builds are much smaller..

markmun wrote Apr 18 at 10:46 AM

The STM32*** port mentioned in the document refers to a not yet released port, for which I added GCC support. Under this work item I have only included the PK pre-requisites for this to work.
Once the port is released I will upload the needed changes to get GCC working.
Bottom line: if you have any chance to use the ARM compiler, eg MDK, do so. GCC build are much larger and thus much slower. Due to the unfortunate block sizes for STM32 chips (mostly of size 128kb) it hurts even more to use GCC with these chips...

trioflex wrote Apr 18 at 9:48 AM

Hi
I know I know, but in the document about testing the GCC support was mentioned:
STM32 build... success... :) -- thats why I was so curious...
I just trid FEZ STM32,,, does not build either with GCC

Antti

markmun wrote Apr 18 at 9:42 AM

Hello Anty,
this work item is about adding support to the latest GCC to the porting kit. If you look carefully you see I only included PK files, no patch at all for the STM32 port. The document also makes no mention about adding GCC support to the STM port. So I think you where expecting the wrong thing here.

To make the STM32 port compile with GCC a lot more has to be done... add scatter files, add a custom block config for GCC, some code changes here and there, and off course, the supplied assembler files are not in GCC idiom and need to be patched.

PS: the correct NETMF way to add -mcpu is to add
<DEVICE_TYPE Condition="'$(DEVICE_TYPE)' == ''">cortex-m3</DEVICE_TYPE>
to the settings file of your project.

If you look at STM32.settings you will see it is defined for RVDS and MDK in there, but not for GCC.

The PK is huge and it takes some time to get used to it. A lot of things happen in the build system...



trioflex wrote Apr 18 at 8:33 AM

issues: fresh 4.2 QFE1, then apply 4.6.1_updated zip

1) -mcpu not defined, I made fix by adding one line to 4.6.1 section in setenv

IF "%COMPILER_TOOL_VERSION%"=="GCC4.6.1" (
#>>> the next line added
set ARM_TYPE_FLAGS=cortex-m4
)
not sure why it was needed, but on my machine it doesnt workwithout it

2) cd solutions cd stm32stamp msbuild
first error comes from
C:\PK_v4_2\DeviceCode\Targets\Native\STM32\DeviceCode\CortexM3\TinyHal\VectorsHandlers.s:3: Error: bad instruction

this file i think should not be included at all

next error
C:\PK_v4_2\DeviceCode\Targets\Native\STM32\DeviceCode\STM32_Power\STM32_Power_functions.cpp:93:5: error: stray '#' in program

I checked codeplex repo, the same file is there with code that does not compile with gcc

C:\PK_v4_2\DeviceCode\Targets\Native\STM32\DeviceCode\STM32_USB\STM32_USB_functions.cpp: In function 'void STM32_USB_Driver_EP0_RX_Int(UINT32, USB_CONTROLLER_STATE*)':

so the OLD STM32 ports DO NOT compile directly with the fix and instructions given, I will be checking fez/go stuff now

Antti









cw wrote Apr 17 at 11:55 AM

I have added support for GCC-based toolchains to Netduino Go! solution (STM32F4 Cortex-M4), the source code is available in my NetduinoGoFirmware repository on BitBucket (https://bitbucket.org/CW2/netduinogofirmware). More information is available on Netduino forum http://forums.netduino.com/index.php?/topic/3996-netduino-go-firmware-source-for-gcc/.

The build system includes support for Yagarto (verified on hardware), Sourcery (compiles, binaries not verified on hardware) and devkitARM (links with errors at the moment).

Please note the modifications are specific to Netduino Go! solution only, they have not been made backward-compatible yet.

List of changes:
Added detection of GCC toolchain variant in setenv_gcc.cmd
Added support for GCC toolchains side-by-side builds
Added CMSIS code to SmartPtr_IRQ
Fixed UsageFault exceptions (caused by emitted ARM code and wrong libraries)
Fixed most of the GCC compiler warnings
Removed support for GCCOP toolchain
Suppressed "note: the mangling of 'va_list' has changed in GCC 4.4"

trioflex wrote Apr 17 at 11:26 AM

mark

I VERY much like to be in the dev team. I have 33 years electronics and programming experiene.
My family run high tech company is the first one from our country to get ARM connected partner, we are working a lot with different M4 chips.

Antti

markmun wrote Apr 17 at 11:00 AM

Updated document giving instructions how to find & download Sourcery Lite

@trioflex: this feature has been chosen to make it into NETMF 4.3 (see roadmap), so I guess the NET MF team will kindly appreciate any feedback related to the files I uploaded (what of it could be used for the 4.3 release).

If you manage to make any progress regarding the two open issues described in the document please post here too!

Regards
mark

markmun wrote Apr 17 at 10:48 AM

Ups, my fault. Sourcery really tries hard to make it difficult to find and download the Lite edition.
This should be the correct Link:
https://sourcery.mentor.com/sgpp/lite/arm/portal/subscription3053

Else find the "Lite" product page, then look a link named "Download the EABI Release", next you will need to register/enter your email. You should then get an email with the link above

trioflex wrote Apr 17 at 9:37 AM

problem: the link to code sourcery installs: gcc-arm-none-linux-gnuaeabi and this does not match the env setting script parameters that set arm-none-eabi

:(

markmun wrote Apr 4 at 2:22 PM

See attachment for PK modifications needed to add GCC 4.6.1.as supported PK compiler. please carefully read the included word document... two issues are still open!