There are various loaders for the K82 at the link below and full code showing how all of these details are done is in the uTasker project on Git Hub - including simulation of the process.See the appendix in the serial loader document for a check list of things to consider to ensure application's boot loader compatibility.