This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ARM CM3 printf() problem


General advice regarding printf():

1. Make sure that your stack is double-word aligned - that is 8-bytes

2. Make sure you have A LOT of stack, printf can use up to 1kB of stack - really! If you don't plan to use floating point you can cut that down by using integer-only version iprintf().

Your problem is caused by wrong linking - notice that the problematic instruction is "blx <even-address>", so it tries to switch to ARM mode, which does not exist for Cortex-M3. First of all you need to use gcc (or g++) for linking, not ld directly - this way it's easier to deal with multilib. Second thing is that you need to have proper multilibs, compiled for cortex-m3 in thumb mode...

4\/3!!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]