Browse Source

hosted/stlinkv2.c: Use V2 API to read coreid.

pull/704/head
Uwe Bonnes 4 years ago
committed by UweBonnes
parent
commit
a392480631
  1. 9
      src/platforms/hosted/stlinkv2.c

9
src/platforms/hosted/stlinkv2.c

@ -686,11 +686,10 @@ static int stlink_enter_debug_jtag(bmp_info_t *info)
static uint32_t stlink_read_coreid(void) static uint32_t stlink_read_coreid(void)
{ {
uint8_t cmd[16] = {STLINK_DEBUG_COMMAND, uint8_t cmd[16] = {STLINK_DEBUG_COMMAND, STLINK_DEBUG_APIV2_READ_IDCODES};
STLINK_DEBUG_READCOREID}; uint8_t data[12];
uint8_t data[4]; send_recv(info.usb_link, cmd, 16, data, 12);
send_recv(info.usb_link, cmd, 16, data, 4); uint32_t id = data[4] | data[5] << 8 | data[6] << 16 | data[6] << 24;
uint32_t id = data[0] | data[1] << 8 | data[2] << 16 | data[3] << 24;
DEBUG_INFO("Read Core ID: 0x%08" PRIx32 "\n", id); DEBUG_INFO("Read Core ID: 0x%08" PRIx32 "\n", id);
return id; return id;
} }

Loading…
Cancel
Save