Fixed in many other places, and submitted in response to Øyvind's invitation.
/* Always write both data and OOB ... we are not "raw" I/O! */
if (!data) {
- LOG_ERROR("Missing NAND data; try 'nand raw_access enable'\n");
+ LOG_ERROR("Missing NAND data; try 'nand raw_access enable'");
return ERROR_NAND_OPERATION_FAILED;
}
nuc910_nand = calloc(1, sizeof(struct nuc910_nand_controller));
if (!nuc910_nand) {
- LOG_ERROR("no memory for nand controller\n");
+ LOG_ERROR("no memory for nand controller");
return ERROR_NAND_DEVICE_INVALID;
}
uint8_t ale, cle;
if (CMD_ARGC != 3) {
- LOG_ERROR("arguments must be: <target_id> <NAND_address>\n");
+ LOG_ERROR("arguments must be: <target_id> <NAND_address>");
return ERROR_NAND_DEVICE_INVALID;
}
hw = calloc(1, sizeof(*hw));
if (!hw) {
- LOG_ERROR("no memory for nand controller\n");
+ LOG_ERROR("no memory for nand controller");
return ERROR_NAND_DEVICE_INVALID;
}
struct s3c24xx_nand_controller *s3c24xx_info;
s3c24xx_info = malloc(sizeof(struct s3c24xx_nand_controller));
if (s3c24xx_info == NULL) {
- LOG_ERROR("no memory for nand controller\n");
+ LOG_ERROR("no memory for nand controller");
return -ENOMEM;
}
if (aduc702x_check_flash_completion(target, 3500) != ERROR_OK)
{
- LOG_ERROR("mass erase failed\n");
+ LOG_ERROR("mass erase failed");
aduc702x_set_write_enable(target, 0);
return ERROR_FLASH_OPERATION_FAILED;
}
if (aduc702x_check_flash_completion(target, 50) != ERROR_OK)
{
- LOG_ERROR("failed to erase sector at address 0x%08lX\n", adr);
+ LOG_ERROR("failed to erase sector at address 0x%08lX", adr);
aduc702x_set_write_enable(target, 0);
return ERROR_FLASH_SECTOR_NOT_ERASED;
}
if (aduc702x_check_flash_completion(target, 1) != ERROR_OK)
{
- LOG_ERROR("single write failed for address 0x%08lX\n", (unsigned long)(offset + x));
+ LOG_ERROR("single write failed for address 0x%08lX", (unsigned long)(offset + x));
aduc702x_set_write_enable(target, 0);
return ERROR_FLASH_OPERATION_FAILED;
}
r = target_read_u32(pChip->target, pReg->address, goes_here);
if (r != ERROR_OK) {
- LOG_ERROR("Cannot read SAM3 register: %s @ 0x%08x, Err: %d\n",
+ LOG_ERROR("Cannot read SAM3 register: %s @ 0x%08x, Err: %d",
pReg->name, (unsigned)(pReg->address), r);
}
return r;
r = sam3_ReadThisReg(pChip,
sam3_get_reg_ptr(&(pChip->cfg), pReg));
if (r != ERROR_OK) {
- LOG_ERROR("Cannot read SAM3 registere: %s @ 0x%08x, Error: %d\n",
+ LOG_ERROR("Cannot read SAM3 registere: %s @ 0x%08x, Error: %d",
pReg->name, ((unsigned)(pReg->address)), r);
return r;
}
return ERROR_TARGET_NOT_HALTED;
}
if (0 == bank->num_sectors) {
- LOG_ERROR("Target: not supported/not probed\n");
+ LOG_ERROR("Target: not supported/not probed");
return ERROR_FAIL;
}
pPrivate = get_sam3_bank_private(bank);
if (!pPrivate) {
- LOG_ERROR("Invalid/unknown bank number\n");
+ LOG_ERROR("Invalid/unknown bank number");
return ERROR_FAIL;
}
if (flashErr != 0x0)
{
- LOG_ERROR("Flash erase failed with %d (%s)\n", (int)flashErr, flash_errmsg(flashErr));
+ LOG_ERROR("Flash erase failed with %d (%s)", (int)flashErr, flash_errmsg(flashErr));
return ERROR_FAIL;
}
if (flashErr != 0x0)
{
- LOG_ERROR("Flash prog failed with %d (%s)\n", (int)flashErr, flash_errmsg(flashErr));
+ LOG_ERROR("Flash prog failed with %d (%s)", (int)flashErr, flash_errmsg(flashErr));
return ERROR_FAIL;
}
}
pFile = fopen(fileName,"rb");
if (pFile == NULL)
{
- LOG_ERROR("Can't open %s\n", fileName);
+ LOG_ERROR("Can't open %s", fileName);
return ERROR_FAIL;
}
if (fseek(pFile, 0, SEEK_END) != 0)
{
- LOG_ERROR("Can't open %s\n", fileName);
+ LOG_ERROR("Can't open %s", fileName);
fclose(pFile);
return ERROR_FAIL;
}
long fsize = ftell(pFile);
if (fsize == -1)
{
- LOG_ERROR("Can't open %s\n", fileName);
+ LOG_ERROR("Can't open %s", fileName);
fclose(pFile);
return ERROR_FAIL;
}
if (fseek(pFile, 0, SEEK_SET) != 0)
{
- LOG_ERROR("Can't open %s\n", fileName);
+ LOG_ERROR("Can't open %s", fileName);
fclose(pFile);
return ERROR_FAIL;
}
*data = malloc(*len + 1);
if (*data == NULL)
{
- LOG_ERROR("Can't open %s\n", fileName);
+ LOG_ERROR("Can't open %s", fileName);
fclose(pFile);
return ERROR_FAIL;
}
{
fclose(pFile);
free(*data);
- LOG_ERROR("Can't open %s\n", fileName);
+ LOG_ERROR("Can't open %s", fileName);
return ERROR_FAIL;
}
fclose(pFile);
if (u_tg < 1500)
{
- LOG_ERROR("Vref too low. Check Target Power\n");
+ LOG_ERROR("Vref too low. Check Target Power");
}
}
else
{
- LOG_ERROR("ARM-JTAG-EW command CMD_GET_TAPHW_STATE failed (%d)\n", result);
+ LOG_ERROR("ARM-JTAG-EW command CMD_GET_TAPHW_STATE failed (%d)", result);
}
return ERROR_OK;
if (result != 0)
{
- LOG_ERROR("ARM-JTAG-EW command CMD_GET_VERSION failed (%d)\n", result);
+ LOG_ERROR("ARM-JTAG-EW command CMD_GET_VERSION failed (%d)", result);
return ERROR_JTAG_DEVICE_ERROR;
}
if (status == FT_OK)
{
- LOG_ERROR("ListDevices: %lu\n", num_devices);
+ LOG_ERROR("ListDevices: %lu", num_devices);
for (i = 0; i < num_devices; i++)
LOG_ERROR("%" PRIu32 ": \"%s\"", i, desc_array[i]);
}
}
else
{
- LOG_ERROR("ListDevices: NONE\n");
+ LOG_ERROR("ListDevices: NONE");
}
return ERROR_JTAG_INIT_FAILED;
}
result = jlink_usb_read(jlink_handle, 8);
if (result != 8)
{
- LOG_ERROR("J-Link command EMU_CMD_GET_STATE failed (%d)\n", result);
+ LOG_ERROR("J-Link command EMU_CMD_GET_STATE failed (%d)", result);
return ERROR_JTAG_DEVICE_ERROR;
}
while (length) {
if (length < sizeof(*header)) {
- LOG_ERROR("Malformed DTC image\n");
+ LOG_ERROR("Malformed DTC image");
exit(1);
}
length -= sizeof(*header);
if (length < (size_t)header->length + 1) {
- LOG_ERROR("Malformed DTC image\n");
+ LOG_ERROR("Malformed DTC image");
exit(1);
}
break;
default:
- LOG_ERROR("Invalid DTC image record type: 0x%02x\n", header->type);
+ LOG_ERROR("Invalid DTC image record type: 0x%02x", header->type);
exit(1);
break;
}
if (ep2_buffer[0] & 0x01) break;
if (!--i) {
- LOG_ERROR("%s, %d: too many retries waiting for DTC status\n",
+ LOG_ERROR("%s, %d: too many retries waiting for DTC status",
__FILE__, __LINE__
);
return(-ETIMEDOUT);
);
if (usb_err < (int)sizeof(ep2_buffer)) {
- LOG_ERROR("%s, %d: Read of endpoint 2 returned %d\n",
+ LOG_ERROR("%s, %d: Read of endpoint 2 returned %d",
__FILE__, __LINE__, usb_err
);
return(usb_err);
NULL, 0
);
if (usb_err < 0) {
- LOG_ERROR("dtc_run_download: %s\n", usb_strerror());
+ LOG_ERROR("dtc_run_download: %s", usb_strerror());
exit(1);
}
} else {
reply_buffer, dtc_queue.reply_index
);
if (usb_err < 0) {
- LOG_ERROR("dtc_run_download: %s\n", usb_strerror());
+ LOG_ERROR("dtc_run_download: %s", usb_strerror());
exit(1);
} else {
/* process the reply, which empties the reply queue and frees its entries */
uint8_t dtc_mask;
if (scan_size < 1) {
- LOG_ERROR("scan_size cannot be less than 1 bit\n");
+ LOG_ERROR("scan_size cannot be less than 1 bit");
exit(1);
}
chunk_bits,
cmd
) == NULL) {
- LOG_ERROR("enqueuing DTC reply entry: %s\n", strerror(errno));
+ LOG_ERROR("enqueuing DTC reply entry: %s", strerror(errno));
exit(1);
}
extra_bits,
cmd
) == NULL) {
- LOG_ERROR("enqueuing DTC reply entry: %s\n", strerror(errno));
+ LOG_ERROR("enqueuing DTC reply entry: %s", strerror(errno));
exit(1);
}
1,
cmd
) == NULL) {
- LOG_ERROR("enqueuing DTC reply entry: %s\n", strerror(errno));
+ LOG_ERROR("enqueuing DTC reply entry: %s", strerror(errno));
exit(1);
}
for (i = rlink_speed_table_size; i--;) {
if (rlink_speed_table[i].prescaler == speed) {
if (dtc_load_from_buffer(pHDev, rlink_speed_table[i].dtc, rlink_speed_table[i].dtc_size) != 0) {
- LOG_ERROR("An error occurred while trying to load DTC code for speed \"%d\".\n", speed);
+ LOG_ERROR("An error occurred while trying to load DTC code for speed \"%d\".", speed);
exit(1);
}
struct usb_device *dev = usb_device(pHDev);
if (dev->descriptor.bNumConfigurations > 1)
{
- LOG_ERROR("Whoops! NumConfigurations is not 1, don't know what to do...\n");
+ LOG_ERROR("Whoops! NumConfigurations is not 1, don't know what to do...");
return ERROR_FAIL;
}
if (dev->config->bNumInterfaces > 1)
{
- LOG_ERROR("Whoops! NumInterfaces is not 1, don't know what to do...\n");
+ LOG_ERROR("Whoops! NumInterfaces is not 1, don't know what to do...");
return ERROR_FAIL;
}
}
if (usb_set_altinterface(pHDev,0) != 0)
{
- LOG_ERROR("Failed to set interface.\n");
+ LOG_ERROR("Failed to set interface.");
return ERROR_FAIL;
}
if (status == FT_OK)
{
- LOG_ERROR("ListDevices: %lu\n", num_devices);
+ LOG_ERROR("ListDevices: %lu", num_devices);
for (i = 0; i < num_devices; i++)
LOG_ERROR("%i: %s", i, desc_array[i]);
}
if (ejtag_ctrl & EJTAG_CTRL_DERR)
{
if (retries--) {
- LOG_ERROR("DMA Read Addr = %08" PRIx32 " Data = ERROR ON READ (retrying)\n", addr);
+ LOG_ERROR("DMA Read Addr = %08" PRIx32 " Data = ERROR ON READ (retrying)", addr);
goto begin_ejtag_dma_read;
}
else
- LOG_ERROR("DMA Read Addr = %08" PRIx32 " Data = ERROR ON READ\n", addr);
+ LOG_ERROR("DMA Read Addr = %08" PRIx32 " Data = ERROR ON READ", addr);
return ERROR_JTAG_DEVICE_ERROR;
}
if (ejtag_ctrl & EJTAG_CTRL_DERR)
{
if (retries--) {
- LOG_ERROR("DMA Read Addr = %08" PRIx32 " Data = ERROR ON READ (retrying)\n", addr);
+ LOG_ERROR("DMA Read Addr = %08" PRIx32 " Data = ERROR ON READ (retrying)", addr);
goto begin_ejtag_dma_read_h;
}
else
- LOG_ERROR("DMA Read Addr = %08" PRIx32 " Data = ERROR ON READ\n", addr);
+ LOG_ERROR("DMA Read Addr = %08" PRIx32 " Data = ERROR ON READ", addr);
return ERROR_JTAG_DEVICE_ERROR;
}
if (ejtag_ctrl & EJTAG_CTRL_DERR)
{
if (retries--) {
- LOG_ERROR("DMA Read Addr = %08" PRIx32 " Data = ERROR ON READ (retrying)\n", addr);
+ LOG_ERROR("DMA Read Addr = %08" PRIx32 " Data = ERROR ON READ (retrying)", addr);
goto begin_ejtag_dma_read_b;
}
else
- LOG_ERROR("DMA Read Addr = %08" PRIx32 " Data = ERROR ON READ\n", addr);
+ LOG_ERROR("DMA Read Addr = %08" PRIx32 " Data = ERROR ON READ", addr);
return ERROR_JTAG_DEVICE_ERROR;
}
if (ejtag_ctrl & EJTAG_CTRL_DERR)
{
if (retries--) {
- LOG_ERROR("DMA Write Addr = %08" PRIx32 " Data = ERROR ON WRITE (retrying)\n", addr);
+ LOG_ERROR("DMA Write Addr = %08" PRIx32 " Data = ERROR ON WRITE (retrying)", addr);
goto begin_ejtag_dma_write;
}
else
- LOG_ERROR("DMA Write Addr = %08" PRIx32 " Data = ERROR ON WRITE\n", addr);
+ LOG_ERROR("DMA Write Addr = %08" PRIx32 " Data = ERROR ON WRITE", addr);
return ERROR_JTAG_DEVICE_ERROR;
}
if (ejtag_ctrl & EJTAG_CTRL_DERR)
{
if (retries--) {
- LOG_ERROR("DMA Write Addr = %08" PRIx32 " Data = ERROR ON WRITE (retrying)\n", addr);
+ LOG_ERROR("DMA Write Addr = %08" PRIx32 " Data = ERROR ON WRITE (retrying)", addr);
goto begin_ejtag_dma_write_h;
}
else
- LOG_ERROR("DMA Write Addr = %08" PRIx32 " Data = ERROR ON WRITE\n", addr);
+ LOG_ERROR("DMA Write Addr = %08" PRIx32 " Data = ERROR ON WRITE", addr);
return ERROR_JTAG_DEVICE_ERROR;
}
if (ejtag_ctrl & EJTAG_CTRL_DERR)
{
if (retries--) {
- LOG_ERROR("DMA Write Addr = %08" PRIx32 " Data = ERROR ON WRITE (retrying)\n", addr);
+ LOG_ERROR("DMA Write Addr = %08" PRIx32 " Data = ERROR ON WRITE (retrying)", addr);
goto begin_ejtag_dma_write_b;
}
else
- LOG_ERROR("DMA Write Addr = %08" PRIx32 " Data = ERROR ON WRITE\n", addr);
+ LOG_ERROR("DMA Write Addr = %08" PRIx32 " Data = ERROR ON WRITE", addr);
return ERROR_JTAG_DEVICE_ERROR;
}
break;
case XSETSDRMASKS:
- LOG_ERROR("unsupported XSETSDRMASKS\n");
+ LOG_ERROR("unsupported XSETSDRMASKS");
unsupported = 1;
break;
case XSDRINC:
- LOG_ERROR("unsupported XSDRINC\n");
+ LOG_ERROR("unsupported XSDRINC");
unsupported = 1;
break;
case XSDRB:
- LOG_ERROR("unsupported XSDRB\n");
+ LOG_ERROR("unsupported XSDRB");
unsupported = 1;
break;
case XSDRC:
- LOG_ERROR("unsupported XSDRC\n");
+ LOG_ERROR("unsupported XSDRC");
unsupported = 1;
break;
case XSDRE:
- LOG_ERROR("unsupported XSDRE\n");
+ LOG_ERROR("unsupported XSDRE");
unsupported = 1;
break;
case XSDRTDOB:
- LOG_ERROR("unsupported XSDRTDOB\n");
+ LOG_ERROR("unsupported XSDRTDOB");
unsupported = 1;
break;
case XSDRTDOC:
- LOG_ERROR("unsupported XSDRTDOC\n");
+ LOG_ERROR("unsupported XSDRTDOC");
unsupported = 1;
break;
case XSDRTDOE:
- LOG_ERROR("unsupported XSDRTDOE\n");
+ LOG_ERROR("unsupported XSDRTDOE");
unsupported = 1;
break;
break;
default:
- LOG_ERROR("unknown xsvf command (0x%02X)\n", uc);
+ LOG_ERROR("unknown xsvf command (0x%02X)", uc);
unsupported = 1;
}