Update error memory viewer to newest memory structure

This commit is contained in:
Mario Hüttel 2021-07-19 22:44:13 +02:00
parent fdb1c6e893
commit 6e89c0e098
2 changed files with 9 additions and 3 deletions

View File

@ -21,6 +21,7 @@ struct safety_memory_header {
uint32_t boot_status_offset; /**< @brief Offset of the safety_memory_boot_status struct (in 32 bit words)*/ uint32_t boot_status_offset; /**< @brief Offset of the safety_memory_boot_status struct (in 32 bit words)*/
uint32_t config_overrides_offset; /**< @brief Offset address of override entries */ uint32_t config_overrides_offset; /**< @brief Offset address of override entries */
uint32_t config_overrides_len; /**< @brief Length of override entries in words */ uint32_t config_overrides_len; /**< @brief Length of override entries in words */
uint32_t firmware_update_filename; /**< @brief Filename of the firmware update. This string is at maximum 256 bytes long including the 0 terminator */
uint32_t err_memory_offset; /**< @brief Offset of the error memory */ uint32_t err_memory_offset; /**< @brief Offset of the error memory */
uint32_t err_memory_end; /**< @brief End of the error memory. This points to the word after the error memory, containing the CRC of the whole backup RAM. */ uint32_t err_memory_end; /**< @brief End of the error memory. This points to the word after the error memory, containing the CRC of the whole backup RAM. */
uint32_t crc; /**< @brief CRC of the header */ uint32_t crc; /**< @brief CRC of the header */

View File

@ -214,16 +214,21 @@ static void show_error_memory(GtkTreeView *tree_view, const unsigned char *memor
valid = true; valid = true;
break; break;
case 4: case 4:
header.firmware_update_filename = dat;
interpret = new_string_printf("Offset of FW update filename: %u", dat);
valid = true;
break;
case 5:
header.err_memory_offset = dat; header.err_memory_offset = dat;
interpret = new_string_printf("Error memory offset addr: %u", dat); interpret = new_string_printf("Error memory offset addr: %u", dat);
valid = true; valid = true;
break; break;
case 5: case 6:
header.err_memory_end = dat; header.err_memory_end = dat;
interpret = new_string_printf("Error memory end ptr: %u", dat); interpret = new_string_printf("Error memory end ptr: %u", dat);
valid = true; valid = true;
break; break;
case 6: case 7:
header.crc = dat; header.crc = dat;
valid = check_err_mem_header(&header, &expected_value); valid = check_err_mem_header(&header, &expected_value);
if (valid) { if (valid) {
@ -235,7 +240,7 @@ static void show_error_memory(GtkTreeView *tree_view, const unsigned char *memor
} }
break; break;
} }
if (i <= 6) { if (i <= 7) {
state = ENTRY_STATE_INVALID; state = ENTRY_STATE_INVALID;
goto print; goto print;
} }