I need to step down 24V to 5V in one of my projects, so I used TPS54302DDCR (has a maximum input voltage of 28V) by TI and designed the circuit according to its datasheet and example schematic. However when it has been powered up, it will either work, or it will burst into flame. However I tried powering at 12V and it had no problem at all. So I wonder if it is because the input voltage rippled when powering up and exceeds the maximum input of the buck converter, resulting in an internal breakdown that created a short, so it burns? Does a big capacitor on the input side solve this problem? Is there a recommended value? Or I need to add some more components? Here is the circuit I am using:
EDIT: Here is the image of the board layout (I already added a 470uF cap on the input side), I tried my best to stick to the layout recommendation from the datasheet.