Witam wszystkich.
Zacznę od początku...
Chcąc zacząć zabawę z ARM-ami zakupiłem uC Atmela AT91SAM7X256 do tego zaprojektowałem prostą płytke(ARM+stabilizator+porty wypuszczone na goldpinach)Bazowałem sie na schemacie płytki testowej OLIMEX-a. Programator to ARMJTAG USB(taki z allegro) Po sprawdzeniu płytka wolna od zwarć i przerw w ścieżkach. Napięcie bezpieczne dla ARM (3.3V) na wyjściu VDDout mam 1.8 V. Wszystko VDDcore podłączone. Doprowadzone napięcia odfiltrowane kondensatorami 100n.
Po zainstalowaniu sterowników do programatora, podłączeniu go do płytki oraz połączeniu sie z nim przez openocd-ftd2xx.exe
wpisaniu przez telnet polecenia flash info 0
otrzymuje odpowiedz od układu:
przebieg odpowiedzi wygląda tak:
wgranie przykładowego kodu znalezionego w necie(mryganie podświetleniem LCD na bazie płytki Olimexa nie działa
Chciałem odpalić przez SAM-BA ale też nic z tego.
Próba skasowania bitu gpnvm:
at91sam7 gpnvm 0 2 clear
w celu odpalenie SAM-BA nic nie daje:
Przebieg kasowanie wygląda tak:
Próbowałem już różncyh skryptów i metod programowania ale nic nie daje pozytywnych skutków:
Zastanawia mnie jedno:
Co znaczy:
status[0]: 0x401
oraz czy oby napewno powinno być:
0: at91sam7 at 0x00100000, size 0x00040000, buswidth 4, chipwidth 0
#0: 0x00000000 (0x40000 256kB) protection state unknown
Dodam że wywołanie polecenia odczytu pamięci:
dump_image C:\flashi.bin 0x0020000 0x00040000
przebiega wpożądku
z tym że po odczycie widać że jest coś w niej
ponowny odczyt z innego sektora:
dump_image C:\flashi.bin 0x0010000 0x00040000
po porównaniu jest to samo. czy powinno...?
W czym tkwi problem...?
Proszę o pomoc.
Z góry wielkie dzięki.
Zacznę od początku...
Chcąc zacząć zabawę z ARM-ami zakupiłem uC Atmela AT91SAM7X256 do tego zaprojektowałem prostą płytke(ARM+stabilizator+porty wypuszczone na goldpinach)Bazowałem sie na schemacie płytki testowej OLIMEX-a. Programator to ARMJTAG USB(taki z allegro) Po sprawdzeniu płytka wolna od zwarć i przerw w ścieżkach. Napięcie bezpieczne dla ARM (3.3V) na wyjściu VDDout mam 1.8 V. Wszystko VDDcore podłączone. Doprowadzone napięcia odfiltrowane kondensatorami 100n.
Po zainstalowaniu sterowników do programatora, podłączeniu go do płytki oraz połączeniu sie z nim przez openocd-ftd2xx.exe
Open On-Chip Debugger (2008-06-19 19:00) svn: 717
URL: http://svn.berlios.de/svnroot/repos/openocd/trunk
Debug: 5 0 command.c:432 command_run_line(): script sam7x256.cfg
Debug: 6 0 configuration.c:87 open_file_from_path(): opened sam7x256.cfg
Debug: 8 0 command.c:432 command_run_line(): telnet_port 4444
Debug: 10 0 command.c:432 command_run_line(): gdb_port 3333
Debug: 12 0 command.c:432 command_run_line(): interface ft2232
Debug: 14 0 command.c:432 command_run_line(): ft2232_device_desc "ARMJTAG A"
Debug: 16 0 command.c:432 command_run_line(): ft2232_layout jtagkey
Debug: 18 0 command.c:432 command_run_line(): ft2232_vid_pid 0x0403 0xcff8
Debug: 20 0 command.c:432 command_run_line(): jtag_speed 5
Debug: 21 0 jtag.c:1863 handle_jtag_speed_command(): handle jtag speed
Info: 22 0 options.c:50 configuration_output_handler(): jtag_speed: 5, 5
Debug: 24 0 command.c:432 command_run_line(): jtag_nsrst_delay 200
Debug: 26 0 command.c:432 command_run_line(): jtag_ntrst_delay 200
Debug: 28 0 command.c:432 command_run_line(): reset_config trst_and_srst separate
Debug: 30 0 command.c:432 command_run_line(): jtag_device 4 0x1 0xf 0xe
Debug: 32 0 command.c:432 command_run_line(): daemon_startup reset
Info: 33 0 options.c:50 configuration_output_handler(): Open On-Chip Debugger (2008-06-19 19:00) svn: 717
Debug: 35 0 command.c:432 command_run_line(): target arm7tdmi little run_and_init 0 arm7tdmi
Debug: 37 0 command.c:432 command_run_line(): run_and_halt_time 0 30
Debug: 39 16 command.c:432 command_run_line(): target_script 0 sam7x256_reset.script
Error: 40 16 target.c:1480 handle_target_script_command(): incomplete target_script command
Info: 41 16 options.c:50 configuration_output_handler(): Syntax error:
Info: 42 16 options.c:50 configuration_output_handler(): target_script no help available
Debug: 44 16 command.c:432 command_run_line(): flash bank at91sam7 0 0 0 0 0
Debug: 46 16 command.c:432 command_run_line(): init
Debug: 47 16 openocd.c:102 handle_init_command(): target init complete
Debug: 48 16 ft2232.c:1374 ft2232_init_ftd2xx(): 'ft2232' interface using FTD2XX with 'jtagkey' layout (0403:cff8)
Debug: 49 63 ft2232.c:1463 ft2232_init_ftd2xx(): current latency timer: 2
Debug: 50 63 ft2232.c:1729 jtagkey_init(): 80 08 1b
Debug: 51 63 ft2232.c:1787 jtagkey_init(): 82 09 0f
Debug: 52 63 ft2232.c:253 ft2232_speed(): 86 05 00
Debug: 53 78 openocd.c:109 handle_init_command(): jtag interface init complete
Debug: 54 78 jtag.c:1537 jtag_init_inner(): Init JTAG chain
Debug: 55 78 jtag.c:326 jtag_call_event_callbacks(): jtag event: JTAG controller reset (TLR or TRST)
Debug: 56 78 jtag.c:1295 jtag_reset_callback(): -
Debug: 57 78 jtag.c:326 jtag_call_event_callbacks(): jtag event: JTAG controller reset (TLR or TRST)
Debug: 58 78 jtag.c:1295 jtag_reset_callback(): -
Info: 59 94 jtag.c:1389 jtag_examine_chain(): JTAG device found: 0x3f0f0f0f (Manufacturer: 0x787, Part: 0xf0f0, Version: 0x3)
Debug: 60 94 jtag.c:326 jtag_call_event_callbacks(): jtag event: JTAG controller reset (TLR or TRST)
Debug: 61 94 jtag.c:1295 jtag_reset_callback(): -
Debug: 62 94 openocd.c:116 handle_init_command(): jtag init complete
Debug: 63 94 openocd.c:119 handle_init_command(): jtag examine complete
Debug: 64 94 openocd.c:126 handle_init_command(): flash init complete
Debug: 65 94 openocd.c:130 handle_init_command(): NAND init complete
Debug: 66 94 openocd.c:134 handle_init_command(): pld init complete
Debug: 67 110 gdb_server.c:2036 gdb_init(): gdb service for target arm7tdmi at port 3333
Debug: 69 110 command.c:432 command_run_line(): reset
Debug: 70 110 target.c:1851 handle_reset_command(): -
Debug: 71 110 ft2232.c:253 ft2232_speed(): 86 05 00
Debug: 72 110 jtag.c:1581 jtag_init_reset(): Trying to bring the JTAG controller to life by asserting TRST / TLR
Debug: 73 110 jtag.c:996 jtag_add_reset(): SRST line released
Debug: 74 125 jtag.c:1015 jtag_add_reset(): TRST line asserted
Debug: 75 125 jtag.c:326 jtag_call_event_callbacks(): jtag event: JTAG controller reset (TLR or TRST)
Debug: 76 125 jtag.c:1295 jtag_reset_callback(): -
Debug: 77 125 jtag.c:992 jtag_add_reset(): SRST line asserted
Debug: 78 125 jtag.c:1015 jtag_add_reset(): TRST line asserted
Debug: 79 125 jtag.c:326 jtag_call_event_callbacks(): jtag event: JTAG controller reset (TLR or TRST)
Debug: 80 125 jtag.c:1295 jtag_reset_callback(): -
Debug: 81 125 jtag.c:992 jtag_add_reset(): SRST line asserted
Debug: 82 125 jtag.c:996 jtag_add_reset(): SRST line released
Debug: 83 125 ft2232.c:1004 jtagkey_reset(): trst: 1, srst: 0, high_output: 0x08, high_direction: 0x0f
Debug: 84 328 ft2232.c:1004 jtagkey_reset(): trst: 1, srst: 1, high_output: 0x00, high_direction: 0x0f
Debug: 85 328 ft2232.c:1004 jtagkey_reset(): trst: 0, srst: 1, high_output: 0x01, high_direction: 0x0f
Debug: 86 532 ft2232.c:1004 jtagkey_reset(): trst: 0, srst: 0, high_output: 0x09, high_direction: 0x0f
Debug: 87 938 jtag.c:1537 jtag_init_inner(): Init JTAG chain
Debug: 88 938 jtag.c:326 jtag_call_event_callbacks(): jtag event: JTAG controller reset (TLR or TRST)
Debug: 89 938 jtag.c:1295 jtag_reset_callback(): -
Info: 90 938 jtag.c:1389 jtag_examine_chain(): JTAG device found: 0x3f0f0f0f (Manufacturer: 0x787, Part: 0xf0f0, Version: 0x3
Debug: 91 938 jtag.c:326 jtag_call_event_callbacks(): jtag event: JTAG controller reset (TLR or TRST)
Debug: 92 953 jtag.c:1295 jtag_reset_callback(): -
Debug: 93 953 arm7_9_common.c:767 arm7_9_assert_reset(): target->state: unknown
Debug: 94 953 jtag.c:992 jtag_add_reset(): SRST line asserted
Debug: 95 953 ft2232.c:1004 jtagkey_reset(): trst: 0, srst: 1, high_output: 0x01, high_direction: 0x0f
Debug: 96 1203 arm7_9_common.c:820 arm7_9_deassert_reset(): target->state: reset
Debug: 97 1203 jtag.c:996 jtag_add_reset(): SRST line released
Debug: 98 1203 ft2232.c:1004 jtagkey_reset(): trst: 0, srst: 0, high_output: 0x09, high_direction: 0x0f
Debug: 99 1610 target.c:411 target_process_reset(): Waiting for halted stated as approperiate
Debug: 100 1610 arm7_9_common.c:960 arm7_9_halt(): target->state: running
Debug: 101 1610 embeddedice.c:397 embeddedice_write_reg(): 9: 0xffffffff
Debug: 102 1610 embeddedice.c:397 embeddedice_write_reg(): 11: 0xffffffff
Debug: 103 1610 embeddedice.c:397 embeddedice_write_reg(): 12: 0x00000100
Debug: 104 1625 embeddedice.c:397 embeddedice_write_reg(): 13: 0x000000f7
Debug: 105 1625 target.c:425 target_process_reset(): Polling target
Debug: 106 1625 embeddedice.c:397 embeddedice_write_reg(): 0: 0x00000005
Debug: 107 1625 embeddedice.c:397 embeddedice_write_reg(): 12: 0x00000000
Debug: 108 1625 arm7_9_common.c:1074 arm7_9_debug_entry(): target entered debug from ARM state
Debug: 109 1641 arm7_9_common.c:1106 arm7_9_debug_entry(): target entered debug state in Abort mode
Debug: 110 1641 arm7_9_common.c:1137 arm7_9_debug_entry(): r0: 0x00000800
Debug: 111 1641 arm7_9_common.c:1137 arm7_9_debug_entry(): r1: 0x00000001
Debug: 112 1641 arm7_9_common.c:1137 arm7_9_debug_entry(): r2: 0xd39d96c5
Debug: 113 1641 arm7_9_common.c:1137 arm7_9_debug_entry(): r3: 0x55bc4fdd
Debug: 114 1641 arm7_9_common.c:1137 arm7_9_debug_entry(): r4: 0x0020ffa0
Debug: 115 1641 arm7_9_common.c:1137 arm7_9_debug_entry(): r5: 0x00000000
Debug: 116 1641 arm7_9_common.c:1137 arm7_9_debug_entry(): r6: 0x00000000
Debug: 117 1641 arm7_9_common.c:1137 arm7_9_debug_entry(): r7: 0x00000000
Debug: 118 1641 arm7_9_common.c:1137 arm7_9_debug_entry(): r8: 0x00000000
Debug: 119 1641 arm7_9_common.c:1137 arm7_9_debug_entry(): r9: 0x00000000
Debug: 120 1657 arm7_9_common.c:1137 arm7_9_debug_entry(): r10: 0x00000000
Debug: 121 1657 arm7_9_common.c:1137 arm7_9_debug_entry(): r11: 0x0020ff8c
Debug: 122 1657 arm7_9_common.c:1137 arm7_9_debug_entry(): r12: 0x0020ff90
Debug: 123 1657 arm7_9_common.c:1137 arm7_9_debug_entry(): r13: 0x00000001
Debug: 124 1657 arm7_9_common.c:1137 arm7_9_debug_entry(): r14: 0x00100638
Debug: 125 1657 arm7_9_common.c:1137 arm7_9_debug_entry(): r15: 0x00000010
Debug: 126 1657 arm7_9_common.c:1143 arm7_9_debug_entry(): entered debug state at PC 0x10
Debug: 127 1657 target.c:724 target_call_event_callbacks(): target event 0
Debug: 128 1672 ft2232.c:253 ft2232_speed(): 86 05 00
wpisaniu przez telnet polecenia flash info 0
otrzymuje odpowiedz od układu:
> flash info 0
#0: at91sam7 at 0x00100000, size 0x00040000, buswidth 4, chipwidth 0
#0: 0x00000000 (0x40000 256kB) protection state unknown
at91sam7 information: Chip is AT91SAM7X256
cidr: 0x275b0940, arch: 0x0075, eproc: ARM7TDMI, version:0x000, flashsize: 0x00040000
master clock(estimated): 53227kHz
pagesize: 256, lockbits: 16 0x0000, pages in lock region: 64
securitybit: 0, nvmbits(3): 0x4
przebieg odpowiedzi wygląda tak:
Info: 129 80860 server.c:78 add_connection(): accepting 'telnet' connection from 0
Debug: 131 84016 command.c:432 command_run_line(): flash info 0
Debug: 132 84016 arm7_9_common.c:1825 arm7_9_read_memory(): address: 0xfffff240, size: 0x00000004, count: 0x00000001
Debug: 133 84016 target.c:1170 target_read_u32(): address: 0xfffff240, value: 0x275b0940
Debug: 134 84016 at91sam7.c:366 at91sam7_read_part_info(): nvptyp: 0x002, arch: 0x0075
Debug: 135 84016 arm7_9_common.c:1825 arm7_9_read_memory(): address: 0xfffffc24, size: 0x00000004, count: 0x00000001
Debug: 136 84032 target.c:1170 target_read_u32(): address: 0xfffffc24, value: 0x000127e0
Debug: 137 84032 arm7_9_common.c:1825 arm7_9_read_memory(): address: 0xfffffc30, size: 0x00000004, count: 0x00000001
Debug: 138 84032 target.c:1170 target_read_u32(): address: 0xfffffc30, value: 0x00000007
Debug: 139 84032 arm7_9_common.c:1825 arm7_9_read_memory(): address: 0xfffffc2c, size: 0x00000004, count: 0x00000001
Debug: 140 84047 target.c:1170 target_read_u32(): address: 0xfffffc2c, value: 0x1048100e
Debug: 141 84047 arm7_9_common.c:1825 arm7_9_read_memory(): address: 0xfffffc2c, size: 0x00000004, count: 0x00000001
Debug: 142 84063 target.c:1170 target_read_u32(): address: 0xfffffc2c, value: 0x1048100e
Debug: 143 84063 arm7_9_common.c:1825 arm7_9_read_memory(): address: 0xffffff68, size: 0x00000004, count: 0x00000001
Debug: 144 84063 target.c:1170 target_read_u32(): address: 0xffffff68, value: 0x00000401
Debug: 145 84063 arm7_9_common.c:1825 arm7_9_read_memory(): address: 0xffffff68, size: 0x00000004, count: 0x00000001
Debug: 146 84063 target.c:1170 target_read_u32(): address: 0xffffff68, value: 0x00000401
wgranie przykładowego kodu znalezionego w necie(mryganie podświetleniem LCD na bazie płytki Olimexa nie działa
Chciałem odpalić przez SAM-BA ale też nic z tego.
Próba skasowania bitu gpnvm:
at91sam7 gpnvm 0 2 clear
w celu odpalenie SAM-BA nic nie daje:
Przebieg kasowanie wygląda tak:
Debug: 148 313860 command.c:432 command_run_line(): at91sam7 gpnvm 0 2 clear
Debug: 149 313860 arm7_9_common.c:1825 arm7_9_read_memory(): address: 0xfffffc24, size: 0x00000004, count: 0x00000001
Debug: 150 313860 target.c:1170 target_read_u32(): address: 0xfffffc24, value: 0x000127e0
Debug: 151 313860 arm7_9_common.c:1825 arm7_9_read_memory(): address: 0xfffffc30, size: 0x00000004, count: 0x00000001
Debug: 152 313875 target.c:1170 target_read_u32(): address: 0xfffffc30, value: 0x00000007
Debug: 153 313875 arm7_9_common.c:1825 arm7_9_read_memory(): address: 0xfffffc2c, size: 0x00000004, count: 0x00000001
Debug: 154 313875 target.c:1170 target_read_u32(): address: 0xfffffc2c, value: 0x1048100e
Debug: 155 313875 arm7_9_common.c:1825 arm7_9_read_memory(): address: 0xfffffc2c, size: 0x00000004, count: 0x00000001
Debug: 156 313875 target.c:1170 target_read_u32(): address: 0xfffffc2c, value: 0x1048100e
Debug: 157 313875 at91sam7.c:246 at91sam7_set_flash_mode(): fmcn[0]: 54
Debug: 158 313875 target.c:1238 target_write_u32(): address: 0xffffff60, value: 0x00360100
Debug: 159 313907 embeddedice.c:397 embeddedice_write_reg(): 0: 0x00000004
Debug: 160 313907 embeddedice.c:397 embeddedice_write_reg(): 0: 0x00000005
Debug: 161 313907 target.c:1238 target_write_u32(): address: 0xffffff64, value: 0x5a00020d
Debug: 162 313907 embeddedice.c:397 embeddedice_write_reg(): 0: 0x00000004
Debug: 163 313907 embeddedice.c:397 embeddedice_write_reg(): 0: 0x00000005
Debug: 164 313922 at91sam7.c:290 at91sam7_flash_command(): Flash command: 0x5a00020d, flashplane: 0, pagenumber:2
Debug: 165 313922 arm7_9_common.c:1825 arm7_9_read_memory(): address: 0xffffff68, size: 0x00000004, count: 0x00000001
Debug: 166 313922 target.c:1170 target_read_u32(): address: 0xffffff68, value: 0x00000400
Debug: 167 313922 at91sam7.c:260 at91sam7_wait_status_busy(): status[0]: 0x400
Debug: 168 313922 arm7_9_common.c:1825 arm7_9_read_memory(): address: 0xffffff68, size: 0x00000004, count: 0x00000001
Debug: 169 313922 target.c:1170 target_read_u32(): address: 0xffffff68, value: 0x00000401
Debug: 170 313922 at91sam7.c:264 at91sam7_wait_status_busy(): status[0]: 0x401
Debug: 171 313922 arm7_9_common.c:1825 arm7_9_read_memory(): address: 0xffffff68, size: 0x00000004, count: 0x00000001
Debug: 172 313938 target.c:1170 target_read_u32(): address: 0xffffff68, value: 0x00000401
Debug: 173 313938 at91sam7.c:945 at91sam7_handle_gpnvm_command(): at91sam7_handle_gpnvm_command: cmd 0xd, value 0x2, status 0x401
Próbowałem już różncyh skryptów i metod programowania ale nic nie daje pozytywnych skutków:
Zastanawia mnie jedno:
Co znaczy:
status[0]: 0x401
oraz czy oby napewno powinno być:
0: at91sam7 at 0x00100000, size 0x00040000, buswidth 4, chipwidth 0
#0: 0x00000000 (0x40000 256kB) protection state unknown
Dodam że wywołanie polecenia odczytu pamięci:
dump_image C:\flashi.bin 0x0020000 0x00040000
przebiega wpożądku
> dump_image C:\flashi.bin 0x0010000 0x00040000
dumped 262144 byte in 18.062500s
z tym że po odczycie widać że jest coś w niej
ponowny odczyt z innego sektora:
dump_image C:\flashi.bin 0x0010000 0x00040000
po porównaniu jest to samo. czy powinno...?
W czym tkwi problem...?
Proszę o pomoc.
Z góry wielkie dzięki.