public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Jochen Strohbeck <jochen@strohbeck.net>
To: newlib@sourceware.org
Subject: Hard faults using sprintf() and float
Date: Fri, 24 Mar 2017 08:31:00 -0000	[thread overview]
Message-ID: <46f40c33-b4c9-5c80-3b68-dd5e23bab8c0@strohbeck.net> (raw)

Hello,
I'm using newlib 2.4.0 as provided by the ASF / Atmel Studio
Installation. I'm on a SAME70 and my app is heavily using float32 and
therefore I'm interested in using printf and co. in my FreeRTOS / lwip
environment. Now it seems to me that there is a problem in memory
allocation stuff but I can't get deeper. Looks like sprintf with "%.3e"
format string results in a hard fault which I tracked down to the newlib
library. Any idea what I can do ?
Regards

In Hard Fault Handler
SCB->HFSR = 0x40000000
Forced Hard Fault
SCB->CFSR = 0x00008200
Bus fault:
r0 = 0x36353931
r1 = 0x00000000
r2 = 0x00000004
r3 = 0x2040b970
r12 = 0xfadffbfe
lr = 0x004461ff
pc = 0x00447128 <-- !!
psr = 0x81010000

_Balloc():
 447118: 6cc3 ldr r3, [r0, #76] ; 0x4c
:
 447126: b180 cbz r0, 44714a <_Balloc+0x32>
 447128: 6802 ldr r2, [r0, #0] <-- !!
 44712a: f843 2024 str.w r2, [r3, r4, lsl #2]
:
 44715e: 6044 str r4, [r0, #4]
 447160: 6086 str r6, [r0, #8]
 447162: e7e4 b.n 44712e <_Balloc+0x16>

             reply	other threads:[~2017-03-24  8:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-24  8:31 Jochen Strohbeck [this message]
2017-03-24  9:38 ` Sebastian Huber
2017-03-24 11:46   ` Jochen Strohbeck
2017-03-24 13:41     ` Richard Earnshaw (lists)
2017-03-27  8:48       ` Jochen Strohbeck
2017-04-03 13:19         ` Jochen Strohbeck
2017-04-03 18:57           ` onkel.jack

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46f40c33-b4c9-5c80-3b68-dd5e23bab8c0@strohbeck.net \
    --to=jochen@strohbeck.net \
    --cc=newlib@sourceware.org \
    --cc=strohbeck@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).