From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 108777 invoked by alias); 24 Mar 2017 08:31:29 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 108759 invoked by uid 89); 24 Mar 2017 08:31:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.9 required=5.0 tests=BAYES_05,FREEMAIL_FORGED_REPLYTO,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=atmel, Atmel, bn, faults X-HELO: ms-10.1blu.de Received: from ms-10.1blu.de (HELO ms-10.1blu.de) (178.254.4.101) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 24 Mar 2017 08:31:28 +0000 Received: from p54803099.dip0.t-ipconnect.de ([84.128.48.153] helo=[127.0.0.1]) by ms-10.1blu.de with esmtpa (Exim 4.86_2) (envelope-from ) id 1crKd5-0007nQ-BU for newlib@sourceware.org; Fri, 24 Mar 2017 09:31:27 +0100 From: Jochen Strohbeck Subject: Hard faults using sprintf() and float Reply-To: strohbeck@gmx.net To: newlib@sourceware.org Message-ID: <46f40c33-b4c9-5c80-3b68-dd5e23bab8c0@strohbeck.net> Date: Fri, 24 Mar 2017 08:31:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Con-Id: 127816 X-Con-U: 0-jochen X-SW-Source: 2017/txt/msg00220.txt.bz2 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>