I figured out some stuff since I burned up my power MOSFET last time. Stuff like: "Read the datasheet more carefully dummy"! :)
The SSM3J332R datasheet has the following graph in it:
This makes it obvious that current capability of the MOSFET is seriously reduced at higher VDS. The graph shows lines for pulse lengths but I'm not sure how repeated pulses play into this. To be safe, I'm just scaling the DC line value by the duty cycle. At 20V, that means the SSM3J332R is only rated for... about 260mA with 15% duty cycle. No wonder it burned up!
So, need to find a better MOSFET. Unfortunately that means more expensive as well. I stumbled across the AON7408, which is a significant step up and still low cost. Unfortunately it's in a DFN package, and I prefer leaded packages. But since my quest to replace the TPS61236P boost converter didn't turn up any good alternatives, I already am stuck with one DFN anyway so I might as well add another one. On the upside, there seem to be many MOSFETs available in this package so if the AON7408 doesn't work out it should be easy to find an alternative in the same footprint.
Here is the same safe operating area graph for the AON7408:
In the same conditions at 20V with 15% duty cycle, the AON7408 should be able to deal with 4A. A significant improvement, and the MOSFET fits in the same area as the original one.
This also makes me wonder if some of the heat at 20V, 2A I saw in the previous project log near the Schottky diode was actually the MOSFET starting to burn up. The resolving power of the thermal camera is just not good enough to tell where exactly the heat comes from if two components are close together. Hopefully, the overall power dissipation and heat in the system will go down with this change, since the MOSFET has significantly lower RdsON as well.
On the software side, I have finally implemented code for the 32 kHz crystal and RTC functions. It's pretty cool to see the Pi wake up at an exact time. :) I need to do some more testing, but I've started work on the next PCB revision and have started some volume component orders. Exciting! :)