From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 56657 invoked by alias); 27 Mar 2017 08:48:19 -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 56341 invoked by uid 89); 27 Mar 2017 08:48:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.4 required=5.0 tests=BAYES_20,FREEMAIL_FORGED_REPLYTO,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=faults, Hx-languages-length:991, cores, H*r:4.86_2 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; Mon, 27 Mar 2017 08:48:01 +0000 Received: from p54803f94.dip0.t-ipconnect.de ([84.128.63.148] helo=[127.0.0.1]) by ms-10.1blu.de with esmtpa (Exim 4.86_2) (envelope-from ) id 1csQJk-0005TH-Ji for newlib@sourceware.org; Mon, 27 Mar 2017 10:48:00 +0200 Reply-To: strohbeck@gmx.net Subject: Re: Hard faults using sprintf() and float References: <46f40c33-b4c9-5c80-3b68-dd5e23bab8c0@strohbeck.net> <58D4E921.80504@embedded-brains.de> To: newlib@sourceware.org From: Jochen Strohbeck Message-ID: <7e3fac0d-d907-4c07-37cb-6ece658360e2@strohbeck.net> Date: Mon, 27 Mar 2017 08:48:00 -0000 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Con-Id: 127816 X-Con-U: 0-jochen X-SW-Source: 2017/txt/msg00227.txt.bz2 >>> Looks like you have a problem with misaligned loads. Check your MPU >>> configuration. MPU is disabled in my application but this is also the case in FreeRTOS demo code provided for SAME70. Must MPU be configured/enabled to avoid the hard fault ? > Your stack needs to be 8-byte aligned at all function boundaries. The > compiler will maintain this invariant if start-up and interrupt code > handle the startup and interrupt entry code (most m-class cores will do > the latter automatically). I'm afraid that I don't quite understand you. I am using the linker script from the FreeRTOS demo. Nevertheless I changed all ALIGN(4) to (8) but the hard fault still occurs. According to the map file I seems that the function boundaries in the newlib code are not 8 byte aligned. Do I have to recompile the newlib stuff to achieve 8 byte alignment for functions ? Can I check if the provided newlib library is ready for (Free)RTOS applications ?