I have G38.2 working on my Burly build.
I think all that is needed is:
Within Configuration_adv.h:
#define G38_PROBE_TARGET
Within Configuration.h:
//#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
and
#define Z_MIN_PROBE_PIN Z_MIN_PIN
This is COUNTER-INTUTIVE. You must DISABLE the Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
option, and you assign Z_MIN_PROBE_PIN
to be Z_MIN_PIN
.
That is because Marlin is goofy about Z-min as endstop vs. Z-min as probe (e.g. bed leveling) and it gets all wacky if Marlin is AWARE that they are the same pin. So you tell Marlin treat them independently but assign them to the same pin. Clear?
This will set up both G28 and G38.2 as normally-open and triggered when closed, so you can G28 downward with a touchplate, or you can G38.2 downward with a touchplate. (Or G38.2 in X and Y too if you want to get fancy.)
If you want a separate pin for probing vs. homing then you can use #define Z_MIN_PROBE_PIN Z_MAX_PIN
or any other pin you have available, but then you have to be careful with which is which, or you can crash while homing or probing if you hook up the wrong one.
Here I posted all the changes to my firmware: https://forum.v1e.com/t/firmware-uncertainties/13919/15