I found some bugs in protocol 1xx, 2xx and 4xx families using your console program. This will fail password checking also uploading code to msp430g2553. After I modified some codes then it worked.
Following are my modifications:
case Command.Password: // address: - data: D1 ... D20
{
BSL_frame.Add(Const.BSL_CMD124__RX_PASSWORD); // typo?
BSL_frame.AddRange(Enumerable.Repeat(Const.BSL_DATA124__PW_L1_L2, 2).ToArray());
BSL_frame.AddRange(Enumerable.Repeat(Const.BSL_DATA124__DUMMY, 4).ToArray());
if ((data == null || data.Length != Const.BSL_SIZE124__PASSWORD))
{
message.status = Utils.StatusCreate(801);
return message;
}
BSL_frame.AddRange(data);
}
break;
case Command.Upload: // address: AL, AH data: D1 ... Dn-4
{
BSL_frame.Add(Const.BSL_CMD124__RX_DATA_BLOCK);
BSL_frame.AddRange(Enumerable.Repeat((byte)(data.Length + 4), 2).ToArray());
if ((address == null) || (data == null || data.Length < 1))
{
message.status = Utils.StatusCreate(801);
return message;
}
BSL_frame.AddRange(_address.ToArray());
BSL_frame.Add((byte)(data.Length));
BSL_frame.Add(0);
BSL_frame.AddRange(data);
}
break;
case Command.Upload:
{
Debug.Assert(typeof(T) == typeof(Data_Void));
//throw new BSL430Exception(460, "Result<Data_Void> res = msg(Command.*)");
result.data = (T)(object)new Data_Void();
ok = (answer.data.Length == 1 && answer.data[0] == Const.BSL_GENERAL124__ACK); // another typo?
}
break;
// BSL RX SIZE - PROTOCOL 1xx 2xx 4xx
public const byte BSL_SIZE124__PASSWORD = 32;
Thank you for providing this awesome software so that I can flash my msp430g2553!