Keil Logo

STM32 Cortex-M3

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Read-Only
Author
Jose Paulo Remor
Posted
2-Jul-2007 17:46 GMT
Toolset
ARM
New! STM32 Cortex-M3

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!

Read-Only
Author
Jose Paulo Remor
Posted
4-Jul-2007 12:00 GMT
Toolset
ARM
New! RE: STM32 Cortex-M3

Anyone understood my doubt?

after all, where all the people that normally say:
"go look at man..."

thanks...

Read-Only
Author
Christoph Franck
Posted
4-Jul-2007 12:58 GMT
Toolset
ARM
New! RE: STM32 Cortex-M3

You can check the linkers Listing files. They should contain fairly detailed information on memory usage and at least a hint about what those extra 1000 bytes are used for.

Read-Only
Author
Jose Paulo Remor
Posted
4-Jul-2007 13:20 GMT
Toolset
ARM
New! RE: STM32 Cortex-M3

Great idea, thanks...
but i dont found this information in .lst file. Neither changing/adding configuration. At least assembler listing box is marked up.
in lst file i have just informations like this:



ARM Macro Assembler    Page 1 Alphabetic symbol ordering
External symbols

__main 00000000

Symbol: __main
   Definitions
      At line 115 in file Startup\STM32F10x.s
   Uses
      At line 116 in file Startup\STM32F10x.s
Comment: __main used once
__use_two_region_memory 00000000

Symbol: __use_two_region_memory
   Definitions
      At line 273 in file Startup\STM32F10x.s
   Uses
      None
Comment: __use_two_region_memory unused
2 symbols
395 symbols in table
Read-Only
Author
Andy Neil
Posted
4-Jul-2007 13:30 GMT
Toolset
ARM
New! RE: STM32 Cortex-M3

That looks like an Assembler listing file; you need the Linker listing file - sometimes also known as a "Map" file.

You'll have to check the Manuals for how to enable the linker's listing file...

Read-Only
Author
Jose Paulo Remor
Posted
4-Jul-2007 14:28 GMT
Toolset
ARM
New! RE: STM32 Cortex-M3

Mr Andy,

as a keil client, consider my "look at man" a critic. I hope that you understood my position. If there is a "manual" for all doubts, we do not need a forum at least.
as a human that sometimes needs some help, a "look at..." is tipically a answer that not help. For example: If you know how to enable linker listing, you can write how to do it! If you dont know, please do not reply! But your first answer was very helpfull.

And finally, what is this thread about...
my linker is enable, for enable it you just go to the "option for target"/"Listing" then enable the linker checkbox. :)
the .map file:

    NVIC_SetVectorTable                      0x0800277f   Thumb Code    66  stm32f10x_nvic.o(.text)

It indicate Size = 66. You see that this function just have one line setting the SCB reg. Shall not occup 66 bytes, neither 1k.

thanks

Read-Only
Author
Jose Paulo Remor
Posted
5-Jul-2007 12:03 GMT
Toolset
ARM
New! RE: STM32 Cortex-M3

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.

Read-Only
Author
Per< Westermark
Posted
5-Jul-2007 15:01 GMT
Toolset
ARM
New! RE: STM32 Cortex-M3

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?

Read-Only
Author
Robert McNamara
Posted
5-Jul-2007 21:03 GMT
Toolset
ARM
New! RE: STM32 Cortex-M3

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.

Read-Only
Author
Robert McNamara
Posted
5-Jul-2007 21:11 GMT
Toolset
ARM
New! RE: STM32 Cortex-M3

Also, you want to compare the .map files to see where the extra code is coming from, not the .lst.

Read-Only
Author
Andy Neil
Posted
5-Jul-2007 23:44 GMT
Toolset
ARM
New! RE: STM32 Cortex-M3

"For example: If you know how to enable linker listing, you can write how to do it! If you dont know, please do not reply! But your first answer was very helpfull."

Exactly: I wopuld say that the first answer was the real help - I suggested that you need the Linker listing rather than the Assembler listing (and that it might also be called the "Map") file.

With that information, it should be easy for you to do your bit and look-up the detail of how to do it in the Manual - you got the first bit for free; is it too much to ask?

In fact, I don't know this detail off the top of my head.

Unfortunately, Keil still don't publish their ARM manuals online, so I couldn't give you a link...

Read-Only
Author
Jose Paulo Remor
Posted
6-Jul-2007 14:13 GMT
Toolset
ARM
New! RE: STM32 Cortex-M3

Andy and Per,

maybe you dont understand the main job of a forum. This is not to put comments like "read the manual", it is for share experience, do you understand?? Manuals do not share any experience with anyone. Sorry keil group, but at least a moderator from keil should ban you both in my opinion. All your poor answers is "read the man..." Its a little bit arrogant. And a manual link is the easiest thing to find when you want one. So, i dismiss your useless posts!! And this is the last time that i reply you.

McNamara,
i tried using optimization options like the "One ELF Section per Function". Thanks!!
Result:

1 Without this option:
  a ) With function call (debug off) = 9974
  b ) Just the command line (debig off) = 7706
2 With "One ELF..."
  a ) With function call (debug off) = 4332
  b ) Just the command line (debig off) = 4228

Now its ok!! 4 bytes to write a simple reg!!

Thanks a lot McNamara!!

Per and Andy watch and learn!!

Read-Only
Author
Andy Neil
Posted
6-Jul-2007 14:59 GMT
Toolset
ARM
New! You get out what you put in.

"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).

Read-Only
Author
Per< Westermark
Posted
6-Jul-2007 17:27 GMT
Toolset
ARM
New! RE: STM32 Cortex-M3

So, if you pick up 100 of my posts and look at them - exactly how many references to "read the manual" do you think you will find?

When the OP has a question where there is a possibility to "share experience", my posts contains very specific information about what to think about. No, I do absolutely refuse to read other peoples data sheets, but my answers very specifically mentions what to think about in generic terms.

The only post you have received from me in this thread is a note that this isn't the official support channel, and that the people here are not payed. That must really have hurt you, since you immediately suggests banning...

A quick check of the threads currently on the first page:
10160: I wrote how I usually use common global memory to share between different seldom used functions. I also makes a not about a new alias being used.
10151: I mentioned that people here are not payed.
10155: I wrote that the code was not complete, and not readable. I also mentioned a test to deduce if the problem was in read or write code.
10161: I mentioned that code size was not the size of object files.
10166: I asked a couple of questions about how Hebrew characters were used in the project.
10117: Huge amounts of "sharing experience" about use of ADC.

That completes the list of threads that I - to my knowledge - have posted in for the first page of threads. Not a reference to "read the manual". In 10117, I have one or two posts telling how problems are normally solved, but mentioning that the specificS of the individual chip requires the OP to read the data sheet for that chip. I think not being paid gives me the right to not post debugged turn-key source code.

Obviously a reason for banning, since I'm not helpfull...

Next Thread | Thread List | Previous Thread Start a Thread | Settings

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.