2013-03-19 01:54 AM
2013-03-21 09:41 AM
Thank you very much,
**with LD=arm-none-eabi-g++ If i use LIB = -lc -lgcc -lsimplemac-library Output is: ... c:/codesourcery/codesourcery20120963/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/bin/ld.exe: cannot find -lsimplemac-library collect2.exe: error: ld returned 1 exit status make: *** [talk.axf] Error 1 If i use LIB = -lc -lgcc /SimpleMAC/Binary/simplemac-library.a Output: ... ../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/bin/ld.exe: warning: /SimpleMAC/Binary/simplemac-library.a(analogue.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail ../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/bin/ld.exe: warning: /SimpleMAC/Binary/simplemac-library.a(cal_adc.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail ../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/bin/ld.exe: warning: /SimpleMAC/Binary/simplemac-library.a(phy-common.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail ../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/bin/ld.exe: warning: /SimpleMAC/Binary/simplemac-library.a(phy-library.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail ../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/bin/ld.exe: warning: /SimpleMAC/Binary/simplemac-library.a(phy.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail ../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/bin/ld.exe: warning: /SimpleMAC/Binary/simplemac-library.a(aes.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail ../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/bin/ld.exe: warning: /SimpleMAC/Binary/simplemac-library.a(analogue-cell-bias.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail ../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/bin/ld.exe: warning: /SimpleMAC/Binary/simplemac-library.a(analogue-filter.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail ../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/bin/ld.exe: warning: /SimpleMAC/Binary/simplemac-library.a(analogue-lna.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail ../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/bin/ld.exe: warning: /SimpleMAC/Binary/simplemac-library.a(analogue-mod-dac.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail ../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/bin/ld.exe: warning: /SimpleMAC/Binary/simplemac-library.a(analogue-vco.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail ../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/bin/ld.exe: warning: /SimpleMAC/Binary/simplemac-library.a(byte-utilities.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail ../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/bin/ld.exe: warning: /SimpleMAC/Binary/simplemac-library.a(eui64.o) uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail ../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/bin/ld.exe: warning: cannot find entry symbol ResetISR; defaulting to 08000000 ** with LD=arm-none-eabi-ld If i use LIB = -lc -lgcc -lsimplemac-library Output is: ... arm-none-eabi-ld: cannot find -lsimplemac-library make: *** [talk.axf] Error 1 If i use LIB = -lc -lgcc -simplemac-library Output: ... -lgcc -simplemac-library arm-none-eabi-ld: bad -rpath option make: *** [talk.axf] Error 12013-03-21 11:29 AM
There are three things to observe with this way of library linking.
The first: when specifying '-lname
' the linker searches forlib
name.a
. Second: it searches in pathes specified with-L
Third: the linker searches and processes libraries and object files in the order specified. So you might need to specify this library first, or use the--start-group
...--end-group
options to enforce a cyclic search.2013-03-22 01:27 AM
2013-03-22 01:59 AM
I renamed the file ''simplemac-library.a'' to ''libsimplemac-library.a'' and I linked with -lsimplemac-library
On *NIX systems, you could create a link the library under the new name, instead..../cortexm3/hal_clocks.c:221: undefined reference to `halInternalIdleSleep'
...
...\phy\em250class \analogue-cell-bias.c:(.text+0x7e): undefined reference to `stSerialPrintf'
Possibly you are missing a file you need to include in your project. A file search might help. If you are sure you don't need it, you can place some empty dummy functions somewhere in your project, to satisfy the linker. Only the interface (parameter, return value) need to be obeyed.
2013-03-22 03:15 AM
If you are sure you don't need it, you can place some empty dummy functions somewhere in your project, to satisfy the linker. Only the interface (parameter, return value) need to be obeyed.
**In \
Utilities\
STM32W108xx_HAL_Driver
\
micro
\
cortexm3
\
hal_clocks.c
reference
stSerialPrintf
(...)
;function
For instance
at
hal_clocks.c
line384:
CALDBG
(
stSerialPrintf
(
ST_ASSERT_SERIAL_PORT,''
halInternalCalibrateSlowRc:\
r
\
n
'');)
Being defined
in
the same file
:/
*
Provide
a simple
calibration
means
for
enabling
debug
output
*
/
# define
CALDBG
(x)
/ *
# Define
CALDBG
(x
) x* /
But
stSerialPrintf
function
not defined
in
any
site
to
compile
so
I find this
error:
\
SimpleMAC
\ Binary
\
simplemac
-
library.A(
analogue-cell-
bias.o):In function `
stmPrintCellBiasTables':(. text
+0
xc
:( undefinedreference to `
stSerialPrintf'
\
SimpleMAC
\ Binary
\
simplemac
-
library.A(
analogue-cell-
bias.o):In function `
.Text_4
'
:undefined reference to
`
stSerialPrintf'
make: ***
[
talk.axf]Error 1
** How to treat this other environments such as IAR?2013-03-22 03:36 AM
How to treat this other environments such as IAR?
So do you porting an application from (as it seems) CodeSourcery to IAR WB ?
/ * Provide a simple calibration means for enabling debug output * /
# define CALDBG (x)
/ * # Define CALDBG (x) x * /
This is a popular method to switch debugging outs on/off with one define at compile time.
If you are porting to IAR (as I suppose), you will need to check the CodeSourcery environment for the files implementing this debug support functionality. And it is left to your assessment if you port it, rewrite it or drop it alltogether.
But if your library does hard calls to
stSerialPrintf
(),
and you don't have the source, you will probably need to implement an empty stub.2013-03-22 04:37 AM
2013-03-23 09:02 AM
Forgive me, my English is horrible
Not actually. Guessing by names, my Italian is much worse ... I can run and debug every examples provide by ST in STM32F10x_StdPeriph_Lib and STM32W108xx_StdPeriph_Lib
...
Now i am trying to run and debug the same TALK application in my environment (windows+eclipse+codesourcery) but i have all these problems that we have been talking
It is an advantage to use one of the IDE's directly supported by ST's examples. Otherwise, it is best to use the version for the IDE that comes closest to yours. Atollic, for instance, is also Eclipse-based, with a gcc compiler. I'm using Crossworks (own IDE, gcc-based), so I'm used to port the examples. My method is to setup a new project in my IDE first. This pulls in the correct startup code and linker scipt. Porting that is really a PITA. Than, I add the project files. That works fine for freestanding examples, which come with sources., or for link-in libs. Examples based on proprietary frameworks are a PITA to port. ASF and StellarisWare come to my mind here. IAR WB has/had also some less CMSIS compatible headers, which complicates things. But as it seems, it's working now ...
2013-03-25 02:22 AM
2013-03-25 02:45 AM