From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10466 invoked by alias); 17 Oct 2014 12:02:36 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 10450 invoked by uid 89); 17 Oct 2014 12:02:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.5 required=5.0 tests=AWL,BAYES_20,RCVD_IN_SORBS_WEB autolearn=no version=3.3.2 X-HELO: xm21.hostsila.net Received: from xm21.hostsila.net (HELO xm21.hostsila.net) (80.91.189.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 17 Oct 2014 12:02:34 +0000 Received: from [195.20.130.1] (port=17255 helo=[10.1.7.235]) by xm21.hostsila.net with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.82) (envelope-from ) id 1Xf6G9-0027b4-Hy for ecos-discuss@sourceware.org; Fri, 17 Oct 2014 15:03:53 +0300 Message-ID: <54410554.5040001@unicore.co.ua> Date: Fri, 17 Oct 2014 12:02:00 -0000 From: Oleg Uzenkov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: eCos Discussion References: <543FCF93.4090209@unicore.co.ua> In-Reply-To: <543FCF93.4090209@unicore.co.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Get-Message-Sender-Via: xm21.hostsila.net: authenticated_id: o.uzenkov@unicore.co.ua X-IsSubscribed: yes Subject: Re: [ECOS] place thread stack into CCM memory on STM32 X-SW-Source: 2014-10/txt/msg00027.txt.bz2 > > Hi Everyone, > > STM32 controllers have CCM (Closely Coupled Memory) memory which acts > as RAM. > > At present I do not use it. But I would like to. > > I am developing eCos application in C++. I have something like this in > the header file: > > class A : > { > public: > A (); > virtual ~A (); > .. > protected: > > cyg_thread _thread; > char _thread_stack [CYGNUM_HAL_STACK_SIZE_TYPICAL] > __attribute__((section(".ccm"))); > ... > > As you can see, I want to place thread stack into CCM section (using > __attribute__((section(""))). > > But I do not know how to do it in a correct way. Please help! :-) > > The Memory layout file I use has got: > > .. > SECTIONS > { > SECTIONS_BEGIN > USER_SECTION (ccm, ccm, 0x10000000, LMA_EQ_VMA) > .. > > And cortexm.ld file has got a macro for USER_SECTION: > > #define USER_SECTION(_name_, _region_, _vma_, _lma_) \ > ._name_ _vma_ : _lma_ \ > { __ ## _name_ ## _start = ABSOLUTE (.); \ > *(._name_*) \ > __ ## _name_ ## _end = ABSOLUTE (.); } \ > > _region_ > > > When I compile the project I get an error: > error: section attribute not allowed for '_thread_stack' > > Do I specify attribute in the correct place? > Ok, it appears that it is possible to specify __attribute__((section(""))) for class's member methods. It can also be specified for file level or global level variables and functions. But unfortunately there is no directive to place the whole class into a specific memory region. As to working with STM32 I managed to place thread stacks into CCM section (why waist it!) by declaring stack as a file level variable: static char _thread_stack [CYGNUM_HAL_STACK_SIZE_TYPICAL] CYGBLD_ATTRIB_SECTION(".ccm"); Make sure to specify (NOLOAD) for .ccm section in mlt_ file: USER_SECTION (ccm, ccm, 0x10000000 (NOLOAD), LMA_EQ_VMA) Otherwise the binary will be enormous. Oleg > My be I cannot do it for class members but only for global variables? > > I would appreciate any help on this. > > Oleg > > > > > > > > ... > > > > -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss