On Dienstag, 7. August 2018 06:58:44 CEST Rick Foos wrote:
> Looking for ideas on how to read a slow register (250ms) with openocd Mdw.
>
> When I try to read one of these slow registers, I hit a WAIT, read back
> bus float.
>
> The dap disconnects, reconnects, and the value appears in an unexpected
> location.
>
> When the DAP disconnects, I'm able to read the value in another return
> location.
>
> Am I adjusting time correctly? Or does it have to do with dap resets and
> not delay time?
>
> How should I handle reading a very slow register on the target.
>
Please provide a -d3 log.
BR,
Matthias
> Thank you,
>
> Rick
>
> ---
>
> In src/jtag/drivers/ftdi.c, there is an adjustment made for time between
> AP instructions.
>
> ---
>
> /* Insert idle cycles after AP accesses to avoid WAIT */
> if (cmd & SWD_CMD_APnDP)
> mpsse_clock_data_out(mpsse_ctx, NULL, 0, ap_delay_clk, SWD_MODE);
> ---
>
> There is also an area where more WAIT's can be added.
>
> ---
>
> for (size_t i = 0; i < swd_cmd_queue_length; i++) {
> int ack = buf_get_u32(swd_cmd_queue[i].trn_ack_data_parity_trn,
> 1, 3);
>
> LOG_DEBUG_IO("%s %s %s reg %X = %08"PRIx32,
> ack == SWD_ACK_OK ? "OK" : ack == SWD_ACK_WAIT ? "WAIT"
>
> : ack == SWD_ACK_FAULT ? "FAULT" : "JUNK",
>
> (swd_cmd_queue[i].cmd & SWD_CMD_APnDP) ? "AP" : "DP",
> swd_cmd_queue[i].cmd & SWD_CMD_RnW ? "read" : "write",
> (swd_cmd_queue[i].cmd & SWD_CMD_A32) >> 1,
> buf_get_u32(swd_cmd_queue[i].trn_ack_data_parity_trn,
> 1 + 3 + (swd_cmd_queue[i].cmd & SWD_CMD_RnW ? 0
>
> : 1), 32));
>
> #if 1
> for (int j = 0;j<10;j++) {
> if (ack == SWD_ACK_WAIT) {
> busy_sleep(75);
> ack =
> buf_get_u32(swd_cmd_queue[i].trn_ack_data_parity_trn, 1, 3);
> LOG_DEBUG_IO("%s %s %s reg %X = %08"PRIx32,
> ack == SWD_ACK_OK ? "OK" : ack == SWD_ACK_WAIT
> ? "WAIT" : ack == SWD_ACK_FAULT ? "FAULT" : "JUNK",
> swd_cmd_queue[i].cmd & SWD_CMD_APnDP ? "AP" : "DP",
> swd_cmd_queue[i].cmd & SWD_CMD_RnW ? "read" : "write",
> (swd_cmd_queue[i].cmd & SWD_CMD_A32) >> 1,
> buf_get_u32(swd_cmd_queue[i].trn_ack_data_parity_trn,
> 1 + 3 + (swd_cmd_queue[i].cmd &
> SWD_CMD_RnW ? 0 : 1), 32));
> }
> }
> #endif
>
>
>
>
> User : 42 23419 command.c:544 command_print(): debug_level: 4
> Debug: 43 23420 command.c:143 script_debug(): command - ocd_command
> ocd_command type ocd_mdw 0x500100fc
> Debug: 44 23420 command.c:143 script_debug(): *command - mdw ocd_mdw
> 0x500100fc*
> Debug: 45 23420 ftdi.c:1101 ftdi_swd_run_queue(): Executing 2 queued
> transactions
> Debug: 46 23420 ftdi.c:1133 ftdi_swd_run_queue(): OK AP read reg 0 =
> 00030003
> Debug: 47 23420 ftdi.c:1133 ftdi_swd_run_queue(): OK DP read reg C =
> 00030003
> Debug: 49 23420 ftdi.c:1101 ftdi_swd_run_queue(): Executing 4 queued
> transactions
> Debug: 50 23420 ftdi.c:1133 ftdi_swd_run_queue(): OK DP write reg 8 =
> 00000000
> Debug: 51 23420 ftdi.c:1133 ftdi_swd_run_queue(): OK AP write reg 4 =
> 500100fc
> Debug: 52 23420 ftdi.c:1133 ftdi_swd_run_queue(): OK AP read reg C =
> 00030003
> Debug: 53 23420 ftdi.c:1133 ftdi_swd_run_queue(): WAIT DP read reg C =
> ffffffff
> Debug: 54 23495 ftdi.c:1145 ftdi_swd_run_queue(): WAIT DP read reg C =
> ffffffff
> Debug: 55 23570 ftdi.c:1145 ftdi_swd_run_queue(): WAIT DP read reg C =
> ffffffff
> Debug: 56 23645 ftdi.c:1145 ftdi_swd_run_queue(): WAIT DP read reg C =
> ffffffff
> Debug: 57 23720 ftdi.c:1145 ftdi_swd_run_queue(): WAIT DP read reg C =
> ffffffff
> Debug: 58 23795 ftdi.c:1145 ftdi_swd_run_queue(): WAIT DP read reg C =------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel