Skip to content

Commit

Permalink
V3.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
felias-fogg committed Sep 15, 2023
1 parent 89746c3 commit bbaf18d
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 21 deletions.
1 change: 0 additions & 1 deletion .pio/build/uno/idedata.json

This file was deleted.

6 changes: 6 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog for dw-link

## Version 3.5.2 (15-Sep-2023)

* Only cosmetic changes:
* Compiled it with PlatformIO in order to catch violations of the C++ standard
* Dealt with spurious warnings of double defintions

## Version 3.5.1 (13-Sep-2023)

* RAM measurement has been disabled.
Expand Down
Binary file added docs/pics/SMD-soldering.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
5 changes: 5 additions & 0 deletions docs/wishlist.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Wish list for dw-link

* try integration of tool into IDE 2.0 again

* debug tiny13 problem, perhaps by reverting back to the version in
2022, when it seemed to work

* rewrite compile-time conditionals so that they do not show up as errors in PIO

* reorganize BP management: have a list of stored and a list of new BPs, which would save us 3 bytes per BP, i.e., we could easily go from 25 to 30 BPs -- but be careful!
Expand Down
12 changes: 5 additions & 7 deletions dw-link/dw-link.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ void blockIRQ();
void unblockIRQ();
void monitorSystemLoadState();
void initSession();
void setupio();
void reportFatalError(byte, boolean);
void setSysState(statetype);
void gdbHandleCmd();
void gdbParsePacket(const byte *);
void gdbParseMonitorPacket(const byte *);
void gdbParseMonitorPacket(byte *);
int gdbDetermineMonitorCommand(char *, char &);
void gdbHelp();
void gdbReportLastError();
Expand Down Expand Up @@ -121,7 +122,7 @@ byte DWflushInput();
void enableSpiPins();
void disableSpiPins();
byte ispTransfer(byte);
void ispDelay();
void ispDelay(boolean);
byte ispSend(byte, byte, byte, byte, boolean);
boolean enterProgramMode();
void leaveProgramMode();
Expand All @@ -135,11 +136,8 @@ char nib2hex(byte);
byte hex2nib(char);
byte parseHex(const byte *, unsigned long *);
void convNum(byte *, long);
void convBufferHex2Ascii(char *, byte *, int);
#if FREERAM
void freeRamMin();
int freeRam();
#endif
void convBufferHex2Ascii(char *, const byte *, int);
void measureRam();
void alltests();
void testSummary(int);
int testResult(bool);
Expand Down
19 changes: 10 additions & 9 deletions dw-link/dw-link.ino
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
// because relevant input ports are not in the I/O range and therefore the tight timing
// constraints are not satisfied.

#define VERSION "3.5.0"
#define VERSION "3.5.2"

// some constants, you may want to change
#ifndef PROGBPS
Expand Down Expand Up @@ -102,6 +102,7 @@
#if HIGHSPEED
#define SPEEDLIMIT SPEEDHIGH
#else
#undef SPEEDLIMIT
#define SPEEDLIMIT SPEEDLOW
#endif

Expand Down Expand Up @@ -447,9 +448,6 @@ long timeoutcnt = 0; // counter for DW read timeouts
long flashcnt = 0; // number of flash writes
#if FREERAM
int freeram = 2048; // minimal amount of free memory (only if enabled)
#define measureRam() freeRamMin()
#else
#define measureRam()
#endif

// communcation interface to target
Expand Down Expand Up @@ -869,7 +867,7 @@ void gdbParsePacket(const byte *buff)


// parse a monitor command and execute the appropriate actions
void gdbParseMonitorPacket(const byte *buf)
void gdbParseMonitorPacket(byte *buf)
{
[[maybe_unused]] int para = 0;
char cmdbuf[40];
Expand Down Expand Up @@ -3734,12 +3732,14 @@ void convBufferHex2Ascii(char *outbuf, const byte *buf, int maxlen)
outbuf[min(clen/2,maxlen-1)] = '\0';
}

#if FREERAM
void freeRamMin(void)

void measureRam(void)
{
#if FREERAM
int f = freeRam();
// DEBPR(F("RAM: ")); DEBLN(f);
freeram = min(f,freeram);
#endif
}

int freeRam(void)
Expand All @@ -3756,7 +3756,7 @@ int freeRam(void)
free_memory = (int) &stack_here - (int) __brkval;
return (free_memory);
}
#endif


/*****************************************************************************************************/
/******************************************** Unit tests *********************************************/
Expand Down Expand Up @@ -4295,7 +4295,8 @@ int targetTests(int &num) {
ctx.wpc = 0xde; // rcall instruction
targetRestoreRegisters();
targetStep(); // one step leads to Break+0x55
if (!expectBreakAndU()) succ = false; targetSaveRegisters();
if (!expectBreakAndU()) succ = false;
targetSaveRegisters();
failed += testResult(succ && ctx.wpc == 0xe4);
gdbDebugMessagePSTR(PSTR("Test targetContinue/targetBreak: "), testnum++);
succ = true;
Expand Down
6 changes: 4 additions & 2 deletions pcb/assembly.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ Q1, Q2, and U1 should all be soldered with the marking pointing upwards.

When soldering the shield connectors to the board, it is a good idea to do that when the plugs are inserted into the sockets of the Arduino UNO.

If you have never soldered SMD parts before: It is not rocket science. You need to put a blob of solder on one pad, take the SMD part with a pair of tweezers, and solder the part to the pad with a solder blob on it. Afterwards solder the remaining legs to the respective pads. Finally, check with a magnifying glass that all connections have been made. There are numerous tutorials about SMD hand-soldering out there. The [HowTo](https://josepheoff.github.io/posts/howtosolder-11soldersmdpassive) by JRE is very detailed and easy to follow.
If you have never soldered SMD parts before: It is not rocket science. You need to put a blob of solder on one pad, take the SMD part with a pair of tweezers, and solder the part to the pad with a solder blob on it. Afterwards solder the remaining legs to the respective pads. Finally, check with a magnifying glass that all connections have been made. There are numerous tutorials about SMD hand-soldering out there. The [HowTo](https://josepheoff.github.io/posts/howtosolder-11soldersmdpassive) by JRE is very detailed and easy to follow. Here are three photos to illustrate how to solder the MOS-FETs step by step.

In order to test the basic functionality of the freshly assembled board, you'll find the sketch `testprobe.ino` in the repository.
![SMD soldering](../docs/pics/SMD-soldering.png)

In order to test the basic functionality of the freshly assembled board, you'll find the sketch `testprobe.ino` in the repository. Set the `Pullup` jumper to `10K` and the `Supply` jumper to either `3V` or `5V` before you start to test the board.

Note that the board disables the auto-reset capability of the UNO board. That is, when the shield is plugged in, you cannot upload any sketch to the UNO. Unplug the shield and try again!
10 changes: 8 additions & 2 deletions testprobe/testprobe.ino
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// tests a dw-link probe
#define VERSION "1.1.0"
#define VERSION "1.2.1"

// pins
const byte IVSUP = 2;
Expand All @@ -20,6 +20,12 @@ void setup()
Serial.println(F("\nTesting dw-link-probe " VERSION));
pinMode(SYSLED, OUTPUT);
pinMode(TMISO, OUTPUT);
// initially switch the two SPI lines to GND in order to discharge any stry capacitance
pinMode(TARMOSI, OUTPUT);
pinMode(TARSCK, OUTPUT);
delay(100);
pinMode(TARMOSI,INPUT);
pinMode(TARSCK,INPUT);
printHelp();
}

Expand Down Expand Up @@ -195,7 +201,7 @@ int getLevel(byte pin)
int getDisLev(byte pin) {
int level = (analogRead(pin)*10)/2;

if (level < 500) return 0;
if (level < 1000) return 0;
else if (level > 3000 && level < 3700) return 3;
else if (level > 4500) return 5;
else return -1;
Expand Down

0 comments on commit bbaf18d

Please sign in to comment.