From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12715 invoked by alias); 3 Apr 2017 18:57:30 -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 12691 invoked by uid 89); 3 Apr 2017 18:57:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: =?ISO-8859-1?Q?No, score=-1.1 required=5.0 tests=AWL,BAYES_50,GIT_PATCH_2,KAM_LAZY_DOMAIN_SECURITY,MISSING_MIMEOLE,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy==ef=bb=bf, Hard, hungry, H*R:D*t-online.de?= X-HELO: mailout10.t-online.de Received: from mailout10.t-online.de (HELO mailout10.t-online.de) (194.25.134.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 03 Apr 2017 18:57:27 +0000 Received: from fwd31.aul.t-online.de (fwd31.aul.t-online.de [172.20.26.136]) by mailout10.t-online.de (Postfix) with SMTP id 81B3E41F6086; Mon, 3 Apr 2017 20:57:26 +0200 (CEST) Received: from spica13.aul.t-online.de (SUGjy+ZDrheZMv637BFFVM65dVuKoHygDGevNgfvGF8JHqD4s6+tfNzypsQe0rmQHu@[172.20.102.124]) by fwd31.aul.t-online.de with esmtp id 1cv7AL-1qzT1M0; Mon, 3 Apr 2017 20:57:25 +0200 Received: from 195.212.29.186:32719 by cmpweb31.aul.t-online.de with HTTP/1.1 (Lisa V4-8-3-0.13952 on API V5-6-0-0) Received: from 172.20.102.130:16559 by spica13.aul.t-online.de:8080; Mon, 3 Apr 2017 20:57:25 +0200 (MEST) Date: Mon, 03 Apr 2017 18:57:00 -0000 From: "onkel.jack@t-online.de" Reply-To: "onkel.jack@t-online.de" To: "strohbeck@gmx.net" Cc: newlib mailing list Message-ID: <1491245845208.623385.991cf283b8dee5c28cb9611c604799844fc216c4@spica.telekom.de> In-Reply-To: <63c8d131-9ce8-ffbd-28e7-67d122a61b78@strohbeck.net> References: <46f40c33-b4c9-5c80-3b68-dd5e23bab8c0@strohbeck.net> <58D4E921.80504@embedded-brains.de> <7e3fac0d-d907-4c07-37cb-6ece658360e2@strohbeck.net> <63c8d131-9ce8-ffbd-28e7-67d122a61b78@strohbeck.net> Subject: RE: Hard faults using sprintf() and float MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2017/txt/msg00246.txt.bz2 Just a hint: I run into same problem for 2 reasons, but for a different operating system: 1. the malloc locks (using newlib malloc) did not work while I used multipl= e threads. this messed up the malloc chain. 2. I figured out, printf is quite hungry in respect of using stack. Dependi= ng on newlib config and version the stack usage of printf family counts up = to around 1,5 Kb. So I would suggest as first check the size of your stack = to have enough space to bear the need of printf. Especially in your case wh= ile printing float, this sounds shomehow familiar to me. Good luck. OJ -----Original-Nachricht----- Betreff: Re: Hard faults using sprintf() and float Datum: 2017-04-03T15:20:14+0200 Von: "Jochen Strohbeck" An: "newlib@sourceware.org" The hard fault and strange formatted output does not happen if a semaphore is used to protect sprintf(). Again, this problem seems only to happen if floats are printed and this behaviour has been observed and reported by other users in the past and I wonder what happens here. I have implemented malloc_r() which is using FreeRTOS own heap4 pvPortMalloc() and is called by newlib's sprintf(), printf(), puts() etc. So memory allocation seems not to be the real problem here. Are there other functions to be implemented which are called by sprintf() in order to protect it ? In this article www.billgatliff.com/newlib.html the compile switch REENTRANT_SYSCALLS_PROVIDED is mentioned. I defined configUSE_NEWLIB_REENTRANT but get an ASSERT() due to a corrupted task descriptor in FreeRTOS if sprintf() is not guarded by my semaphore. I downloaded and compiled newlib on Windows but it seems that the lib is built for Intel not ARM (makefile refers to gcc not arm-none-eabi-gcc). Any switch that must be passed to configure ? > Can I check if the provided newlib library is ready for (Free)RTOS > applications ? =EF=BB=BF