Welcome, Guest

Author Topic: localhost:3333: A connection attempt failed  (Read 10989 times)

YanAyon

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
localhost:3333: A connection attempt failed
« on: July 11, 2015, 01:42:58 PM »
Hi,

I wanna blink a led on port PA0 using the Olimex sam7-ex256 and the arm-usb-tiny-h. after building the project it seems all is going well but by debugging I get this:

source .gdbinit
target remote localhost:3333
localhost:3333: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
monitor reset init
"monitor" command not supported by this target.
monitor arm7_9 force_hw_breakpoints enable
"monitor" command not supported by this target.
monitor arm7_9 fast_memory_access disable
"monitor" command not supported by this target.
symbol-file main.out
monitor flash write_image erase unlock main.bin 0x00100000
"monitor" command not supported by this target.
monitor sleep 100
"monitor" command not supported by this target.
monitor arm7_9 fast_memory_access enable
"monitor" command not supported by this target.
monitor reset halt
"monitor" command not supported by this target.
thbreak main
No hardware breakpoint support in the target.
continue
The program is not being run.
kill
The program is not being run.


Can someone tell me what's wrong or what I must do?

here is my main.c:

Yan
Code: [Select]
/* AT91SAM7S256 registers used */
#define PIO_PER         (*((volatile unsigned int *) 0xFFFFF400))
#define PIO_OER         (*((volatile unsigned int *) 0xFFFFF410))
#define PIO_SODR        (*((volatile unsigned int *) 0xFFFFF430))
#define PIO_CODR        (*((volatile unsigned int *) 0xFFFFF434))

void Delay(void)
{
    int count = 1000000;

    /* waste time */
    while (count) {
        count = count - 1;
    }
}

int main(void)
{
    /* configure PIO line for LED */
    PIO_PER = 0x00000001;       /* enable uC pin as PIO */
    PIO_OER = 0x00000001;       /* enable uC pin as output */

    while (1) {
    PIO_CODR = 0x00000001;
Delay();
PIO_SODR = 0x00000001;
Delay();
}
}

- here is my makefile:
Code: [Select]
#----------------------------------------------------------------------------------
#   FILENAME:       Makefile
#
#   DESCRIPTION:    Makefile for compiling and linking a program to run in Flash
#                   memory
#----------------------------------------------------------------------------------

OUTFILE_FLASH=led_on_off

TARGET=AT91SAM7S256

# Paths to standard and maths library files - assumes default YAGARTO installation
LIBGCC=C:\ARM\yagarto\lib\gcc\arm-none-eabi\4.5.1\libgcc.a
LIBC=C:\ARM\yagarto\arm-none-eabi\lib\libc.a
LIBM=C:\ARM\yagarto\arm-none-eabi\lib\libm.a

# Optimisation settings
# optimisation for size
#OPTIM=-Os
# no optimisation - for debug mode
OPTIM=-O0

AS=arm-none-eabi-gcc
CC=arm-none-eabi-gcc
LD=arm-none-eabi-gcc
OBJCOPY=arm-none-eabi-objcopy
CCFLAGS=-g -mcpu=arm7tdmi $(OPTIM) -Wall -D$(TARGET)
ASFLAGS=-D__ASSEMBLY__ -D$(TARGET) -g -mcpu=arm7tdmi -c $(OPTIM) -Wall

# Linker flags.
#  -Wl,... :    tell GCC to pass this to linker.
#  -Map    :    create map file
#  --cref  :    add cross reference to map file
LDFLAGS_F+=-nostartfiles -Wl,-Map,out.map,--cref
LDFLAGS_F+=-T Flash.ld


#----------------------------------------------------------------------------------
# TODO: Add all the object files generated for you project to the framework
# objects listed below
#----------------------------------------------------------------------------------
OBJS=startup.o \
     main.o \
   

rebuild: clean all

all: flash

flash: $(OBJS)
$(LD) $(LDFLAGS_F)  -n -o $(OUTFILE_FLASH).elf $(OBJS) $(LIBGCC) $(LIBC) $(LIBM)
$(OBJCOPY) --strip-debug --strip-unneeded $(OUTFILE_FLASH).elf -O binary $(OUTFILE_FLASH).bin

#----------------------------------------------------------------------------------
# TODO: Add your object file compilation instructions
#----------------------------------------------------------------------------------

main.o: main.c
$(CC) -c $(CCFLAGS) main.c -o main.o

startup.o:  startup.S
$(AS) $(ASFLAGS) startup.S -o startup.o


clean:
rm -f *.o *.bin *.elf *.map

JohnS

  • Hero Member
  • *****
  • Posts: 1709
  • Karma: +33/-45
Re: localhost:3333: A connection attempt failed
« Reply #1 on: July 11, 2015, 07:48:17 PM »
What have you got on port 3333?

Did you mean to use OpenOCD?  You need to config & run it if so.

John

YanAyon

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: localhost:3333: A connection attempt failed
« Reply #2 on: July 12, 2015, 04:55:19 PM »
Hi John,

and thank you for your reply. I really don't understand your question about what I have got on port 3333. But my debug configurations in option "Commands" seem like this:
 'Initialize' commands
target remote localhost:3333
monitor reset init
monitor arm7_9 force_hw_breakpoints enable
monitor arm7_9 fast_memory_access disable
symbol-file main.out
monitor flash write_image erase unlock main.bin 0x00100000
monitor sleep 100
monitor arm7_9 fast_memory_access enable


'Run' commands
monitor reset halt
thbreak main
continue


Did you mean to use OpenOCD?

Yes I'm using OpenOCD and when I run my external tool( ARM-USB-TINY-H) it works problem-free. OpenOCD is already configured and here is my project.cfg:
Code: [Select]
#
# Flash AT91SAM7S memory using openocd
# and a FTDI FT2232-based JTAG-interface
#
# created by Martin Thomas
# based on information from Dominic Rath
#

#daemon configuration
telnet_port 4444
gdb_port 3333

gdb_memory_map disable
gdb_flash_program enable

#ARM-USB-TINY doesn't support adaptive clocking
adapter_khz 1000

source [find scripts/board/olimex_sam7_ex256.cfg]

When it is running I get this:
interface uses the same layout as configs that were verified. Please report your
experience with this file to openocd-devel mailing list, so it could be marked
as working or fixed.
Info : only one transport option; autoselect 'jtag'
adapter speed: 1000 kHz
srst_only srst_pulls_trst srst_gates_jtag srst_open_drain
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
Info : clock speed 1000 kHz
Info : JTAG tap: sam7x256.cpu tap/device found: 0x3f0f0f0f (mfg: 0x787, part: 0xf0f0, ver: 0x3)
Info : Embedded ICE version 1
Info : sam7x256.cpu: hardware has 2 breakpoint/watchpoint units


Do you think perhaps that some programm is using the port 3333? How can I check this port?

I look forward to your support.

Yan

 
« Last Edit: July 12, 2015, 04:57:55 PM by YanAyon »

YanAyon

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: localhost:3333: A connection attempt failed
« Reply #3 on: July 13, 2015, 09:11:43 PM »
Any Ideas????????????????????

JohnS

  • Hero Member
  • *****
  • Posts: 1709
  • Karma: +33/-45
Re: localhost:3333: A connection attempt failed
« Reply #4 on: July 13, 2015, 11:40:54 PM »
You can check with your OS what is using which ports.

John

YanAyon

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: localhost:3333: A connection attempt failed
« Reply #5 on: July 14, 2015, 11:44:01 AM »
Hi John,

and thank for your reply. I have used portchecker from this website: http://portchecker.co/check to check the port 3333. It told me that the port is closed. So, what can I do?

Yan

JohnS

  • Hero Member
  • *****
  • Posts: 1709
  • Karma: +33/-45
Re: localhost:3333: A connection attempt failed
« Reply #6 on: July 14, 2015, 12:10:11 PM »
For what you look to want you need both gdb & oocd running.  Your info above suggests you want gdb on 3333 so find why it isn't.

John

YanAyon

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Re: localhost:3333: A connection attempt failed
« Reply #7 on: July 14, 2015, 09:49:53 PM »
Hi John,

I uninstalled and reinstalled OlimexODS. After I changed the location of openocd to bin-x64 because I'm using a 64-bit win7 and the arguments, I created a new empty project and imported the files from the existing example project SAM7-EX256-cdc_FLASH. After that, I duplicated the debug configurations of the SAM7-EX256-cdc_FLASH and renamed it. After done that, I built my project, ran ARM-USB-TINY-H and by debugging I got this:

source .gdbinit
target remote localhost:3333
0x00000000 in ?? ()
monitor reset init
JTAG tap: sam7x256.cpu tap/device found: 0x3f0f0f0f (mfg: 0x787, part: 0xf0f0, ver: 0x3)
srst pulls trst - can not reset into halted mode. Issuing halt after reset.
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x60000013 pc: 0x0010063c
NOTE! DCC downloads have not been enabled, defaulting to slow memory writes. Type 'help dcc'.
NOTE! Severe performance degradation without fast memory access enabled. Type 'help fast'.
monitor arm7_9 force_hw_breakpoints enable
arm7_9 force_hw_breakpoints enable: command requires more arguments
in procedure 'arm7_9'
monitor arm7_9 fast_memory_access disable
fast memory access is disabled
symbol-file main.out
monitor flash write_image erase unlock main.bin 0x00100000
auto erase enabled
auto unlock enabled
wrote 16384 bytes from file main.bin in 2.860164s (5.594 KiB/s)
monitor sleep 100
monitor arm7_9 fast_memory_access enable
fast memory access is enabled
monitor reset halt
JTAG tap: sam7x256.cpu tap/device found: 0x3f0f0f0f (mfg: 0x787, part: 0xf0f0, ver: 0x3)
srst pulls trst - can not reset into halted mode. Issuing halt after reset.
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x60000013 pc: 0x001004a8
NOTE! DCC downloads have not been enabled, defaulting to slow memory writes. Type 'help dcc'.
thbreak main
Hardware assisted breakpoint 1 at 0x100434: file main.c, line 62.
continue

Program received signal SIGINT, Interrupt.
kill

The microcontroller was flashed but I couldn't run the programm step by step in Disassembly because it was empty. Do you have any ideas about?

JohnS

  • Hero Member
  • *****
  • Posts: 1709
  • Karma: +33/-45
Re: localhost:3333: A connection attempt failed
« Reply #8 on: July 15, 2015, 02:09:54 AM »
Using a recent (& 64-bit) OS but ancient other tools looks unwise.

(Using Windows at all is unwise but that's another issue.)

Even the old tool is telling you to do something else.

John