/* project specific includes */
#include <helper/binarybuffer.h>
+#include <jtag/adapter.h>
#include <jtag/interface.h>
#include <jtag/hla/hla_layout.h>
#include <jtag/hla/hla_transport.h>
/* the nulink only supports 8/32bit memory read/writes
* honour 32bit, all others will be handled as 8bit access */
if (size == 4) {
- /* When in jtag mode the nulink uses the auto-increment functinality.
+ /* When in jtag mode the nulink uses the auto-increment functionality.
* However it expects us to pass the data correctly, this includes
* alignment and any page boundaries. We already do this as part of the
* adi_v5 implementation, but the nulink is a hla adapter and so this
- * needs implementiong manually.
+ * needs implementing manually.
* currently this only affects jtag mode, they do single
* access in SWD mode - but this may change and so we do it for both modes */
/* the nulink only supports 8/32bit memory read/writes
* honour 32bit, all others will be handled as 8bit access */
if (size == 4) {
- /* When in jtag mode the nulink uses the auto-increment functinality.
+ /* When in jtag mode the nulink uses the auto-increment functionality.
* However it expects us to pass the data correctly, this includes
* alignment and any page boundaries. We already do this as part of the
* adi_v5 implementation, but the nulink is a hla adapter and so this
- * needs implementiong manually.
+ * needs implementing manually.
* currently this only affects jtag mode, do single
* access in SWD mode - but this may change and so we do it for both modes */
goto error_open;
}
- if (param->serial) {
- size_t len = mbstowcs(NULL, param->serial, 0);
+ const char *serial = adapter_get_required_serial();
+ if (serial) {
+ size_t len = mbstowcs(NULL, serial, 0);
target_serial = calloc(len + 1, sizeof(wchar_t));
if (!target_serial) {
goto error_open;
}
- if (mbstowcs(target_serial, param->serial, len + 1) == (size_t)(-1)) {
+ if (mbstowcs(target_serial, serial, len + 1) == (size_t)(-1)) {
LOG_WARNING("unable to convert serial");
free(target_serial);
target_serial = NULL;