Skip to content

Commit 4b27604

Browse files
committed
Added write-memory function to DebuggableDevice
1 parent 7669f26 commit 4b27604

5 files changed

+29
-5
lines changed

ARM7TDMISProcessor.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ void ARM7TDMISProcessor::DumpRegisters()
351351
LogNotice("%10s: %08x\n", GetRegisterName(reg), ReadCPURegister(reg));
352352
}*/
353353

354-
uint32_t ARM7TDMISProcessor::ReadMemory(uint32_t addr)
354+
uint32_t ARM7TDMISProcessor::ReadMemory(uint32_t /*addr*/)
355355
{
356356
throw JtagExceptionWrapper(
357357
"Memory access not implemented for this CPU yet",
@@ -360,6 +360,13 @@ uint32_t ARM7TDMISProcessor::ReadMemory(uint32_t addr)
360360
return 0;
361361
}
362362

363+
void ARM7TDMISProcessor::WriteMemory(uint32_t /*addr*/, uint32_t /*value*/)
364+
{
365+
throw JtagExceptionWrapper(
366+
"Memory access not implemented for this CPU yet",
367+
"");
368+
}
369+
363370
/**
364371
@brief Halts the CPU and enters debug state
365372
*/

ARM7TDMISProcessor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ class ARM7TDMISProcessor : public DebuggableDevice
146146
virtual void PrintRegisters();
147147

148148
virtual uint32_t ReadMemory(uint32_t addr);
149+
virtual void WriteMemory(uint32_t addr, uint32_t value);
149150

150151
/*
151152
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

DebuggableDevice.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* *
33
* ANTIKERNEL v0.1 *
44
* *
5-
* Copyright (c) 2012-2016 Andrew D. Zonenberg *
5+
* Copyright (c) 2012-2018 Andrew D. Zonenberg *
66
* All rights reserved. *
77
* *
88
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -59,3 +59,8 @@ uint32_t DebuggableDevice::ReadMemory(uint32_t addr)
5959
{
6060
return m_iface->ReadMemory(addr);
6161
}
62+
63+
void DebuggableDevice::WriteMemory(uint32_t addr, uint32_t value)
64+
{
65+
m_iface->WriteMemory(addr, value);
66+
}

DebuggableDevice.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* *
33
* ANTIKERNEL v0.1 *
44
* *
5-
* Copyright (c) 2012-2016 Andrew D. Zonenberg *
5+
* Copyright (c) 2012-2018 Andrew D. Zonenberg *
66
* All rights reserved. *
77
* *
88
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -55,6 +55,7 @@ class DebuggableDevice
5555
virtual std::string GetDescription() =0;
5656

5757
virtual uint32_t ReadMemory(uint32_t addr);
58+
virtual void WriteMemory(uint32_t addr, uint32_t value);
5859

5960
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
6061
// Debug commands

FTDIJtagInterface.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,18 +432,28 @@ void FTDIJtagInterface::SharedCtorInit(uint32_t type, const std::string& layout)
432432
m_gpioDirection.push_back(false);
433433
}
434434

435-
//Digilent HS1 and azonenberg's usb-jtag-mini (0403:8028): GPIOL3 is active HIGH output enable
435+
//Digilent HS1 and azonenberg's usb-jtag-mini (0403:8028)
436436
if(layout == "hs1")
437437
{
438+
//GPIOL3 is active HIGH output enable
438439
SetGpioDirectionDeferred(3, true);
439440
SetGpioValueDeferred(3, true);
440441
}
441442

442-
//JTAGKey (or compatible bus blaster etc): GPIOL0 is active LOW output enable
443+
//JTAGKey (or compatible bus blaster etc)
443444
else if(layout == "jtagkey")
444445
{
446+
//GPIOL0 is active LOW output enable
445447
SetGpioDirectionDeferred(0, true);
446448
SetGpioValueDeferred(0, false);
449+
450+
//GPIOH0 is TRST_N, hold this high for now since we don't support TRST in the API yet
451+
SetGpioDirectionDeferred(4, true);
452+
SetGpioValueDeferred(4, true);
453+
454+
//GPIOH2 is TRST_N_OE_N, hold this high so TRST is driven
455+
SetGpioDirectionDeferred(6, true);
456+
SetGpioValueDeferred(6, true);
447457
}
448458

449459
else

0 commit comments

Comments
 (0)