Howdy y'all,
I ran into some trouble using mspdebug on an RF430FRL152H chip. This chip is weird in that it is low voltage and in that it uses 4-wire JTAG but not SBW, so I used the modern (black) MSP-FET and an RF430FRL152HEVM board, which includes level conversion to 3V logic. Sadly it works in UniFlash and CCS, but not in mspdebug.
The root cause seems to be that mspdebug is always sending an activationKey of zero to DeviceHandleMSP430::identifyDevice(). According to chipinfo.db, the RF430FRL152H and a few other chips require alternate activation keys, such as 0x5aa55aa5, 0xffffffff and 0xa55aa55a. A single chip requires 0xdeadbabe.
% cat chipinfo.db| grep -i activation | grep -v 00000000
.activation_key = 0x5aa55aa5,
.activation_key = 0xffffffff,
.activation_key = 0xa55aa55a,
.activation_key = 0xffffffff,
.activation_key = 0x5aa55aa5,
.activation_key = 0xffffffff,
.activation_key = 0xa55aa55a,
.activation_key = 0xffffffff,
.activation_key = 0x5aa55aa5,
.activation_key = 0xffffffff,
.activation_key = 0xa55aa55a,
.activation_key = 0xffffffff,
.activation_key = 0x5aa55aa5,
.activation_key = 0xffffffff,
.activation_key = 0xa55aa55a,
.activation_key = 0xffffffff,
.activation_key = 0xdeadbabe,
.activation_key = 0xffffffff,
When the connection fails, it does with Error 5, Unknown Device.
% mspdebug tilib
MSPDebug version 0.25 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2017 Daniel Beer <dlbeer@gmail.com>
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Chip info database from MSP430.dll v3.13.0.601 Copyright (C) 2013 TI, Inc.
Using new (SLAC460L+) API
MSP430_GetNumberOfUsbIfs
MSP430_GetNameOfUsbIf
Found FET: ttyACM0
MSP430_Initialize: ttyACM0
Firmware version is 31400000
MSP430_VCC: 3000 mV
MSP430_OpenDevice
tilib: MSP430_OpenDevice: Unknown device (error = 5)
tilib: device initialization failed
%
A temporary workaround is to patch DLL430_v3/src/TI/DLL430/DeviceHandleMSP430.cpp in libmsp430 so that the activationKey is forced to an acceptable value.
int32_t DeviceHandleMSP430::identifyDevice (uint32_t activationKey, bool afterMagicPattern)
{
const bool assertBSLValid = (activationKey == 0x20404020);
#warning This is an ugly temporary fix. Don't use it.
//activationKey=0x00000000; //Default, doesn't work for the RF430.
//activationKey=0x5aa55aa5; //Works
activationKey=0xa55aa55a; //Also works
//activationKey=0xffffffff; //Doesn't work.
//activationKey=0xdeadbabe; //Doesn't work.
printf("Identifying device for activation_key=%lx\n", activationKey);
...
With this ugly patch to libmsp430 in place, we can connect to the chip at the expense of breaking all other chips.
% mspdebug tilib
MSPDebug version 0.25 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2017 Daniel Beer <dlbeer@gmail.com>
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Chip info database from MSP430.dll v3.13.0.601 Copyright (C) 2013 TI, Inc.
Using new (SLAC460L+) API
MSP430_GetNumberOfUsbIfs
MSP430_GetNameOfUsbIf
Found FET: ttyACM0
MSP430_Initialize: ttyACM0
Firmware version is 31300601
MSP430_VCC: 3000 mV
MSP430_OpenDevice
Identifying device for activation_key=a55aa55a
Identifying device for activation_key=a55aa55a
Got memory.
MSP430_GetFoundDevice
Device: RF430FRL152H (id = 0x0182)
2 breakpoints available
MSP430_EEM_Init
Chip ID data:
ver_id: 81e7
ver_sub_id: 0000
revision: 9a
fab: 55
self: 5555
config: 22
fuses: 55
Device: RF430FRL152H [FRAM]
...
Type "help <topic>" for more information.
Use the "opt" command ("help opt") to set options.
Press Ctrl+D to quit.
(mspdebug)
I'm not quite sure what the proper way to fix this issue is, but I hope that these details are helpful. Perhaps libmsp430 needs to be given an explicit model number, or an extra flag is needed somewhere?
Cheers from Knoxville,
--Travis
Howdy y'all,
I ran into some trouble using mspdebug on an RF430FRL152H chip. This chip is weird in that it is low voltage and in that it uses 4-wire JTAG but not SBW, so I used the modern (black) MSP-FET and an RF430FRL152HEVM board, which includes level conversion to 3V logic. Sadly it works in UniFlash and CCS, but not in mspdebug.
The root cause seems to be that mspdebug is always sending an
activationKeyof zero toDeviceHandleMSP430::identifyDevice(). According tochipinfo.db, the RF430FRL152H and a few other chips require alternate activation keys, such as0x5aa55aa5,0xffffffffand0xa55aa55a. A single chip requires0xdeadbabe.When the connection fails, it does with Error 5, Unknown Device.
A temporary workaround is to patch
DLL430_v3/src/TI/DLL430/DeviceHandleMSP430.cppinlibmsp430so that theactivationKeyis forced to an acceptable value.With this ugly patch to libmsp430 in place, we can connect to the chip at the expense of breaking all other chips.
I'm not quite sure what the proper way to fix this issue is, but I hope that these details are helpful. Perhaps libmsp430 needs to be given an explicit model number, or an extra flag is needed somewhere?
Cheers from Knoxville,
--Travis