Hi all,
OBS1: i'm not a specialist in C.
running the ADC example we have this code in configuration function. I dont know if this lib package is distributed by keil or ST. I received it from ST people with some keil examples.
#else /* VECT_TAB_FLASH */ /* Set the Vector Table base location at 0x08000000*/ NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x0); #endif
the NVIC_SetVectorTable function is:
void NVIC_SetVectorTable(u32 NVIC_VectTab, u32 Offset) { /* Check the parameters */ assert(IS_NVIC_VECTTAB(NVIC_VectTab)); assert(IS_NVIC_OFFSET(Offset)); SCB->ExceptionTableOffset = NVIC_VectTab | (Offset & (u32)0x1FFFFF80); }
so, compiling this code with keil it is a 4798 bytes long. But if i hide the function call and write all the code inside the function...
#else /* VECT_TAB_FLASH */ /* Set the Vector Table base location at 0x08000000 */ //NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x0); assert(IS_NVIC_VECTTAB(NVIC_VectTab_FLASH)); assert(IS_NVIC_OFFSET(0x0)); SCB->ExceptionTableOffset = NVIC_VectTab_FLASH | (0x0 & (u32)0x1FFFFF80); #endif
... the code is 3682 bytes long. I think that 1k for this function is so much. Can anyone explain what is happening? (forget about the assert function because i disabled #DEBUG)
thanks!
Here is the answer at the STM32 forum... this guy ibtissem give me the answer that i want to read. Something to find the way to understand what is happening. If anyone is trying keil, take my words "buy IAR". My previous experience with IAR was very good. I dont know how keil pays people to say "read the man...". I found this answer at the most questions here.
hello,
I try to reproduce same code sizes you have mentionned but without success, with all ADC examples in the FW library the difference between calling the function or replacing the call with the function code is about 4 bytes (3668->3664).
Normally you should not obtain such a big difference!
Could you please send me the entire the project or pricise with which example you work in our FW library. Don't forget to precise the settings @project options->C\C++ window.
Waiting for the additional info. Best regards, Ibtissem.
I dont know how keil pays people to say "read the man...". I found this answer at the most questions here.
Maybe you are a bit uninformed? Keil doesn't pay any people on this forum. This is not the official support help-desk for Keil products. Contact Keil support if you want official Keil support...
If I walk into a Mercedes shop and ask one of their customers why the engine is missfiring and I'm not happy with the answer - does that mean that the Mercedes support staff is crap?
Possible explanation.
If the library was built without the "One ELF Section per Function" selected, you could include all the functions in a source file even though you only used one of them.
Try rebuilding the library with that option selected.
Also, just in case, I would remove the debug library from the list of components that might be used.
Also, you want to compare the .map files to see where the extra code is coming from, not the .lst.