From: Michael Boehmer Date: Wed, 1 Jun 2022 18:12:02 +0000 (+0200) Subject: Bug in trbflash.c fixed, FaRICH was missing. X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=c3c53ad76da8d3bf860ba307e66a5eda11e981e6;p=trbnettools.git Bug in trbflash.c fixed, FaRICH was missing. --- diff --git a/libtrbnet/trbflash.c b/libtrbnet/trbflash.c index ca40c0c..2c5e2a1 100644 --- a/libtrbnet/trbflash.c +++ b/libtrbnet/trbflash.c @@ -132,7 +132,7 @@ static const char FlashTypeStr[][32] = { "Trb5sc", "MDC OEP", "MDC TDC", - "Farich" + "Farich", "Dirich5s", "TOMcat" }; @@ -649,7 +649,7 @@ static int initTransfer(uint16_t trb_address) __LINE__, trb_strerror()); return -1; } - + for (i = 0; i < status; i += 2) { FlashParam flashParam; uint16_t hardwareId = (trbBuffer[i + 1] >> 16) & 0xffff; @@ -672,7 +672,7 @@ static int initTransfer(uint16_t trb_address) hardwareId, trbBuffer[i] & 0xffff); return -1; } - + /* Check here for flash group compatibility */ do { if ((flashParam.flashType == flashParamRef.flashType) || @@ -732,7 +732,6 @@ static int initTransfer(uint16_t trb_address) } } - NUM_PAGES = flashParamRef.numPages; NUM_BLOCKS = (NUM_PAGES * PAGE_SIZE) / BLOCK_SIZE; @@ -745,7 +744,7 @@ static int initTransfer(uint16_t trb_address) fprintf(stderr, "Found %d Endpoint(s) of group %s\n", counter, FlashTypeStr[flashParamRef.flashType]); - + return counter; } @@ -838,6 +837,7 @@ static int writePage(uint16_t trb_address, uint32_t pageNumber, /* Transfer trbBuffer */ size = temp - trbBuffer + 1; + fprintf(logFile, "XXX PN %u NB %u S %u\n", pageNumber, numBytes, size); if ((status = trb_register_write_mem(trb_address, BlockRam, 0, trbBuffer, size)) == -1) {