ubuntu 在 R40e 上 還有 Debian 在 Sempron 2600 上

2011年2月23日 星期三

HITACHI HDS721050CLA (500G)

買了 Hitachi 500G,大概 1200. ref 一下內建的 hd tune 結果: dell * 這個 hitachi 是接在 esata 外接核上的。 http://r40eubuntu.blogspot.com/2011/04/new-microsd-card-pendrive.html

2011年2月17日 星期四

soft_reset_halt

燒錯 boot rom 進板子,所以boot 後就重開。 剛好這板子又有偉大的 mcu watchdog reset 設計,所以一下就被 power reset. 這樣個狀況下用 jtag,動作要快。 一抓住就要趕快送 watchdog handshake signal. script: halt soft_reset_halt ... send watchdog handshake .. halt : 停下 arm core -- 但是這時候cpu 已經在 exception state, mmu 也已經 enable 了。 soft_reset_halt : 把 cpu reset 之後才可以趕快下 register write command,送出 mcu watchdog handshake 還要注意。 另外如果config script 中有寫 reset config event,每次 抓到 cpu 時,openocd 都會經由 reset pin 作 hardware reset。 所以有時候接著 jtag,雖然 telnet console 沒有下命令,board 會反覆 reset...

2011年2月14日 星期一

openocd : target_scrupt , target configure -event

以前的 opencoded 操作範例 都又 target_script 0 .. 但是現在做起來卻說不認識 target_script_0,google 說 target_script 已經被 event 機制取代 這一篇也有說 target_script 已經淘汰了,由 targget event 取代 target_script <target#> <eventname> <scriptname> use <target_name> configure -event <eventname> "script <scriptname>" 至於 event 有哪些,要看 opencod 的 user manual:

The following target events are defined:

  • debug-halted The target has halted for debug reasons (i.e.: breakpoint)
  • debug-resumed The target has resumed (i.e.: gdb said run)
  • early-halted Occurs early in the halt process
  • gdb-attach When GDB connects. This is before any communication with the target, so this can be used to set up the target so it is possible to probe flash. Probing flash is necessary during gdb connect if gdb load is to write the image to flash. Another use of the flash memory map is for GDB to automatically hardware/software breakpoints depending on whether the breakpoint is in RAM or read only memory.
  • gdb-detach When GDB disconnects
  • gdb-end When the target has halted and GDB is not doing anything (see early halt)
  • gdb-flash-erase-start Before the GDB flash process tries to erase the flash
  • gdb-flash-erase-end After the GDB flash process has finished erasing the flash
  • gdb-flash-write-start Before GDB writes to the flash
  • gdb-flash-write-end After GDB writes to the flash
  • gdb-start Before the target steps, gdb is trying to start/resume the target
  • halted The target has halted
  • reset-assert-pre Issued as part of reset processing after reset_init was triggered but before either SRST alone is re-asserted on the scan chain, or reset-assert is triggered.
  • reset-assert Issued as part of reset processing after reset-assert-pre was triggered. When such a handler is present, cores which support this event will use it instead of asserting SRST. This support is essential for debugging with JTAG interfaces which don't include an SRST line (JTAG doesn't require SRST), and for selective reset on scan chains that have multiple targets.
  • reset-assert-post Issued as part of reset processing after reset-assert has been triggered. or the target asserted SRST on the entire scan chain.
  • reset-deassert-pre Issued as part of reset processing after reset-assert-post has been triggered.
  • reset-deassert-post Issued as part of reset processing after reset-deassert-pre has been triggered and (if the target is using it) after SRST has been released on the scan chain.
  • reset-end Issued as the final step in reset processing.
  • reset-init Used by reset init command for board-specific initialization. This event fires after reset-deassert-post.

    This is where you would configure PLLs and clocking, set up DRAM so you can download programs that don't fit in on-chip SRAM, set up pin multiplexing, and so on. (You may be able to switch to a fast JTAG clock rate here, after the target clocks are fully set up.)

  • reset-start Issued as part of reset processing before reset_init is called.

    This is the most robust place to use jtag_rclk or adapter_khz to switch to a low JTAG clock rate, when reset disables PLLs needed to use a fast clock.

  • resume-start Before any target is resumed
  • resume-end After all targets have resumed
  • resume-ok Success
  • resumed Target has resumed

event script 可以寫 echo "ok ok ok". 這樣可以確認什麼時候script被 run 到。

2011年2月10日 星期四

openocd - some digg with command

在 src/target/target.c 中有一堆 support 的 command,是用 regiser_command 來產生的。 int target_register_user_commands(struct command_context_s *cmd_ctx) { int retval = ERROR_OK; /* script procedures */ register_command(cmd_ctx, NULL, "profile", handle_profile_command, COMMAND_EXEC, "profiling samples the CPU PC"); register_jim(cmd_ctx, "ocd_mem2array", jim_mem2array, "read memory and return as a TCL array for script processing"); register_jim(cmd_ctx, "ocd_array2mem", jim_array2mem, "convert a TCL array to memory locations and write the values"); register_command(cmd_ctx, NULL, "fast_load_image", handle_fast_load_image_command, COMMAND_ANY, "same args as load_image, image stored in memory - mainly for profiling purposes"); register_command(cmd_ctx, NULL, "fast_load", handle_fast_load_command, COMMAND_ANY, "loads active fast load image to current target - mainly for profiling purposes"); register_command(cmd_ctx, NULL, "virt2phys", handle_virt2phys_command, COMMAND_ANY, "translate a virtual address into a physical address"); register_command(cmd_ctx, NULL, "reg", handle_reg_command, COMMAND_EXEC, "display or set a register"); register_command(cmd_ctx, NULL, "poll", handle_poll_command, COMMAND_EXEC, "poll target state"); register_command(cmd_ctx, NULL, "wait_halt", handle_wait_halt_command, COMMAND_EXEC, "wait for target halt [time (s)]"); register_command(cmd_ctx, NULL, "halt", handle_halt_command, COMMAND_EXEC, "halt target"); register_command(cmd_ctx, NULL, "resume", handle_resume_command, COMMAND_EXEC, "resume target [addr]"); register_command(cmd_ctx, NULL, "step", handle_step_command, COMMAND_EXEC, "step one instruction from current PC or [addr]"); register_command(cmd_ctx, NULL, "reset", handle_reset_command, COMMAND_EXEC, "reset target [run|halt|init] - default is run"); register_command(cmd_ctx, NULL, "soft_reset_halt", handle_soft_reset_halt_command, COMMAND_EXEC, "halt the target and do a soft reset"); register_command(cmd_ctx, NULL, "mdw", handle_md_command, COMMAND_EXEC, "display memory words <addr> [count]"); register_command(cmd_ctx, NULL, "mdh", handle_md_command, COMMAND_EXEC, "display memory half-words <addr> [count]"); register_command(cmd_ctx, NULL, "mdb", handle_md_command, COMMAND_EXEC, "display memory bytes <addr> [count]"); register_command(cmd_ctx, NULL, "mww", handle_mw_command, COMMAND_EXEC, "write memory word <addr> <value> [count]"); register_command(cmd_ctx, NULL, "mwh", handle_mw_command, COMMAND_EXEC, "write memory half-word <addr> <value> [count]"); register_command(cmd_ctx, NULL, "mwb", handle_mw_command, COMMAND_EXEC, "write memory byte <addr> <value> [count]"); register_command(cmd_ctx, NULL, "bp", handle_bp_command, COMMAND_EXEC, "set breakpoint <address> <length> [hw]"); register_command(cmd_ctx, NULL, "rbp", handle_rbp_command, COMMAND_EXEC, "remove breakpoint <adress>"); register_command(cmd_ctx, NULL, "wp", handle_wp_command, COMMAND_EXEC, "set watchpoint <address> <length> <r/w/a> [value] [mask]"); register_command(cmd_ctx, NULL, "rwp", handle_rwp_command, COMMAND_EXEC, "remove watchpoint <adress>"); register_command(cmd_ctx, NULL, "load_image", handle_load_image_command, COMMAND_EXEC, "load_image <file> <address> ['bin'|'ihex'|'elf'|'s19'] [min_address] [max_length]"); register_command(cmd_ctx, NULL, "dump_image", handle_dump_image_command, COMMAND_EXEC, "dump_image <file> <address> <size>"); register_command(cmd_ctx, NULL, "verify_image", handle_verify_image_command, COMMAND_EXEC, "verify_image <file> [offset] [type]"); register_command(cmd_ctx, NULL, "test_image", handle_test_image_command, COMMAND_EXEC, "test_image <file> [offset] [type]"); if((retval = target_request_register_commands(cmd_ctx)) != ERROR_OK) return retval; if((retval = trace_register_commands(cmd_ctx)) != ERROR_OK) return retval; return retval; } 所以...在 config 要控制週邊的 gpio pin,就要用 ..mvw 囉?

標籤

網誌存檔