Hi,

to answer the first question: The undefined symbols during linking should
probably be errors, not warnings. The resulting binary will most likely not
work. As you can see, all symbols are by default assumed to reside at
address 0x0. I would not flash that ...

To fix it, you may need to get the order correctly in which you link .o
files (compiled .c files) and .a/.lib files (static libraries). Generally,
libraries referenced by other modules (.o or .a/.lib) need to come later on
the command line so that the linkers can first known which symbols to look
for and then find them in later files.


Hope that helps,
Raphael


On Mon, Nov 17, 2014 at 1:05 PM, Rolf Schroder <r...@supenta.com> wrote:

> Dear All,
>
> I am trying to compile a firmware for the STM8L. I used STVD & Cosmic
> (compiler) but want to switch to sdcc. I had made some small code changes
> to get everything running and I feel it's compiling correctly. I am using
> the following cmd to compile:
>
>  sdcc -lstm8 -mstm8 -I inc -I ../../Source/inc -I
> ../../Libraries/STM8L15x_StdPeriph_Driver/inc -I
> ../../Libraries/STM8L-discovery_Libraries/inc -D STM8L15X_MD -D __CSMC__
> --opt-code-size --disable-warning 126 src/main.c
>
> (warning 126 is about unreachable code, I have to define __CSMC__ [Cosmic
> compiler] because my project was created with STVD which only supports 3
> compilers [otherwise, I would need to change a lot of header files]; my MCU
> is STM8L152C8)
>
> As I said, it compiles, but generates the following warnings:
>
> ?ASlink-Warning-Undefined Global '_RTC_SetWakeUpCounter' referenced by
> module 'main'
>
> ?ASlink-Warning-Undefined Global '_GPIO_Init' referenced by module 'main'
>
> ?ASlink-Warning-Undefined Global '_ADC_DeInit' referenced by module 'main'
>
> ?ASlink-Warning-Undefined Global '_RTC_WakeUpCmd' referenced by module
> 'main'
>
> ?ASlink-Warning-Undefined Global '_FLASH_ProgramOptionByte' referenced by
> module 'main'
>
> ?ASlink-Warning-Undefined Global '_ADC_ChannelCmd' referenced by module
> 'main'
>
> ?ASlink-Warning-Undefined Global '_RTC_ITConfig' referenced by module
> 'main'
>
> ?ASlink-Warning-Undefined Global '_ADC_GetFlagStatus' referenced by module
> 'main'
>
> ?ASlink-Warning-Undefined Global '_CLK_PeripheralClockConfig' referenced
> by module 'main'
>
> ?ASlink-Warning-Undefined Global '_FLASH_EraseOptionByte' referenced by
> module 'main'
>
> ?ASlink-Warning-Undefined Global '_RTC_WakeUpClockConfig' referenced by
> module 'main'
>
> I am not very experienced and I don't know whether this should be a
> problem or not. main.map contains:
>
> ...
> ASxxxx Linker V03.00 + NoICE + sdld,  page 1.
> Hexadecimal  [32-Bits]
>
> Area                                    Addr        Size        Decimal
> Bytes (Attributes)
> --------------------------------        ----        ----        -------
> ----- ------------
> CABS                                00000000    00000000 =           0.
> bytes (ABS,CON)
>
>       Value  Global                              Global Defined In Module
>       -----  --------------------------------   ------------------------
>      00000000  _ADC_ChannelCmd
>      00000000  _ADC_DeInit
>      00000000  _ADC_GetFlagStatus
>      00000000  _CLK_PeripheralClockConfig
>      00000000  _FLASH_EraseOptionByte
>      00000000  _FLASH_ProgramOptionByte
>      00000000  _GPIO_Init
>      00000000  _RTC_ITConfig
>      00000000  _RTC_SetWakeUpCounter
>      00000000  _RTC_WakeUpClockConfig
>      00000000  _RTC_WakeUpCmd
> ...
>
> Greping for these keywords tells me that these are function names (without
> the prefixing underscore) in the STM8L libraries (inside my project). So
> they are there and I feel I just need a small change in order to prevent
> this problem.
>
> So, to sum up:
> #1 Does anyone know about this problems and how to deal with it?
> #2 I don't know whether I can flash my MCU and just check if it still
> works (as I said, I am inexperienced and I fear to damage the chip with a
> faulty firmware)
> #3 I am not sure, whether I need to use packihx or not. The sdcc manual
> states the the default output is already the Intel Hex format (which I used
> previously).
>
> Last but not least: You guys rock! I am really thankful for your project :)
> Thanks in advance,
> Rolf
>
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
>
> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
> _______________________________________________
> Sdcc-user mailing list
> Sdcc-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sdcc-user
>
>
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to