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

Firmware build issues


  • Please log in to reply
36 replies to this topic

#21 jeremy

jeremy

    Member

  • Members
  • PipPip
  • 23 posts

Posted 17 August 2010 - 04:38 PM

So, this means you plan to create a copy of setenv_gcc.cmd for 4.4 (?). I have managed to successfully build the firmware with GCC 4.4.1 (CodeSourcery G++ Lite 2010Q1) with only two changes: I commented out hal_vsnprintf() function in tinycrt.cpp (lines 360-365) and copied libraries from lib\gcc\arm-none-eabi\4.4.1 to 4.2.1 - this can be easily fixed in setenv_base.cmd (e.g. by adding a new case for "GCC4.4"). The result binary is only 704 bytes bigger (4.1.0.2, default features).


Pretty much, other than setting the GCC versions properly so you don't have to copy libraries about. Most of the changes are only in a couple of key build files. The change to call set base with GCC4.4 instead of GCC4.2 has a bunch of side effects that cause the build to fail without matching changes elsewhere.

I'm also making the scatterfiles dependent on the version of GCC so you can switch back and forth easily. So instead of scatter_file_gcc there is scatter_file_gcc4.2 and scatterfile_gcc4.4. The build output directories also properly reflect the version of GCC used, 4.2 or 4.4.

I'll need to annotate the build files to make the changes stand out so other folks know what I changed.



I did pretty much the same thing as you the first time through.

#22 CMD

CMD

    New Member

  • Members
  • Pip
  • 5 posts

Posted 18 August 2010 - 07:41 AM

Thanks Chris, but after installing gcc, which you recommended, the number of errors increased to 4. List attached New case with other projects (SAM7X and SAM7S) the number of errors decreased to the same four Will any suggestions?)

Attached Files

  • Attached File  1.txt   9.96KB   30 downloads


#23 CMD

CMD

    New Member

  • Members
  • Pip
  • 5 posts

Posted 18 August 2010 - 08:27 AM

I went on after Comment lcd_printf, left

"d:\Sourcery\bin\arm-none-eabi-ld.exe" -static --gc-sections --no-warn-misma
tch --library-path=c:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\FLASH
\release\Netduino\lib --library-path=c:\MicroFrameworkPK_v4_1\BuildOutput\THU
MB\GCC4.2\le\ANY_MEDIA\release\lib --allow-multiple-definition -u ARM_Vecto
rs -u _start --Map c:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\FLASH
\release\Netduino\bin\NativeSample.map --output=c:\MicroFrameworkPK_v4_1\Buil
dOutput\THUMB\GCC4.2\le\FLASH\release\Netduino\bin\NativeSample.axf --script=
c:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\FLASH\release\Netduino\b
in\NativeSample_scatterfile.ldf c:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GC
C4.2\le\FLASH\release\Netduino\obj\Solutions\Netduino\NativeSample\NativeSamp
le.obj -( c:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\ANY_MEDIA\rele
ase\lib\CRC.lib c:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\ANY_MEDI
A\release\lib\WireProtocol.lib c:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC
4.2\le\FLASH\release\Netduino\lib\tmp_NativeSample.lib -) -( "d:\Sourcery\ar
m-none-eabi\lib\thumb\libm.a" "d:\Sourcery\arm-none-eabi\lib\thumb\libc.a" "d
:\Sourcery\lib\gcc\arm-none-eabi\4.2.1\thumb\libgcc.a" -) -( c:\MicroFramewor
kPK_v4_1\tools\ads_v3_1\Lib\armlib\h_t.l c:\MicroFrameworkPK_v4_1\tools\ads_v
3_1\Lib\armlib\c_t.l -)
c:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\FLASH\release\Netduino\l
ib\tmp_NativeSample.lib(usb.obj): In function `USB_StateCallback(USB_CONTROLL
ER_STATE*)':
usb.cpp:(.text._Z17USB_StateCallbackP20USB_CONTROLLER_STATE+0x2a): undefined
reference to `__gnu_thumb1_case_uqi'

c:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\FLASH\release\Netduino\l
ib\tmp_NativeSample.lib(usb.obj): In function `USB_ControlCallback(USB_CONTRO
LLER_STATE*)':
usb.cpp:(.text._Z19USB_ControlCallbackP20USB_CONTROLLER_STATE+0x1c): undefine
d reference to `__gnu_thumb1_case_uqi'
c:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\FLASH\release\Netduino\l
ib\tmp_NativeSample.lib(AT91_GPIO.obj): In function `AT91_GPIO_Driver::Enable
InputPin(unsigned int, unsigned int, void (*)(unsigned int, unsigned int, voi
d*), void*, GPIO_INT_EDGE, GPIO_RESISTOR)':
AT91_GPIO.cpp:(.text._ZN16AT91_GPIO_Driver14EnableInputPinEjjPFvjjPvES0_13GPI
O_INT_EDGE13GPIO_RESISTOR+0xc2): undefined reference to `__gnu_thumb1_case_uq
i'

#24 CMD

CMD

    New Member

  • Members
  • Pip
  • 5 posts

Posted 18 August 2010 - 11:12 AM

all the top issues resolved. +) It's as I had to do clean-up (/ t: clean) but a new problem. Try reinstalling the Porting Kit

#25 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 18 August 2010 - 11:58 AM

It's as I had to do clean-up (/ t: clean)

There is also a target for clean build: /t:CleanBuild.

#26 CMD

CMD

    New Member

  • Members
  • Pip
  • 5 posts

Posted 18 August 2010 - 01:10 PM

Complete cleaning helped. All compile, but at the end following problem: d: \ Sourcery \ bin \ arm-none-eabi-ld.exe: c: \ MicroFrameworkPK_v4_1 \ BuildOutput \ TH UMB \ GCC4.2 \ le \ FLASH \ release \ Netduino \ bin \ tinyclr.axf section ER_FLASH will no t fit in region LR_FLASH d: \ Sourcery \ bin \ arm-none-eabi-ld.exe: region LR_FLASH overflowed by 15,080 byt es This is because the firmware is larger than necessary, or for some other reason?

#27 jeremy

jeremy

    Member

  • Members
  • PipPip
  • 23 posts

Posted 18 August 2010 - 01:24 PM

Complete cleaning helped.
All compile, but at the end following problem:


d: \ Sourcery \ bin \ arm-none-eabi-ld.exe: c: \ MicroFrameworkPK_v4_1 \ BuildOutput \ TH
UMB \ GCC4.2 \ le \ FLASH \ release \ Netduino \ bin \ tinyclr.axf section ER_FLASH will no
t fit in region LR_FLASH
d: \ Sourcery \ bin \ arm-none-eabi-ld.exe: region LR_FLASH overflowed by 15,080 byt
es

This is because the firmware is larger than necessary, or for some other reason?


CMD,

you need to spend some time reading and understanding the porting kit documentation. This will explain your issue. Look up scatterfiles.

The fact is that there is no compelling reason to build the firmware unless you want to make changes to it. If you want to make changes then there is no alternative but to spend a good few hours understanding what the porting kit docs have to say.

This assumes you have a background doing embedded development in assembler and/or C and understand how to lay out memory. The tinyCLR firmware is not place to start learning about embedded development in C.

#28 pascal06

pascal06

    Advanced Member

  • Members
  • PipPipPip
  • 95 posts
  • LocationFrance

Posted 28 August 2010 - 09:46 PM

CMD,

you need to spend some time reading and understanding the porting kit documentation. This will explain your issue. Look up scatterfiles.

The fact is that there is no compelling reason to build the firmware unless you want to make changes to it. If you want to make changes then there is no alternative but to spend a good few hours understanding what the porting kit docs have to say.

This assumes you have a background doing embedded development in assembler and/or C and understand how to lay out memory. The tinyCLR firmware is not place to start learning about embedded development in C.


Hello,

I also try to rebuild firmware with GCC 4.2, and after multiple issues, I'm finaly near the success (I hope). I just have a issue regarding signature. But it's strange because I thought I do not need to sign firmware.

Here is my error message :

BuildSigFiles:
  Create Signature files for C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\FLASH\release\Netduino\bin\tinyclr.bin\ER_CONFIG;C:\MicroFrameworkPK_v4_1\Bui
  ldOutput\THUMB\GCC4.2\le\FLASH\release\Netduino\bin\tinyclr.bin\ER_DAT;C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\FLASH\release\Netduino\bin\tinycl
  r.bin\ER_FLASH
  C:\MicroFrameworkPK_v4_1\BuildOutput\public\Release\Server\dll\MetaDataProcessor.exe -sign_file C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\FLASH\re
  lease\Netduino\bin\tinyclr.bin\ER_CONFIG C:\MicroFrameworkPK_v4_1\tools\bin\tinybooter_private_key.bin C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\F
  LASH\release\Netduino\bin\tinyclr.hex\ER_CONFIG.sig
  C:\MicroFrameworkPK_v4_1\BuildOutput\public\Release\Server\dll\MetaDataProcessor.exe -sign_file C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\FLASH\re
  lease\Netduino\bin\tinyclr.bin\ER_DAT C:\MicroFrameworkPK_v4_1\tools\bin\tinybooter_private_key.bin C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\FLAS
  H\release\Netduino\bin\tinyclr.hex\ER_DAT.sig
MMP : error MMP0000: CLR_E_FAIL [C:\MicroFrameworkPK_v4_1\Solutions\Netduino\TinyCLR\TinyCLR.proj]
C:\MicroFrameworkPK_v4_1\tools\targets\Microsoft.SPOT.System.GCC.targets(391,5): error MSB3073: The command "C:\MicroFrameworkPK_v4_1\BuildOutput\public\Releas
e\Server\dll\MetaDataProcessor.exe -sign_file C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\FLASH\release\Netduino\bin\tinyclr.bin\ER_DAT C:\MicroFramew
orkPK_v4_1\tools\bin\tinybooter_private_key.bin C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\FLASH\release\Netduino\bin\tinyclr.hex\ER_DAT.sig" exited
with code 10. [C:\MicroFrameworkPK_v4_1\Solutions\Netduino\TinyCLR\TinyCLR.proj]
Done Building Project "C:\MicroFrameworkPK_v4_1\Solutions\Netduino\TinyCLR\TinyCLR.proj" (Build target(s)) -- FAILED.

Done Building Project "C:\MicroFrameworkPK_v4_1\Solutions\Netduino\dotnetmf.proj" (default targets) -- FAILED.


Build FAILED.
Thanks in advance,
/pascal

#29 pascal06

pascal06

    Advanced Member

  • Members
  • PipPipPip
  • 95 posts
  • LocationFrance

Posted 29 August 2010 - 11:06 AM

Hello,

I also try to rebuild firmware with GCC 4.2, and after multiple issues, I'm finaly near the success (I hope). I just have a issue regarding signature. But it's strange because I thought I do not need to sign firmware.

Here is my error message :

BuildSigFiles:
  Create Signature files for C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\FLASH\release\Netduino\bin\tinyclr.bin\ER_CONFIG;C:\MicroFrameworkPK_v4_1\Bui
  ldOutput\THUMB\GCC4.2\le\FLASH\release\Netduino\bin\tinyclr.bin\ER_DAT;C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\FLASH\release\Netduino\bin\tinycl
  r.bin\ER_FLASH
  C:\MicroFrameworkPK_v4_1\BuildOutput\public\Release\Server\dll\MetaDataProcessor.exe -sign_file C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\FLASH\re
  lease\Netduino\bin\tinyclr.bin\ER_CONFIG C:\MicroFrameworkPK_v4_1\tools\bin\tinybooter_private_key.bin C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\F
  LASH\release\Netduino\bin\tinyclr.hex\ER_CONFIG.sig
  C:\MicroFrameworkPK_v4_1\BuildOutput\public\Release\Server\dll\MetaDataProcessor.exe -sign_file C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\FLASH\re
  lease\Netduino\bin\tinyclr.bin\ER_DAT C:\MicroFrameworkPK_v4_1\tools\bin\tinybooter_private_key.bin C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\FLAS
  H\release\Netduino\bin\tinyclr.hex\ER_DAT.sig
MMP : error MMP0000: CLR_E_FAIL [C:\MicroFrameworkPK_v4_1\Solutions\Netduino\TinyCLR\TinyCLR.proj]
C:\MicroFrameworkPK_v4_1\tools\targets\Microsoft.SPOT.System.GCC.targets(391,5): error MSB3073: The command "C:\MicroFrameworkPK_v4_1\BuildOutput\public\Releas
e\Server\dll\MetaDataProcessor.exe -sign_file C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\FLASH\release\Netduino\bin\tinyclr.bin\ER_DAT C:\MicroFramew
orkPK_v4_1\tools\bin\tinybooter_private_key.bin C:\MicroFrameworkPK_v4_1\BuildOutput\THUMB\GCC4.2\le\FLASH\release\Netduino\bin\tinyclr.hex\ER_DAT.sig" exited
with code 10. [C:\MicroFrameworkPK_v4_1\Solutions\Netduino\TinyCLR\TinyCLR.proj]
Done Building Project "C:\MicroFrameworkPK_v4_1\Solutions\Netduino\TinyCLR\TinyCLR.proj" (Build target(s)) -- FAILED.

Done Building Project "C:\MicroFrameworkPK_v4_1\Solutions\Netduino\dotnetmf.proj" (default targets) -- FAILED.


Build FAILED.
Thanks in advance,
/pascal


Next time, I will read the thread more carefully :unsure: ... The answer was in the thread.
Now I will start to try some native code,
Pascal

#30 pascal06

pascal06

    Advanced Member

  • Members
  • PipPipPip
  • 95 posts
  • LocationFrance

Posted 29 August 2010 - 12:31 PM

Next time, I will read the thread more carefully :unsure: ... The answer was in the thread.
Now I will start to try some native code,
Pascal


Next step, deploying failed,
Reflash with SAM-BA, first with my own TinyBooterDecompressor compiled with GCC, then failed,
Reflash with official TinyBooterDecompressor, success,

But now, I'm not able to start any native code :(

Here is what I have done :

- Install PK 4.1
- Install Network part
- Install Crypto part
- Install CodeSourcery 4.2 (lite)
- Open cmd
- setenv_gcc_cmd C:\PROGRA~1\CODESO~1\SOURCE~1 (using 8.3 name, long name doesn't work)
- msbuild Solutions\Netduino\dotnetmf.proj /p:flavor=Release
- No enough room on flash
- Open Solutions\Netduino\TinyCLR\Scatter_tinyclr_gcc.xml
- Change Deploy_BaseAddress from 0x00172000 to 0x00175D28 to leave more space (exactly the difference showed by msbuild)
- Compile again
- Error during signature make
- Apply jemery fix
- compile again, then success (with a erase of BuildOutput folder and msbuild with /t:CleanBuild)
- msdeploy, failed
- reflash my arduino

Any help appreciate,
Pascal

#31 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 29 August 2010 - 03:59 PM

Hi Pascal,

A few quick notes...

- setenv_gcc_cmd C:\PROGRA~1\CODESO~1\SOURCE~1 (using 8.3 name, long name doesn't work)


I always copy and paste the gcc c++ compiler to "c:\gcc" after installing CodeSourcery. That also alleviates any issues with really long command line statements...

- No enough room on flash
- Open Solutions\Netduino\TinyCLR\Scatter_tinyclr_gcc.xml
- Change Deploy_BaseAddress from 0x00172000 to 0x00175D28 to leave more space (exactly the difference showed by msbuild)


I don't think you need to do this (although someone might correct me here)... Any changes to the flash layout using the older GCC compiler should probably be done in:
C:\MicroFrameworkPK_v4_1\Solutions\Netduino\DeviceCode\Blockstorage\Sam7X_blockstorage

- reflash my arduino


Well, just make sure you reflash your Netduino with the firmware as well. Just teasing. :)

Chris

#32 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 29 August 2010 - 04:52 PM

- msdeploy, failed

The problem is that code generated by GCC does not fit into flash segments, hardcoded as a table in bootloader, which must be changed - I have already written about this in different thread.

#33 pascal06

pascal06

    Advanced Member

  • Members
  • PipPipPip
  • 95 posts
  • LocationFrance

Posted 29 August 2010 - 07:48 PM

The problem is that code generated by GCC does not fit into flash segments, hardcoded as a table in bootloader, which must be changed - I have already written about this in different thread.


Thanks Chris & CW2 for your help,

CW2, may you confirm that I don't need to change scatterfiles in any case (even if I add some new assembly in firmware, but that's not my case at this time) ? Because, when I don't change this file, I always receive an error at compile time (LR_FLASH bla bla bla) ... Even if I change the blockrange value.

Before starting any native code, I need to be able to rebuild successfuly a firmware with GCC. I don't have RVDS.

Is RVDS expensive ? Difficult to find any price !!!

/pascal

#34 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 29 August 2010 - 08:32 PM

CW2, may you confirm that I don't need to change scatterfiles in any case (even if I add some new assembly in firmware, but that's not my case at this time) ?

I had to change scatterfile to match the blockrange - for example, I changed Code_BaseAddress to 0x116000, where the first BLOCKTYPE_CODE started (adjusted to accomodate ~81KB bootloader).

Is RVDS expensive ? Difficult to find any price !!!

I use an evaluation of RVDS 4.1 Pro (registration required for download link). I don't know how much is it, but the fact you must ask for a quote indicates it is not cheap.

#35 pascal06

pascal06

    Advanced Member

  • Members
  • PipPipPip
  • 95 posts
  • LocationFrance

Posted 29 August 2010 - 09:15 PM

I had to change scatterfile to match the blockrange - for example, I changed Code_BaseAddress to 0x116000, where the first BLOCKTYPE_CODE started (adjusted to accomodate ~81KB bootloader).


I use an evaluation of RVDS 4.1 Pro (registration required for download link). I don't know how much is it, but the fact you must ask for a quote indicates it is not cheap.


Thanks CW2 !!

#36 pascal06

pascal06

    Advanced Member

  • Members
  • PipPipPip
  • 95 posts
  • LocationFrance

Posted 06 October 2010 - 08:54 PM

Curious. We'll do a clean build and play with both RVDS and GCC compilation to see if we can help make it easier...


It seems that environment variables was changed between RVDS 4.0 and RVDS 4.1.

I'm successful with both Netduino & NetduinoPlus with this setenv_RVDS4.1.cmd content :

@echo off

set RVCT40BIN=%ARMCC41BIN%
set RVCT40INC=%ARMCC41INC%
set RVCT40LIB=%ARMCC41LIB%

setenv_base.cmd RVDS4.0 PORT


Without any files move or other files modifications,

Hope can help others,

Pascal

#37 elettrozero

elettrozero

    Advanced Member

  • Members
  • PipPipPip
  • 58 posts

Posted 02 June 2011 - 08:55 AM

Hi, maybe I'm little late but : is there any task to do with Solution Wizard provided by MF PK ? Maybe setting something related to the RAM of the device ? Thanks




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.