public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Michael Jones <mjones@linear.com>
To: Ilija Kocho <ilijak@siva.com.mk>
Cc: eCos Discussion <ecos-discuss@ecos.sourceware.org>
Subject: Re: [ECOS] Eclipse / CDT without Makefile Project
Date: Sun, 23 Dec 2012 00:19:00 -0000	[thread overview]
Message-ID: <88C69C62-38CD-4FDA-AED1-0126A8BEB66B@linear.com> (raw)
In-Reply-To: <50D64BA3.5030302@siva.com.mk>

Ilija,

What I am doing with MQX is debugging from Flash. If I use a PEMicro JTAG debugger, it is pretty fast to load 128K. My app does not use a lot of memory, so I have not run out of RAM.

If I finally get a JTAG debugger, can I do the same with eCos? That is, debug from Flash?

Mike

On Dec 22, 2012, at 5:09 PM, Ilija Kocho <ilijak@siva.com.mk> wrote:

> Hi Mike
> 
> My insight in Eclipse is limited so I hope somebody else will hint us
> how to get the console I/O.
> 
> Regarding the target issues, see my comment below. Here I will only say
> that for with respect to Redboot this is a small memory system and the
> application size is limited. That is the reason why I didn't provide RAM
> startup for systems without external memory.
> 
> Ilija
> 
> On 23.12.2012 00:08, Michael Jones wrote:
>> I noticed a few things, and did not copy the list because it might be Kinetis specific. See compilation problems towards the end.
>> 
>> I setup a program like this:
>> 
>>    int integer1, integer2, sum;
>> 
>>    printf("Hello Mike.\n");
>> 
>>    printf("Enter first integer:\n");
>>    scanf("%d", &integer1);
>>    return 0;
>> 
>> And when run, in the Eclipse gdb console (I finally realized there is more than one console):
>> 
>> 947,145 (gdb) 
>> 947,415 *running,thread-id="all"
>> 947,457 @"Hello Mike.\n"
>> 947,460 @"Enter first integer:\n"
>> 
>> Suggests it got some printf data, but it did not appear on the app console.
>> 
>> Then on the app console, I type 45 and on the gdb console get:
>> 
>> 192,289 27-interpreter-exec console 45
>> 
>> I don't know if this means gdb sent 45 to RedBoot or not. I assume so. But the application did not respond. So tty problems are in both directions. I can't tell what is gdb and what is RedBoot.
>> 
>> I extend the program like this:
>> 
>>    int integer1, integer2, sum;
>> 
>>    printf("Hello Mike.\n");
>> 
>>    printf("Enter first integer:\n");
>>    scanf("%d", &integer1);
>>    printf("Enter second integer:\n");
>>    scanf("%d", &integer2);
>>    sum = integer1 + integer2;
>> 
>> And I run from command line gdb (not Eclipse) which does print the one line Hello Mike app. I get:
>> 
>> (gdb) cont
>> Continuing.
>> FLASH configuration checksum error or invalid key
>> ASSERT FAIL: <2>stream.cxx[603]virtual Cyg_ErrNo Cyg_StdioStream::write() Stream object is not a valid stream!
>> ASSERT FAIL: <2>stream.cxx          [ 603] virtual Cyg_ErrNo Cyg_StdioStream::write()                                                           Stream object is not a valid stream!
>> 
>> So things are not so well with the command line gdb either.
>> 
>> I then tried another experiment with a program like this:
>> 
>>    int integer1, integer2, sum;
>> 
>>    printf("Hello Mike.\n");
>> 
>>    printf("Enter first integer:\n");
>>    scanf("%d", &integer1);
>>    printf("Enter second integer:\n");
>>    scanf("%d", &integer2);
>>    sum = integer1 + integer2;
>>    printf("Sum is %d\n", sum);
>>    return 0;
>> 
>> And I get a compile error:
>> 
>> Description	Resource	Path	Location	Type
>> address 0x200106fc of hello_world section `.bss' is not within region `ram'	hello_world		 	C/C++ Problem
>> address 0x20010704 of hello_world section `.bss' is not within region `ram'	hello_world		 	C/C++ Problem
>> 
>> So something is also not right with the compilation either.
> 
> Compilation is probably OK, but linker complains because there is not
> enough memory.
> This makes me to suspect that previous errors are due to low memory,
> probably some stack overflow.
> 
> The linker will include only used functions so if you scanf() it will
> add couple of tens KB to the image. You can save some memory if you
> configure printf()/scanf() without floating point support
> 
>> 
>> Now, I backed off to just printf programs with multiple lines to see what can be done.
>> 
>> A 10 line printf compiles and runs.
>> A 10 count for loop with printf works.
>> 
>> So it does not appear that the number of lines in the program matters.
>> 
>> I change the sum program to only printf and it can add numbers and print (gdb command line, not Eclipse)
>> 
>> With some playing around, the scanf seems to cause the compiler error about regions.
>> 
>> So I think try:
>> 
>>   c = getchar();
>> 
>> And with the command line gdb it prints, then hangs, and typing a character does not let the program proceed. So this seems like even with the command line arm-eabi-gdb, console input may not be routed back through RedBoot to the application.
>> 
>> With the example redboot and application projects you sent, are you able to read from stdin?
>> 
>> Do you know how to get Eclipse to handle IO for gdb?
> 
> I have the same problem with Eclipse.
> But I usually activate the (real) serial device driver and I get I/O on
> serial port.
> 
> 
> -- 
> Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
> and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
> 


--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

  reply	other threads:[~2012-12-23  0:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-20  7:44 Michael Jones
2012-12-20  8:32 ` [ECOS] " John Dallaway
2012-12-20 15:15   ` [ECOS] " Michael Jones
2012-12-20 15:34     ` [ECOS] " John Dallaway
2012-12-21  7:03       ` [ECOS] " Michael Jones
2012-12-22 11:00         ` Ilija Kocho
     [not found]           ` <02A08039-66E9-4427-9E68-7C66E5C4200D@linear.com>
     [not found]             ` <50D5E4B9.5010300@siva.com.mk>
2012-12-22 20:42               ` Michael Jones
     [not found]                 ` <48C70F8E-290F-4E62-98FC-E5CEA9906AAE@linear.com>
2012-12-23  0:09                   ` Ilija Kocho
2012-12-23  0:19                     ` Michael Jones [this message]
2012-12-23 17:58                       ` Ilija Kocho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=88C69C62-38CD-4FDA-AED1-0126A8BEB66B@linear.com \
    --to=mjones@linear.com \
    --cc=ecos-discuss@ecos.sourceware.org \
    --cc=ilijak@siva.com.mk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).