From 1692dfbf610085ba35e20a03eae7496976d5ea9b Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C4=99drzej=20Boczar?= Date: Fri, 29 May 2020 14:56:56 +0200 Subject: [PATCH] build/sim/spdeeprom: use hex format when loading from file --- litex/build/sim/core/modules/spdeeprom/spdeeprom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litex/build/sim/core/modules/spdeeprom/spdeeprom.c b/litex/build/sim/core/modules/spdeeprom/spdeeprom.c index db5d85fd..27b37c9c 100644 --- a/litex/build/sim/core/modules/spdeeprom/spdeeprom.c +++ b/litex/build/sim/core/modules/spdeeprom/spdeeprom.c @@ -123,7 +123,7 @@ static int spdeeprom_new(void **sess, char *args) spd_file = fopen(spd_filename, "r"); } if (spd_filename != NULL && spd_file != NULL) { - DBG("[spdeeprom] loading EEPROM contents from file: %s\n", spd_filename); + printf("[spdeeprom] loading EEPROM contents from file: %s\n", spd_filename); spdeeprom_from_file(s, spd_file); fclose(spd_file); } else { // fill in the memory with some data @@ -389,7 +389,7 @@ static void spdeeprom_from_file(struct session_s *s, FILE *file) if ((n_read = getline(&line, &bufsize, file)) < 0) { break; } - byte = strtoul(line, &c, 0); + byte = strtoul(line, &c, 16); if (c == line) { DBG("[spdeeprom] Incorrect value at line %d\n", i); } else { -- 2.30.2