cancel
Showing results for 
Search instead for 
Did you mean: 

STM32W and SimpleMAC Library

Martin.Sergio
Associate III
Posted on March 19, 2013 at 09:54

The original post was too long to process during our migration. Please click on the attachment to read the original post.
38 REPLIES 38
Martin.Sergio
Associate III
Posted on March 21, 2013 at 17:41

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 1

frankmeyer9
Associate II
Posted on March 21, 2013 at 19:29

There are three things to observe with this way of library linking.

The first: when specifying '

-lname

' the linker searches for

lib

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.

Martin.Sergio
Associate III
Posted on March 22, 2013 at 09:27

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6WR&d=%2Fa%2F0X0000000bpr%2Fi7u.oQl6NYCGPRwUwF7OEdGQWEHGhdjw_.xulpJWhzw&asPdf=false
frankmeyer9
Associate II
Posted on March 22, 2013 at 09:59

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.

Martin.Sergio
Associate III
Posted on March 22, 2013 at 11:15

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

line

384:

  

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

:( undefined

reference 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?

frankmeyer9
Associate II
Posted on March 22, 2013 at 11:36

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.
Martin.Sergio
Associate III
Posted on March 22, 2013 at 12:37

I'm trying to create a free development enviroment in windows with Eclipse and Codesourcery.

This enviroment works fine with stm32f103 and stm32f107, and also with stm32w108 (without simplemac-library.a)

I can run and debug every examples provide by ST in STM32F10x_StdPeriph_Lib and STM32W108xx_StdPeriph_Lib

I can create my own applications for my own boards, except if i need simplemac-library.a provided by ST in STM32W108xx_SimpleMAC

To use radio in MB851 REV_D evaluation Board first i use a trial of IAR compiling and debuging the examples provided by ST in STM32W108xx_SimpleMAC, one of this examples is TALK, and with IAR i not have any problem to compile and debug

Now i am trying to run and debug the same TALK application in my enviroment (windows+eclipse+codesourcery) but i have all these problems that we have been talking

Forgive me, my English is horrible

frankmeyer9
Associate II
Posted on March 23, 2013 at 17:02

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 ...

Martin.Sergio
Associate III
Posted on March 25, 2013 at 10:22

I'm sure it's easier to use a supported environment.

When using the IAR trial every was simpler, all examples run well, included examples with simplemac library, but i can not afford to pay a license.

When working with the F103 and F107 did not have too many problems in setting up the development environment using windows+eclipse+codesourcery, so i thought that for STM32W not going to be very different. I was wrong ;)

Although I managed to run the basic examples (STM32W108xx_StdPeriph_Lib_V1.0.1), I still can not run the samples given in STM32W108xx_SimpleMAC_V2.0.1

I'm from Spain ;)

Martin.Sergio
Associate III
Posted on March 25, 2013 at 10:45

I managed to compile even with warnings that appeared ( uses 2-byte wchar_t yet the output is to use 4-byte wchar_t; use of wchar_t values across objects may fail), but the application do not work, I must be doing something wrong because when I debug the program fails when call halInit();

I think there is something wrong when compiling HAL, and I'm missing something, such as sources of functions like stCalibrateVref();