I read the AN4370.pdf for DFU boot-loader. When I read the code, I notice that there is a Swicth_mode() function. In this function, there is a variable called temp, but I did not find which function change this variable. My question is how does the bootloader achieve switching from bootloader to main application in this code. And when does it check if there is valid main application in flash?