You really need to use the datasheet:
My problem is that I don't really know what the Vref, control, sync and home pins do in this cirucit and what they connect to ...
Not connecting the Vref pin can cause your driver to burn out. (see final paragraph)
Reference voltage for chopper circuit. A voltage applied to this pin
determines the peak load current.
There are internal comparators that compare Vref to the voltages coming from the current-sense resistors (R_S1 and R_S2). Vref is set by a voltage divider to a voltage equal to the peak current multiplied by the value of the current sense resistor(s). I generally use the combination of a fixed resistor in series with a potentiometer. The fixed resistor limits the maximum current that can be set to avoid burning out the driver transistors:
simulate this circuit – Schematic created using CircuitLab
(resistors chosen based on 0.5 Ohm current-sense resistors and 2.0A maximum phase current)
Control input that defines action of chopper.
When low chopper acts on INH1 and INH2; when high chopper
acts on phase lines ABCD.
Also from the L297 datasheet:
When the phase lines
are chopped the non-active phase line of each pair
(AB or CD) is activated (rather than interrupting the
line then active). In L297 + L298 configurations this
technique reduces dissipation in the load current
The circuit should perform acceptably with this line either tied to logic high (5V) or logic low (GND). It can be useful to make this signal jumper-selectable as sometimes switching transients on the Vsense voltages can cause the chopper to function at a frequency that is a division of the desired chopper frequency and resulting in an audible hissing sound from the motor. Changing the control mode will often eliminate this. (this can also be eliminated by a small RC filter on the Vsense lines, but that is beyond the scope of this answer)
Output of the on-chip chopper oscillator.
The SYNC connections The SYNC connections of all L297s to be
synchronized are connected together and the oscillator
components are omitted on all but one. If an external clock source
is used it is injected at this terminal.
Page 8 of the datasheet shows how this is used. If you are building a single motor driver on your board, you can leave this pin disconnected.
Open collector output that indicates when the L297 is in its initial
state (ABCD = 0101).
The transistor is open when this signal is active.
You can leave this pin disconnected.
Not connecting the Vref pin is probably your most serious problem. As you can see on the diagram on page 2 of the L297 datasheet, this is the reference voltage which goes to internal comparators and is compared to the voltages coming from the current-sense resistors. The level of Vref sets the peak current for the drive. With this pin un-connected, the controller cannot function correctly and it is very possible that it has caused the L298 to stay on and burn out. A failure of the L298 often results in a failure of the L297 and could be why it is getting hot.