Project

General

Profile

Revision 163

tried to update test Makefile to move code to start at 1024
also added some printouts to netprog

View differences:

trunk/programmer/test/Makefile
182 182
#  -Wl,...:     tell GCC to pass this to linker.
183 183
#    -Map:      create map file
184 184
#    --cref:    add cross reference to  map file
185
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
185
LDFLAGS = -Wl,--section-start=.text=0x400,-Map=$(TARGET).map,--cref
186 186
LDFLAGS += $(EXTMEMOPTS)
187 187
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
188 188

  
......
378 378
	@echo load  >> $(GDBINIT_FILE)
379 379
endif	
380 380
	@echo break main >> $(GDBINIT_FILE)
381
	
381

  
382 382
debug: gdb-config $(TARGET).elf
383 383
ifeq ($(DEBUG_BACKEND), avarice)
384 384
	@echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
385 385
	@$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
386 386
	$(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
387 387
	@$(WINSHELL) /c pause
388
	
388

  
389 389
else
390 390
	@$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
391 391
	$(DEBUG_MFREQ) --port $(DEBUG_PORT)
392 392
endif
393 393
	@$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
394
	
395 394

  
396 395

  
397 396

  
397

  
398 398
# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
399 399
COFFCONVERT=$(OBJCOPY) --debugging \
400 400
--change-section-address .data-0x800000 \
trunk/programmer/netprog.py
49 49
bus.flushInput()
50 50
#print bus
51 51

  
52
def printMsg(msg):
53
    if len(msg) < 5:
54
        print "ERROR: trying to print message thats too small!"
55
        return
56
    if msg[0] == '^':
57
        print '^',
58
    else:
59
        print str(ord(msg[0]))
60

  
61
    for c in msg[1:]:
62
        print str(ord(c)),
63

  
64
    print
65

  
52 66
def sendCommand(t, cmd):
53 67
    msg = '^' + chr(1) + chr(t) + cmd + chr(1 ^ t ^ ord(cmd))
54 68
    print "sending..."
69
    printMsg(msg)
55 70
    bus.write(msg)
56 71

  
57 72
def sendProgram(t, size):
......
70 85

  
71 86
    msg = '^' + body + chr(xor)
72 87
    print "sending P"
88
    printMsg(msg)
73 89
    bus.write(msg)
74 90

  
75 91
def sendData(t, data):
......
83 99
        xor = xor ^ ord(c)
84 100

  
85 101
    msg = '^' + body + chr(xor)
102
    printMsg(msg)
86 103
    bus.write(msg)
87 104
    print '.',
88 105
    sys.stdout.flush()

Also available in: Unified diff