Posted on May 17, 2011 at 12:15Hello,
With default compiler option, when you made a call to a function within a driver, all the driver size will be included in the final image and not only the used function size. In fact, when you call the NVIC_SetVectorTable function, all the stm32f10x_nvic.c object will be included in the final image which correspond to the extra 1KByte.
To avoid such scenario, you have to set the right compiler configuration. For RVMDK toolchain please proceed as follows: in the project option menu, select 'C/C++' window and check the ''One ELF Section per Function'' box.
In your attached project I can see that you uses the V0.2 of the STM32F10x Firmware Library, this release is not up to date as the V0.3 has been released some weeks ago. This release comes with a rich set of examples (69) covering all the product features (w/ 5 examples for the ADC) and a preconfigured projects for RVMDK and EWARM tool chains. Please download this last release,
http://mcu.st.com/mcu/modules.php?name=mcu&file=familiesdocs&FAM=110
, and use the provided project for RVMDK which has been optimized to get the best code size.
If this is not already done, you have also to download the last RVMDK version V3.11 from Keil website.
With regards,
Raouf.