In order to support CPUX and Xv2 devices, some refactoring is needed:
* split jtaglib into files concerning low-level JTAG/SBW physical layer
stuff, and a file containing the actual debug routines. the latter is
implemented in a separate file per CPU type (CPUX and Xv2 currently empty)
* use a lookup table dependig on the JTAG ID or CPU type to select which
function to use
* move the 'struct device' dependency in pif and mehfet to jtdev, as it
is needed everywhere, especially for device identification
In a next step, the following actions can be performed:
* Unify the read and write callbacks in pif and mehfet (used in readmem
and writemem of struct device) to remove the redundancy
* Unify the init_device function in pif and mehfet to properly detect
the device type, as done in v3hil. The device base type does query
this data independenly, however, which feels unwanted.
Yes, I primarily just want to get rid of strcat (which is checked and
appears to be OK, but still, it's 2018).
Also bring behaviour in line with manual and common expectations:
- In absence of MSPDEBUG_TILIB_PATH, the dynamic linker search
path is processed
- If MSPDEBUG_TILIB_PATH is specified, that directory is searched
- The original behaviour in case of an error is graceful fall-through
to letting the dynamic linker do its deed
- The behaviour is changed such that if MSPDEBUG_TILIB_PATH is specified,
only that path is being considered.
This is in line with both manual and common sense (otherwise one
could have just used LD_LIBRARY_PATH).
- Fix sim driver so that it can handle two bytes read/write.
- Add error message regarding odd size write to sim driver.
- Fix simio_timer constructor so that can accept size.
- Fix simio_timer so that we read/write channels' registers.
Indent the jtbp_close() function consistently with tabs in order to fix
for GCC 7's flagging of this warning:
drivers/jtdev_bus_pirate.c: In function ‘jtbp_close’:
drivers/jtdev_bus_pirate.c:189:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
if(write(p->port, &out_buff, 1));
^~
drivers/jtdev_bus_pirate.c:191:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
close(p->port);
^~~~~
Signed-off-by: Andrew Bradford <andrew@bradfordembedded.com>
This is extremely slow at programming things, but is very useful for
unbricking an MSP-FET430UIF if you have a bus pirate and no other
programmers around.
According to (not very good) documentation and empiric testing
BSL expects sizes of buffers sends to both sides to be even.
The same applies to memory addresses.