This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Newlib : stdio : fprintf and sprintf - not faulty - buffer-based pipes needed.


My apologies,
I have no idea at the moment why fprintf was not outputting, in the Parallella e-run simulator, for Parallella-Linux generated code for the Epiphany.

However sprint in the code, run actually on the Epiphany cores, does output fine, correctly outputting to the communication buffer. i.e. :
  0: Message from eCore 0x8ca ( 3, 2): "some text
Qsome text 1 2 3 4 5 6 7 8 9
 45
"
  1: Message from eCore 0x84b ( 1, 3): "some text
Qsome text 1 2 3 4 5 6 7 8 9
 45
"
Etc.
The problem was a too-short delay before the Linux host read the buffer. It is a very crude temporary interface.

Thus this aplc APL to C code translator is at least partially ported to the Parallella and Epiphany cores.
  
If anyone knows how to create Std-in Std-out (and generic pipes) based on buffers on the Epiphany chip, with proper synchronisation, I would much appreciate receiving comments, examples or working code. This exceeds my remaining knowledge of c (~1980 - ~1990) or my understanding of newlib.
Cheers,
	Dr. Beau Webber  

-----Original Message-----
From: newlib-owner@sourceware.org [mailto:newlib-owner@sourceware.org] On Behalf Of J.B.W.Webber
Sent: 08 June 2013 18:09
To: newlib@sourceware.org
Subject: RE: Newlib : stdio : fprintf and sprintf

Re-sending - replacing removed line breaks in the table - sorry, Beau

-----Original Message-----
From: J.B.W.Webber 
Sent: 08 June 2013 17:41
To: 'newlib@sourceware.org'
Subject: Newlib : stdio : fprintf and sprintf

Hi,
I am trying to compile an APL compiler aplc for a range of new machines.
On the Adapteva Parallella with Epiphany multi-core chip, which uses Newlib, I am having problems.

The Apl to C translation is going fine, but there are problems in the .c to .elf or .out translation.
Specifically the following two compiling on the Parallella Armv7, generating code for the Epiphany, appear to act as no-ops :
                fprintf(aplcout,"%c",trs1.value.cp[i3]);
                sprintf(pointer,"%c",trs1.value.cp[i3]);
I am not sure what version this sdk is; the esdk on the Parallella is esdk.4.13.03.30.

I have also downloaded and compiled the latest sdk from GitHub for my laptop; When this is generating code under Cygwin, for the Epiphany,
                fprintf(aplcout,"%c",trs1.value.cp[i3]); works
                sprintf(pointer,"%c",trs1.value.cp[i3]); does nothing

The full table :
Build on PC under Cygwin for Cygwin : Works.

Build on PC under Cygwin for Cygwin : run using e-run : Works. 

Build on Arm under Linux for Armv7-Linux : Works. 

Build on Arm under Linux for Linux : run using e-run : No output : fprintf(aplcout,"%c",trs1.value.cp[i3]); failing.

Build on Arm under Linux for Epiphany cores : No output :   sprintf(pointer,"%c",trs1.value.cp[i3]); failing. 

Build on PC under Cygwin for Armv7-Linux : run using e-run : Works : fprintf(aplcout,"%c",trs1.value.cp[i3]);  works.

Build on PC under Cygwin for Epiphany cores : No output : sprintf(pointer,"%c",trs1.value.cp[i3]); failing.


Simpler statements like printf(...) and sprintf(pointer,"Text") do work.

Is it possible for someone to have a look at these functions and
a) Determine if my suppositions are correct.
b) If so, create fixed versions ?
Cheers,
                Dr. Beau Webber


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]