drivers/stlink_usb: fix stlink_usb_read_regs() for API v2
[openocd.git] / src / jtag / drivers / ulink.c
index 8c2b9db122ac3c850e83ba9d2afd577a802022ce..550df1c93f1d66c11c7c909827f5cd099447bac1 100644 (file)
@@ -13,9 +13,7 @@
  *   GNU General Public License for more details.                          *
  *                                                                         *
  *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.           *
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
  ***************************************************************************/
 
 #ifdef HAVE_CONFIG_H
@@ -193,6 +191,7 @@ int ulink_execute_queued_commands(struct ulink *device, int timeout);
 const char *ulink_cmd_id_string(uint8_t id);
 void ulink_print_command(struct ulink_cmd *ulink_cmd);
 void ulink_print_queue(struct ulink *device);
+static int ulink_calculate_frequency(enum ulink_delay_type type, int delay, long *f);
 #endif
 
 int ulink_append_scan_cmd(struct ulink *device,
@@ -225,7 +224,6 @@ int ulink_append_test_cmd(struct ulink *device);
 
 /* OpenULINK TCK frequency helper functions */
 int ulink_calculate_delay(enum ulink_delay_type type, long f, int *delay);
-int ulink_calculate_frequency(enum ulink_delay_type type, int delay, long *f);
 
 /* Interface between OpenULINK and OpenOCD */
 static void ulink_set_end_state(tap_state_t endstate);
@@ -461,9 +459,6 @@ int ulink_write_firmware_section(struct ulink *device,
        LOG_DEBUG("section %02i at addr 0x%04x (size 0x%04x)", section_index, addr,
                size);
 
-       if (data == NULL)
-               return ERROR_FAIL;
-
        /* Copy section contents to local buffer */
        ret = image_read_section(firmware_image, section_index, 0, size, data,
                        &size_read);
@@ -1372,6 +1367,7 @@ int ulink_calculate_delay(enum ulink_delay_type type, long f, int *delay)
        return ERROR_OK;
 }
 
+#ifdef _DEBUG_JTAG_IO_
 /**
  * Calculate frequency for a given delay value.
  *
@@ -1386,7 +1382,7 @@ int ulink_calculate_delay(enum ulink_delay_type type, long f, int *delay)
  * @return on success: ERROR_OK
  * @return on failure: ERROR_FAIL
  */
-int ulink_calculate_frequency(enum ulink_delay_type type, int delay, long *f)
+static int ulink_calculate_frequency(enum ulink_delay_type type, int delay, long *f)
 {
        float t, f_float, f_rounded;
 
@@ -1435,6 +1431,7 @@ int ulink_calculate_frequency(enum ulink_delay_type type, int delay, long *f)
 
        return ERROR_OK;
 }
+#endif
 
 /******************* Interface between OpenULINK and OpenOCD ******************/
 
@@ -2069,7 +2066,7 @@ static int ulink_khz(int khz, int *jtag_speed)
        }
 
 #ifdef _DEBUG_JTAG_IO_
-       long f_tck, f_tms, f_scan_in, f_scan_out, f_scan_io;
+       long f_tck = 0, f_tms = 0, f_scan_in = 0, f_scan_out = 0, f_scan_io = 0;
 
        ulink_calculate_frequency(DELAY_CLOCK_TCK, ulink_handle->delay_clock_tck,
                &f_tck);

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)