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 firmware with GCC 4.4


  • Please log in to reply
13 replies to this topic

#1 jeremy

jeremy

    Member

  • Members
  • PipPip
  • 23 posts

Posted 21 August 2010 - 03:16 PM

Attached is a zip file that contains an updated build environment to allow the use of GCC 4.4 to build the firmware. This yields a much smaller binary than the 4.2 build tools. This saves around 15K or so with the stock netduino formware build. The build environment is copied over the existing files in the same way the original netduino firmware source is deployed. A new setenv command, setenv_gcc4.4 is used to set the build environment up. This is used the same way as the original setenv_gcc command.

Attached Files



#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 21 August 2010 - 05:54 PM

This is fantastic, jeremy. Would it be alright if we integrated this into the Netduino source code download (or at least put a link to it in the downloads section)? Chris

#3 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 22 August 2010 - 06:12 PM

Attached is a zip file that contains an updated build environment to allow the use of GCC 4.4 to build the firmware.

Very handy indeed, works like a charm. Thanks Posted Image

This yields a much smaller binary than the 4.2 build tools. This saves around 15K or so with the stock netduino formware build.

The following flash sector map configuration (in Netduino solution DeviceCode\Blockstorage\Sam7X_blockstorage\Sam7x_Bl_Config.cpp) compiled with GCC 4.4 creates a bootloader that is able to successfully deploy the firmware (default features selected):

const BlockRange g_SAM7X_BS_BlockRange[] =
{
    { BlockRange::BLOCKTYPE_BOOTSTRAP,         0,  5 }, // 0xC000
    { MEMORY_BLOCKTYPE_GCC_SPECIAL_BOOTSTRAP,  6, 10 }, // 0xA000, Sum =  0x16000 (.bin size = 0x143B0)
    { BlockRange::BLOCKTYPE_CODE,             11, 44 }, // 0x4400
    { MEMORY_BLOCKTYPE_GCC_SPECIAL_CODE,      45, 53 }, // 0x12000, Sum = 0x56000, Flash size = 0x542C0
    { BlockRange::BLOCKTYPE_DEPLOYMENT,       54, 60 }, // 0xE000 -> 56 KiBi for application code
    { BlockRange::BLOCKTYPE_STORAGE_A,        61, 61 },
    { BlockRange::BLOCKTYPE_STORAGE_B,        62, 62 },
    { BlockRange::BLOCKTYPE_CONFIG,           63, 63 }};
Note: Blocks of same type can be merged (bootstrap + GCC special bootstrap, Code + GCC special code), they are there to enable compile-time configuration for GCC vs. the other compilers.

However, during my numerous experiments, I have found out that bootloader compiled with RVDS actually works with firmware compiled with GCC 4.4 (!), so it appears to be a better choice, as there is more memory left for the application code, because GCC bootloader is twice as big as RVDS one (~40 KiBi vs. ~80 KiBi). I will probably stick with this for now...

#4 jeremy

jeremy

    Member

  • Members
  • PipPip
  • 23 posts

Posted 22 August 2010 - 09:19 PM

This is fantastic, jeremy. Would it be alright if we integrated this into the Netduino source code download (or at least put a link to it in the downloads section)?

Chris


I would be honored if you did either of those things. It's nice to give back for a change.

Jeremy.

#5 sweetlilmre

sweetlilmre

    Advanced Member

  • Members
  • PipPipPip
  • 62 posts

Posted 31 August 2010 - 05:38 PM

Hi Jeremy, CW2,

I used your patches and all works pretty much as expected. Just to confirm, the target firmware will still be too large and will require the fix mentioned above in the other thread?
I get:

c:\GCC\bin\arm-none-eabi-ld.exe: region `LR_FLASH' overflowed by 576 bytes

Does this match your build? If so, its a pity its such a small difference! :)

edit: CW2:

For clarity (on my part):

// flash page is 8KB
// ranges are inclusive i.e. 0-5 is 6 pages
const BlockRange g_SAM7X_BS_BlockRange[] =
{
	{ BlockRange::BLOCKTYPE_BOOTSTRAP,     	0,  5 }, // 0x00000 - ( 6*8*1024) 0x0C000, length 0x0C000
	{ MEMORY_BLOCKTYPE_GCC_SPECIAL_BOOTSTRAP,  6, 10 }, // 0x0C000 - (11*8*1024) 0x16000, length 0x0A000, Sum = 0x16000 (.bin size = 0x143B0)
	{ BlockRange::BLOCKTYPE_CODE,         	11, 44 }, // 0x16000 - (45*8*1024) 0x5A000, length 0x44000
	{ MEMORY_BLOCKTYPE_GCC_SPECIAL_CODE,  	45, 53 }, // 0x5A000 - (54*8*1024) 0x6C000, length 0x12000, Sum = 0x56000, Flash size = 0x542C0
	{ BlockRange::BLOCKTYPE_DEPLOYMENT,   	54, 60 }, // 0x6C000 - (61*8*1024) 0x7A000, length 0x0E000 -> 56 KiBi for application code
	{ BlockRange::BLOCKTYPE_STORAGE_A,    	61, 61 }, // 0x7A000 - (62*8*1024) 0x7C000, length 0x02000
	{ BlockRange::BLOCKTYPE_STORAGE_B,    	62, 62 }, // 0x7C000 - (63*8*1024) 0x7E000, length 0x02000
	{ BlockRange::BLOCKTYPE_CONFIG,       	63, 63 }  // 0x7E000 - (64*8*1024) 0x80000, length 0x02000
};

So therefore:

<Set Name="Code_BaseAddress"	Value="0x00116000"/>
<Set Name="Deploy_BaseAddress"  Value="0x0016C000"/>

And once I have this correct I should be able to flash?

also:

However, during my numerous experiments, I have found out that bootloader compiled with RVDS actually works with firmware compiled with GCC 4.4 (!), so it appears to be a better choice, as there is more memory left for the application code, because GCC bootloader is twice as big as RVDS one (~40 KiBi vs. ~80 KiBi). I will probably stick with this for now...


This would be nice :) any hints on how to accomplish it?
-(e)

#6 x893

x893

    Member

  • Members
  • PipPip
  • 12 posts

Posted 01 September 2010 - 09:22 AM

After read about RVDS i specially make GCC 4.4 and RVDS 4.1 versions. Looks better with RVDS GCC 4.4 ------- 58 552 PortBooter.bin 75 856 PortBooterLoader.bin 65 736 Tinybooter.bin 82 864 TinyBooterDecompressor.bin 344 768 ER_FLASH (TinyClr.bin) RVDS 4.1 -------- 33 324 PortBooter.bin 39 452 PortBooterLoader.bin 39 372 Tinybooter.bin 41 712 TinyBooterDecompressor.bin 274 696 ER_FLASH (TinyClr.bin)

#7 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 01 September 2010 - 09:45 AM

And once I have this correct I should be able to flash?

I hope so, I used the same values.

This would be nice :) any hints on how to accomplish it?

Modify the block range table (conditional compilation symbols) so it contains the first 0xC000 bootstrap block, and the rest leave for code. Compile with RVDS, flash TinyBooterDecompressor.bin using SAM-BA (the bootloader now has block range table with code blocks large enough to contain firmware compiled with GCC), then compile firmware with GCC 4.4 and deploy ER_FLASH, ER_CONFIG via MFDeploy.

Tip: It is also possible to deploy bootloader hex files via MFDeploy, as long as the code fits into block range sectors.

EDIT: To verify block range table contents you can use "Flash Sector Map" command in MFDeploy's Plug-in\Debug menu.

Edited by CW2, 01 September 2010 - 09:53 AM.


#8 dragonfly

dragonfly

    Member

  • Members
  • PipPip
  • 12 posts
  • LocationSouth Africa

Posted 16 October 2010 - 08:30 AM

I'm not having much luck building the firmware - I suspect I'm using the wrong compiler but I'm not sure.

Here's what I've installed so far:
- Installed Visual C# Express 2010 and Visual C++ Express 2010
- Installed MicroFrameworkPK, MicroFrameworkPK (ARM Network Pack), MicroFrameworkPK (Crypto Pack) into MicroFrameworkPK_v4_1 folder
- Installed code sourcery arm-2010q1-188-arm-none-eabi downloaded from here http://www.codesourc...tal/release1294
- Copied Netduino Firmware v4.1.0 (patch 2) into the MicroFrameworkPK_v4_1 folder
- Download, unzipped the attachment from this thread and copied files into MicroFrameworkPK_v4_1 folder

At the command prompt:
- cd \MicroFrameworkPK_v4_1
- setenv_gcc4.4 c:\CodeSourcery
- msbuild Solutions\Netduino\dotnetemf.proj /p:flavor=release



Here's the error:
[code=auto:0]"C:\MicroFrameworkPK_v4_1\Solutions\Netduino\dotnetmf.proj" (default target) (1
) ->
"C:\MicroFrameworkPK_v4_1\Solutions\Netduino\TinyCLR\TinyCLR.proj" (Build targe
t) (84) ->
(BuildAXF target) ->
C:\MicroFrameworkPK_v4_1\tools\targets\Microsoft.SPOT.System.GCC.targets(343,
5): error MSB3073: The command ""c:\CodeSourcery\bin\arm-none-eabi-ld.exe" -st
atic --gc-sections --no-warn-mismatch --library-path=C:\MicroFrameworkPK_v4_1\B
uildOutput\THUMB\GCC4.4\le\FLASH\release\Netduino\lib --library-path=C:\MicroFr
ameworkPK_v4_1\BuildOutput\THUMB\GCC4.4\le\ANY_MEDIA\release\lib --allow-mult
iple-definition -u ARM_Vectors -u _start --Map C:\MicroFrameworkPK_v4_1\BuildOu
tput\THUMB\GCC4.4\le\FLASH\release\Netduino\bin\tinyclr.map --output=C:\MicroFr
ameworkPK_v4_1\BuildOutput\THUMB\GCC4.4\le\FLASH\release\Netduino\bin\tinyclr.a
xf --script=C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.4\le\FLASH\release\
Netduino\bin\tinyclr_scatterfile.ldf C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB
\GCC4.4\le\FLASH\release\Netduino\obj\Solutions\Netduino\TinyCLR\tinyclr_dat.ob
j C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.4\le\FLASH\release\Netduino\o
bj\Solutions\Netduino\TinyCLR\allocator.obj C:\MicroFrameworkPK_v4_1\BuildOutpu
t\THUMB\GCC4.4\le\FLASH\release\Netduino\obj\Solutions\Netduino\TinyCLR\tinyclr
.obj -( C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.4\le\ANY_MEDIA\release\
lib\Core.lib C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.4\le\ANY_MEDIA\rel
ease\lib\Hardware.lib C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.4\le\ANY_
MEDIA\release\lib\InterruptHandler.lib C:\MicroFrameworkPK_v4_1\BuildOutput\THU
MB\GCC4.4\le\ANY_MEDIA\release\lib\I2C.lib C:\MicroFrameworkPK_v4_1\BuildOutput
\THUMB\GCC4.4\le\ANY_MEDIA\release\lib\IOPort.lib C:\MicroFrameworkPK_v4_1\Buil
dOutput\THUMB\GCC4.4\le\ANY_MEDIA\release\lib\RPC_stub.lib C:\MicroFrameworkPK_
v4_1\BuildOutput\THUMB\GCC4.4\le\ANY_MEDIA\release\lib\Serialization_stub.lib C
:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.4\le\ANY_MEDIA\release\lib\Debug
ger.lib C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.4\le\ANY_MEDIA\release\
lib\Debugger_full.lib C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.4\le\ANY_
MEDIA\release\lib\Graphics_stub.lib C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\
GCC4.4\le\ANY_MEDIA\release\lib\CorLib.lib C:\MicroFrameworkPK_v4_1\BuildOutput
\THUMB\GCC4.4\le\ANY_MEDIA\release\lib\SPOT.lib C:\MicroFrameworkPK_v4_1\BuildO
utput\THUMB\GCC4.4\le\ANY_MEDIA\release\lib\SPOT_Crypto_stub.lib C:\MicroFramew
orkPK_v4_1\BuildOutput\THUMB\GCC4.4\le\ANY_MEDIA\release\lib\SPOT_Messaging_stu
b.lib C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.4\le\ANY_MEDIA\release\li
b\SPOT_Serialization_stub.lib C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.4
\le\ANY_MEDIA\release\lib\SPOT_Hardware.lib C:\MicroFrameworkPK_v4_1\BuildOutpu
t\THUMB\GCC4.4\le\ANY_MEDIA\release\lib\Messaging.lib C:\MicroFrameworkPK_v4_1\
BuildOutput\THUMB\GCC4.4\le\ANY_MEDIA\release\lib\CLRStartup.lib C:\MicroFramew
orkPK_v4_1\BuildOutput\THUMB\GCC4.4\le\ANY_MEDIA\release\lib\CRC.lib C:\MicroFr
ameworkPK_v4_1\BuildOutput\THUMB\GCC4.4\le\ANY_MEDIA\release\lib\WireProtocol.l
ib C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.4\le\ANY_MEDIA\release\lib\S
POT_Hardware_SerialPort.lib C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.4\l
e\ANY_MEDIA\release\lib\HeapPersistence.lib C:\MicroFrameworkPK_v4_1\BuildOutpu
t\THUMB\GCC4.4\le\ANY_MEDIA\release\lib\Diagnostics.lib C:\MicroFrameworkPK_v4_
1\BuildOutput\THUMB\GCC4.4\le\ANY_MEDIA\release\lib\Stream.lib C:\MicroFramewor
kPK_v4_1\BuildOutput\THUMB\GCC4.4\le\ANY_MEDIA\release\lib\SPOT_IO.lib C:\Micro
FrameworkPK_v4_1\BuildOutput\THUMB\GCC4.4\le\ANY_MEDIA\release\lib\SPOT_Hardwar
e_Usb.lib C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.4\le\FLASH\release\Ne
tduino\lib\tmp_tinyclr.lib C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.4\le
\FLASH\release\Netduino\lib\InteropAssembliesTable.lib -) -( "c:\CodeSourcery\a
rm-none-eabi\lib\thumb\libm.a" "c:\CodeSourcery\arm-none-eabi\lib\thumb\libc.a"
"c:\CodeSourcery\lib\gcc\arm-none-eabi\4.4.1\thumb\libgcc.a" -) -( C:\MicroFra
meworkPK_v4_1\tools\ads_v3_1\Lib\armlib\h_t.l C:\MicroFrameworkPK_v4_1\tools\ad
s_v3_1\Lib\armlib\c_t.l -)" exited with code 1. [C:\MicroFrameworkPK_v4_1\Solut
ions\Netduino\TinyCLR\TinyCLR.proj[code=auto:0]

Any ideas?

#9 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 16 October 2010 - 01:17 PM

- setenv_gcc4.4 c:\CodeSourcery

There is C:\PCodeSourcery (extra 'P') in the error dump.

#10 dragonfly

dragonfly

    Member

  • Members
  • PipPip
  • 12 posts
  • LocationSouth Africa

Posted 16 October 2010 - 02:07 PM

hehe oops :unsure: seems I made a typo somewhere. I've re-installed code sourcery to c:\CodeSourcery but it still seems to be giving the same error. From what I can find about MSB3073 it seems to be an error relating to a missing file or folder.

#11 dragonfly

dragonfly

    Member

  • Members
  • PipPip
  • 12 posts
  • LocationSouth Africa

Posted 16 October 2010 - 07:11 PM

GCC 4.2 gives the same error. Hmmm ... maybe there's some magic incantation I forgot to invoke somewhere?

"C:\MicroFrameworkPK_v4_1\Solutions\Netduino\TinyCLR\TinyCLR.proj" (default tar
get) (1) ->
(BuildAXF target) ->
  C:\MicroFrameworkPK_v4_1\tools\targets\Microsoft.SPOT.System.GCC.targets(306,
5): error MSB3073: The command ""c:\CodeSourcery\4.2\bin\arm-none-eabi-ld.exe"
 -static --gc-sections --no-warn-mismatch --library-path=C:\MicroFrameworkPK_v4
_1\BuildOutput\THUMB\GCC4.2\le\FLASH\release\Netduino\lib --library-path=C:\Mic
roFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\ANY_MEDIA\release\lib   --allow-
multiple-definition -u ARM_Vectors -u _start --Map C:\MicroFrameworkPK_v4_1\Bui
ldOutput\THUMB\GCC4.2\le\FLASH\release\Netduino\bin\tinyclr.map --output=C:\Mic
roFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\FLASH\release\Netduino\bin\tinyc
lr.axf --script=C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\FLASH\rele
ase\Netduino\bin\tinyclr_scatterfile.ldf C:\MicroFrameworkPK_v4_1\BuildOutput\T
HUMB\GCC4.2\le\FLASH\release\Netduino\obj\Solutions\Netduino\TinyCLR\tinyclr_da
t.obj C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\FLASH\release\Netdui
no\obj\Solutions\Netduino\TinyCLR\allocator.obj C:\MicroFrameworkPK_v4_1\BuildO
utput\THUMB\GCC4.2\le\FLASH\release\Netduino\obj\Solutions\Netduino\TinyCLR\tin
yclr.obj -( C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\ANY_MEDIA\rele
ase\lib\Core.lib C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\ANY_MEDIA
\release\lib\Hardware.lib C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\
ANY_MEDIA\release\lib\InterruptHandler.lib C:\MicroFrameworkPK_v4_1\BuildOutput
\THUMB\GCC4.2\le\ANY_MEDIA\release\lib\I2C.lib C:\MicroFrameworkPK_v4_1\BuildOu
tput\THUMB\GCC4.2\le\ANY_MEDIA\release\lib\IOPort.lib C:\MicroFrameworkPK_v4_1\
BuildOutput\THUMB\GCC4.2\le\ANY_MEDIA\release\lib\RPC_stub.lib C:\MicroFramewor
kPK_v4_1\BuildOutput\THUMB\GCC4.2\le\ANY_MEDIA\release\lib\Serialization_stub.l
ib C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\ANY_MEDIA\release\lib\D
ebugger.lib C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\ANY_MEDIA\rele
ase\lib\Debugger_full.lib C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\
ANY_MEDIA\release\lib\Graphics_stub.lib C:\MicroFrameworkPK_v4_1\BuildOutput\TH
UMB\GCC4.2\le\ANY_MEDIA\release\lib\CorLib.lib C:\MicroFrameworkPK_v4_1\BuildOu
tput\THUMB\GCC4.2\le\ANY_MEDIA\release\lib\SPOT.lib C:\MicroFrameworkPK_v4_1\Bu
ildOutput\THUMB\GCC4.2\le\ANY_MEDIA\release\lib\SPOT_Crypto_stub.lib C:\MicroFr
ameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\ANY_MEDIA\release\lib\SPOT_Messaging
_stub.lib C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\ANY_MEDIA\releas
e\lib\SPOT_Serialization_stub.lib C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GC
C4.2\le\ANY_MEDIA\release\lib\SPOT_Hardware.lib C:\MicroFrameworkPK_v4_1\BuildO
utput\THUMB\GCC4.2\le\ANY_MEDIA\release\lib\Messaging.lib C:\MicroFrameworkPK_v
4_1\BuildOutput\THUMB\GCC4.2\le\ANY_MEDIA\release\lib\CLRStartup.lib C:\MicroFr
ameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\ANY_MEDIA\release\lib\CRC.lib C:\Mic
roFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\ANY_MEDIA\release\lib\WireProtoc
ol.lib C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\ANY_MEDIA\release\l
ib\SPOT_Hardware_SerialPort.lib C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4
.2\le\ANY_MEDIA\release\lib\HeapPersistence.lib C:\MicroFrameworkPK_v4_1\BuildO
utput\THUMB\GCC4.2\le\ANY_MEDIA\release\lib\Diagnostics.lib C:\MicroFrameworkPK
_v4_1\BuildOutput\THUMB\GCC4.2\le\ANY_MEDIA\release\lib\Stream.lib C:\MicroFram
eworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\ANY_MEDIA\release\lib\SPOT_IO.lib C:\M
icroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\ANY_MEDIA\release\lib\SPOT_Har
dware_Usb.lib C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\FLASH\releas
e\Netduino\lib\tmp_tinyclr.lib C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.
2\le\FLASH\release\Netduino\lib\InteropAssembliesTable.lib -) -( "c:\CodeSource
ry\4.2\arm-none-eabi\lib\thumb\libm.a" "c:\CodeSourcery\4.2\arm-none-eabi\lib\t
humb\libc.a" "c:\CodeSourcery\4.2\lib\gcc\arm-none-eabi\4.2.1\thumb\libgcc.a" -
) -( C:\MicroFrameworkPK_v4_1\tools\ads_v3_1\Lib\armlib\h_t.l C:\MicroFramework
PK_v4_1\tools\ads_v3_1\Lib\armlib\c_t.l -)" exited with code 1. [C:\MicroFramew
orkPK_v4_1\Solutions\Netduino\TinyCLR\TinyCLR.proj]


Edit:
The reported error in C:\MicroFrameworkPK_v4_1\tools\targets\Microsoft.SPOT.System.GCC.targets on line 306 is this:

<Exec Condition="'$(COMPILER_TOOL_VERSION)'=='GCC4.2'" Command="$(LINK) $(LINK_FLAGS) 
-u ARM_Vectors -u _start --Map $(EXEName).map --output=@(EXEOutput) --script=@(EXEScatterFile,' ')
 @(EXEInputs,' ') -( @(PlatformIndependentLibs-> 
'$(PLATFORM_INDEPENDENT_RELATIVE_LIB_DIR)%(FileName)%(Extension)',' ') 
$(LIB_DIR)\tmp_$(AssemblyName).$(LIB_EXT) @(InputLibs,' ') -) -( &#x22;$(GNU_LIB_DIR)\libm.a&#x22;
 &#x22;$(GNU_LIB_DIR)\libc.a&#x22; &#x22;$(GNU_LIBGCC_DIR)\$(LIBGCC)&#x22; -) -( $(ExtraLibs) -
)"/>

Edit:
Finally got this to compile - so I thought I'd add it here to help all the newbies like me. Here's what I did.

1. Installed Porting Kit NoLibs and Porting Kit NetARM (did not install Porting Kit Crypto Pack)

2. Run the build and send the output to a file, eg:
msbuild Solutions\Netduino\dotnetmf.proj /t:build /t:flavor=release > log.txt

3. Open log.txt and copy the command which is causing the error, eg:

The command ".....copy everything between these quotes....." exited with code 1. [C:\MicroFramew
orkPK_v4_1\Solutions\Netduino\TinyCLR\TinyCLR.proj]

4. Paste the command into the command prompt and hit enter - it runs and shows a different error message, one that you can actually read, eg:

c:\CodeSourcery\bin\arm-none-eabi-ld.exe: C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le
 \FLASH\release\Netduino\bin\tinyclr.axf 
section ER_FLASH will not fit in region LR_FLASH

c:\CodeSourcery\bin\arm-none-eabi-ld.exe: region LR_FLASH overflowed by 15744 bytes

5. From there it's pretty easy. In this case the solution is to adjust the memory which is described here.

6. Profit!

I'm going to try the same approach with GCC4.4 and see if I can get that to work. :huh:

Edit:
Making progress - build.dirproj builds without errors using GCC 4.4, however building the Netduino solution results in this error:

tmp_Tinybooter.lib(tinyhal.obj): In function `HAL_Initialize()':
tinyhal.cpp:(.text._Z14HAL_Initializev+0x104): undefined reference to `DeploymentTransport_Initialize()'

Edited by dragonfly, 18 November 2010 - 08:57 PM.


#12 dragonfly

dragonfly

    Member

  • Members
  • PipPip
  • 12 posts
  • LocationSouth Africa

Posted 18 November 2010 - 08:56 PM

With help from sweetlilmre I've manged to merge Jeremy's GCC 4.4 path with the Netduino 4.1.0.5 firmware. The solutions compiles with the predictable result that LR_FLASH overflowed by 648 bytes. I updated BLOCKRANGE with the example posted above and edited scatterfile_tinyclr_gcc4.4.xml as follows:

<Set Name="Deploy_BaseAddress"  Value="0x00172348"/>

Compiling now gives a generic CLR_E_FAIL error for metadataprocessor for this command:

C:\MicroFrameworkPK_v4_1\BuildOutput\public\Release\Server\dll\MetaDataProcessor.exe -sign_file
C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.4\le\FLASH\release\Netduino\bin\tinyclr.bin\ER_DAT
C:\MicroFrameworkPK_v4_1\tools\bin\tinybooter_private_key.bin
C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.4\le\FLASH\release\Netduino\bin\tinyclr.hex\ER_DAT.sig

... yet crazy-land does not end there, oh no. In trying to replicate everything I deleted the BuildOutput folder, then did:

msbuild /t:clean build.dirproj
msbuild /t:build build.dirproj

The result, 442 Error(s). Meh, enough to make one crazy :blink:

I've attached the current firmware which I'm trying to build.

Edit:
GCC 4.4 compiles now for fw 4.1.0.5 - I have posted the patch on the thread for that firmware.

#13 elettrozero

elettrozero

    Advanced Member

  • Members
  • PipPipPip
  • 58 posts

Posted 02 June 2011 - 01:18 PM

Attached is a zip file that contains an updated build environment to allow the use of GCC 4.4 to build the firmware. This yields a much smaller binary than the 4.2 build tools. This saves around 15K or so with the stock netduino formware build.

The build environment is copied over the existing files in the same way the original netduino firmware source is deployed.

A new setenv command, setenv_gcc4.4 is used to set the build environment up. This is used the same way as the original setenv_gcc command.


Does it work for ND+ too if I copy files in right location ?

#14 elettrozero

elettrozero

    Advanced Member

  • Members
  • PipPipPip
  • 58 posts

Posted 03 June 2011 - 08:16 AM


Edit:
Making progress - build.dirproj builds without errors using GCC 4.4, however building the Netduino solution results in this error:

tmp_Tinybooter.lib(tinyhal.obj): In function `HAL_Initialize()':
tinyhal.cpp:(.text._Z14HAL_Initializev+0x104): undefined reference to `DeploymentTransport_Initialize()'


How did you managed to get thru it ? is it a matter of FW version ?




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.