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!
"This is not to put comments like 'read the manual'"
There is no point in posting stuff that just repeats what is already clearly stated in the manual, is there?
"it is for share experience, do you understand??"
Yes, I understand. Where a post indicates that the poster has made an effort, they will get good responses.
But where a post clearly indicates that the poster has made no effort at all, they will get "read the manual".
Such posts are just lazy - they don't need "shared experience"; they just need to do the basic groundwork! There is no point in just posting what is already written in the manual!
For example if a post just says, "How do I interface 'C' to assembler?" when there is a whole section in the manual clearly titled "Interfacing 'C' to Assmbler" does that post deserve anything other than a "Read The Manual" response?
However, if the post says, "I read about Interfacing 'C' to Assmebler, but don't understand XYZ..." then, again, they will get help.
In your case, you got the "shared experience" in pointing out the different types of listing files - you said yourself that this was, "very helpfull". You hadn't actually stated which toolset you are using, so I couldn't give you specific instructions on how to enable the Linker listing, could I? (there are 3 possible different ARM toolsets relevant to this forum).