# HG changeset patch # User Mychaela Falconia # Date 1613538474 0 # Node ID 702c2c40e51a3dd9dae0519910d15139f8b9fe0c # Parent 4558048fce107a5d35cd7ea5fe30cfd564eec99e fc-simtool update-rec-prev command implemented diff -r 4558048fce10 -r 702c2c40e51a simtool/dispatch.c --- a/simtool/dispatch.c Wed Feb 17 01:17:00 2021 +0000 +++ b/simtool/dispatch.c Wed Feb 17 05:07:54 2021 +0000 @@ -62,6 +62,7 @@ extern int cmd_update_bin(); extern int cmd_update_bin_imm(); extern int cmd_update_rec(); +extern int cmd_update_rec_prev(); extern int cmd_user_sum(); extern int cmd_verify_chv(); extern int cmd_verify_ext(); @@ -153,6 +154,7 @@ {"update-bin", 2, 2, cmd_update_bin}, {"update-bin-imm", 2, 2, cmd_update_bin_imm}, {"update-rec", 2, 2, cmd_update_rec}, + {"update-rec-prev", 1, 1, cmd_update_rec_prev}, {"user-sum", 0, 0, cmd_user_sum}, {"verify-chv1", 1, 1, cmd_verify_chv}, {"verify-chv2", 1, 1, cmd_verify_chv}, diff -r 4558048fce10 -r 702c2c40e51a simtool/writecmd.c --- a/simtool/writecmd.c Wed Feb 17 01:17:00 2021 +0000 +++ b/simtool/writecmd.c Wed Feb 17 05:07:54 2021 +0000 @@ -63,3 +63,19 @@ } return update_rec_op(recno, 0x04, data, curfile_record_len); } + +cmd_update_rec_prev(argc, argv) + char **argv; +{ + u_char data[255]; + int rc; + + rc = read_hex_data_file(argv[1], data); + if (rc < 0) + return(rc); + if (rc != curfile_record_len) { + fprintf(stderr, "error: hex data length != EF record length\n"); + return(-1); + } + return update_rec_op(0, 0x03, data, curfile_record_len); +}