From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1437 invoked by alias); 16 Oct 2014 08:08:37 -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 1421 invoked by uid 89); 16 Oct 2014 08:08:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_00,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; Thu, 16 Oct 2014 08:08:35 +0000 Received: from [195.20.130.1] (port=25377 helo=[10.1.7.235]) by xm21.hostsila.net with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.82) (envelope-from ) id 1Xeg86-003LJA-90; Thu, 16 Oct 2014 11:09:50 +0300 Message-ID: <543F7CFC.5010104@unicore.co.ua> Date: Thu, 16 Oct 2014 08:08: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: Sergei Gavrikov CC: eCos Discussion References: <542D110B.9080002@unicore.co.ua> <542E8B41.8030905@dallaway.org.uk> <5436726C.8000703@unicore.co.ua> <543696C4.2040201@unicore.co.ua> <5437742F.7020908@unicore.co.ua> <54379E39.4070804@unicore.co.ua> <543E5F88.2050002@unicore.co.ua> In-Reply-To: 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] redboot on STM3240G-EVAL board X-SW-Source: 2014-10/txt/msg00023.txt.bz2 Thanks Sergei! I can confirm that loading and running .bin files works now )) For someone with the same problem here is a piece of information: 1. From objdump command below we see that .rom_vectors section address is 0x64008000 and .text section starts at 0x64008110. arm-none-eabi-objdump -h app.elf | grep LOAD -B1 0 .rom_vectors 00000008 64008000 64008000 00000098 2**0 CONTENTS, ALLOC, LOAD, READONLY, CODE 1 .ARM.extab 0000003c 64008008 64008008 000000a0 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 2 .ARM.exidx 000000c8 64008048 64008048 000000e0 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA 3 .text 0000595c 64008110 64008110 000001a8 2**3 CONTENTS, ALLOC, LOAD, READONLY, CODE 4 .rodata 00000204 6400da70 6400da70 00005b08 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA -- 6 .data 000002a8 6400dc80 6400dc80 00005d10 2**3 CONTENTS, ALLOC, LOAD, DATA 2. Check Entry point address with readelf command. In my case Entry point address: 0x64008111 arm-none-eabi-readelf -h app.elf ELF Header: Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 Class: ELF32 Data: 2's complement, little endian Version: 1 (current) OS/ABI: UNIX - System V ABI Version: 0 Type: EXEC (Executable file) Machine: ARM Version: 0x1 Entry point address: 0x64008111 Start of program headers: 52 (bytes into file) Start of section headers: 24700 (bytes into file) Flags: 0x5000002, has entry point, Version5 EABI Size of this header: 52 (bytes) Size of program headers: 32 (bytes) Number of program headers: 3 Size of section headers: 40 (bytes) Number of section headers: 12 Section header string table index: 11 3. Now load .bin RedBoot> load -m x -r -b 0x64008000 CRaw file loaded 0x64008000-0x6400df27, assumed entry at 0x64008000 xyzModem - CRC mode, 191(SOH)/0(STX)/0(CAN) packets, 5 retries RedBoot> 4. Now run binary with: RedBoot> go 0x64008111 Oleg > On Wed, 15 Oct 2014, Oleg Uzenkov wrote: > >>> For binaries you have to know the first LMA address (rom_vectors >>> address) to specify that address on a command line. >>> >>> For binary image >>> >>> load -m x -r -b >>> fis create -b >> Please, let me know what do you think of this: >> >> 1) I have built app.elf and app.bin for *RAM* startup >> (SECTION_rom_vectors: LMA == 0x64008000 ) (memory layout is >> mlt_cortexm_stm32x0g_eval_ram.ldi) >> >> 2) I can successfuly run app.elf under redboot (i.e. >load -m x; >go) >> >> 3) When I load app.bin like this: >>> load -m x -r -b 0x64008000 >>> go 0x64008000 >> or >>> go > RedBoot 'load' command does stat info about 'Entry point'. For example > on my ARM target > > RedBoot> load -m y > Entry point: 0x81008040, address range: 0x81008000-0x81013890 > xyzModem - CRC mode, 627(SOH)/0(STX)/0(CAN) packets, 2 retries > RedBoot> > > Load address 0x81008000 and entry point (LMA of .text) is 0x81008040. > > If I load a binary, I got something likes this > > RedBoot> load -m y -r -b 0x81008000 > CRaw file loaded 0x81008000-0x8101388f, assumed entry at 0x81008000 > xyzModem - CRC mode, 372(SOH)/0(STX)/0(CAN) packets, 3 retries > RedBoot> > > RedBoot has no clue where start from (it can guess only, 'assumed > entry') > > From your old message > > http://ecos.sourceware.org/ml/ecos-discuss/2014-10/msg00007.html > > I see that after loading PC register will be set to 0x64008110, so try > > RedBoot> go 0x64008110 > >> I get rubbish ($T080f:00800064;0d:e8cf1b64;) > Connect GDB to get it. > >> (i also tried to create fis and load and run image from fis, same >> result, i.e. >>> fis create -b 0x64008000 app; >fis load app; >go) >> any ideas where I am wrong? > See/try above. > >> Did anyone manage to execute .bin file from Redboot? > It should work. > > HTH > > Sergei > -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss