He allegedly met his maker while relieving himself - having made a nuisance of himself to the Habsburgs, they laid siege to the castle to no avail -as there was a hidden passageway which let the besieged come and go more or less as they pleased.
The solution? Bribe a servant into lighting a lamp in a window when Erasmus went to the latrine prior to bed - a latrine the Habsburgs had aimed their cannon at in the daytime.
The rest, as they say, is (apocryphal) history.