cancel
Showing results for 
Search instead for 
Did you mean: 

IAR Kickstart STM8L05 EEPROM

Andre1
Associate II
Posted on February 04, 2014 at 11:50

Hi

I'm using the 8K limited IAR Kickstart compiler on the STM8L051F3 (8K)

I'm using EEPROM and get the following 3 Linker errors

Error[Li005]: no definition for ''__eeprom_program_byte'' [referenced from eeprom_util.o(dlstm8smn.a)]

Error[Li005]: no definition for ''__eeprom_wait_for_last_operation'' [referenced from eeprom_util.o(dlstm8smn.a)]

Error[Li005]: no definition for ''__eeprom_program_long'' [referenced from eeprom_util.o(dlstm8smn.a)]

The functions are not mine. They are IAR library functions.

Does the Kickstart compiler support EEPROM?

Is there a special include file needed for EEPROM?

I've scanned through the General and Linker options and changed a few settings but to no avail.

Any suggestions?

Thanks

Andre

5 REPLIES 5
chen
Associate II
Posted on February 04, 2014 at 18:24

Hi

''Error[Li005]: no definition for ''__eeprom_program_byte''

''The functions are not mine. They are IAR library functions.''

Extremely unlikely to be from IAR! IAR only provide the compiler and standard libraries (ed stdio.h).

You need to get these libraries from ST

Andre1
Associate II
Posted on February 04, 2014 at 22:58

Hi

I'm not using any of the peripheral driver from ST so it's not related to any of them.

Looking at ''referenced from eeprom_util.o(dlstm8smn.a)'',

I would say that IAR have an eeprom_util.o object link inside their library dlstm8smn.a

The ''mn'' part of dlstm8smn.a stands for medium and normal where ''normal'' could be ''full''

if the Project Options->General->Library is changed to ''full''. Other option include none or custom. Medium relates to the memory size...I think.

I've tried changing these options but with no effect.

It is as though the IAR compiler library is incomplete, hence the question does the Kickstart support EEPROM.

Thanks

Andre

Andre1
Associate II
Posted on February 05, 2014 at 01:10

Hi

It seems that IAR have made these 3 functions external.

It's up to the user implement them.

Would be nice if they could mention this somewhere.

I'm pulling in the ST peripheral library for FLASH as they have these 3 functions and a whole lot more that I don't need. (convoluted and bloated)

So far it does not compile...

Thanks

Andre

chen
Associate II
Posted on February 05, 2014 at 11:51

Hi

''Looking at ''referenced from eeprom_util.o(dlstm8smn.a)'',

I would say that IAR have an eeprom_util.o object link inside their library dlstm8smn.a''

Yes, you are right. When I looked at the IAR web site, the STM8 compiler does indeed have some support for the EEPROM in the STM8.

I am sorry but having not done any work with IAR and STM8 I do not know enough to help you.

''I'm pulling in the ST peripheral library for FLASH as they have these 3 functions and a whole lot more that I don't need. (convoluted and bloated)''

Do not worry about unused functions (bloat). The linker can remove then, there is a compiler and linker switch to do this. There is a compiler switch to compile each function so that it can be seperated in the .o There is a linker switch to tell the linker to only put in functions that are used.

Andre1
Associate II
Posted on February 05, 2014 at 23:14

Thanks for the reply,

I gave up on using the ST peripheral drivers. So many files and compile errors.

It was easier to write my own functions to do this once I understood the problem.

When using for example the Raisonance Compiler you can simply write a byte to EEPROM by

*address = data;  ....where address is a pointer to EEPROM memory

while( ...test FLASH status register....programming not complete);

It seems that if you apply the first line above in an IAR compiler they call the function

__eeprom_program_byte followed by __eeprom_wait_for_last_operation

(I can't confirm this as the Kikstart Compiler does not allow one to look at the assembler files)

I don't use a 4 byte (word) write so I placed no code in the __eeprom_program_long function. Just a dummy function the keep the linker happy.

I made use of the code from the ST peripheral driver and simplified it, got rid of all the ENUMS and #defines. I kept the timeout in case while loop gets stuck.

It seems to work.

It would have been nice to have to type of APP note to work from.

Thanks

Andre