Hello,
I've built and installed the ps2 ee-sio per mrbrowns instructions. The tx works fine and I can see the messages pop thru securecrt and within my own code. The probelem I have is how to really test the rx side. I've looked through the other thread on the serial cable and are pretty sure I'm on the right via (directly below the tx).
Can someone provide a small code snippet on how to test? I've used sio_getc() and seems to return just the same funky "y" character all the time. I'm sure I'm just stupid. Right now I'm typing into the terminal app and trying to echo the input thru serial via printf to inlink.
Thanks in advance :)
EE-SIO rx
Re: EE-SIO rx
I don't claim to be an expert, but I've had a lot of experience with the SIO board over the last several days.
The makefile needs makefiles from PS2LIB (and hence the PS2LIB environment string needs to be defined)--I'm assuming you have PS2DEV setup on your system, right?
Haven't tried "ps2siotest.elf" with InLink, only with ps2client, but I suspect that it will work.
(in case you're wondering this means you ain't stupid! ;) )
File: main.c
File: Makefile
Sure, see the code and makefile below. My thanks to "tyranid" for sending the original code to me ;)apache37 wrote:Can someone provide a small code snippet on how to test?
The makefile needs makefiles from PS2LIB (and hence the PS2LIB environment string needs to be defined)--I'm assuming you have PS2DEV setup on your system, right?
Haven't tried "ps2siotest.elf" with InLink, only with ps2client, but I suspect that it will work.
A consistent "y" character sounds bad, but at least it is consistently bad. :-{apache37 wrote:I've used sio_getc() and seems to return just the same funky "y" character all the time.
Quote: Ignorance is curable, stupidity that's for life -- author unknownapache37 wrote:I'm sure I'm just stupid.
(in case you're wondering this means you ain't stupid! ;) )
File: main.c
Code: Select all
#include <tamtypes.h>
#include <kernel.h>
#include <sifrpc.h>
#include <iopheap.h>
#include <loadfile.h>
#include <iopcontrol.h>
#include <fileio.h>
#include <compat.h>
#include <sio.h>
// Macros
#define DEBUG
#ifdef DEBUG
#define dbgprintf(args...) printf(args)
#define dbgscr_printf(args...) scr_printf(args)
#else
#define dbgprintf(args...) do { } while(0)
#define dbgscr_printf(args...) do { } while(0)
#endif
int main(int argc, char *argv[])
{
int ch;
// Not sure if this is still necessary, but doesn't appear to be done by ps2lib's "crt0"
sif_rpc_init(0);
// Initialize screen display
init_scr();
scr_printf("SIO Communications Tester v1.0 [2004-09-20] by tyranid, modified by redcoat\n\n");
for(;;) {
ch = sio_getc();
if(ch != -1) {
sio_putc(ch);
scr_printf("%c", (unsigned char)ch);
dbgprintf("%c", (unsigned char)ch);
}
}
return 0;
}
Code: Select all
######################################################################
# ps2siotest - Now uses the standard macros names from
# Makefile.pref & Makefile.eeglobal (see dir. $PS2LIB)
# Customize the standard macro names used
EE_BIN = ps2siotest.elf
EE_OBJS = main.o
######################################################################
# Paths and flags
#
EE_ASFLAGS = -march=r5900 -EL
EE_CFLAGS = -march=r5900 -ffreestanding -fno-builtin -fshort-double -mno-memcpy \
-nostartfiles -nodefaultlibs -mlong64 -mhard-float -mno-abicalls -EL
# Strip debug info., but leave some symbols
EE_LDFLAGS += $(LDPARAMS) -s
EE_LIBS = -lc -lgcc
######################################################################
#
all: $(EE_BIN)
clean:
rm -f $(EE_OBJS) $(EE_BIN)
include $(PS2LIB)/Makefile.pref
include $(PS2LIB)/Makefile.eeglobal