I am wanted to write a bootloader. If an application is already programmed, it transfers control to the bootloader with an interrupt call (_trap_0x7F). The bootloader needs several informations form the application (ECU-adress,...). This informations are hold in a struct, which is located at the same adress in the application and the bootloader.
#include <Schnittstelle.H> #pragma NOINIT struct SchnittstellenDefinition volatile far Schnittstelle; #pragma INIT
Yes! It is an automitive application. The application communicates with an extern tester via a serial port. At powerup first the bootloader executes. When a legal application was already programmed, the bootloader switch to the application. When there is no application, the bootloader runs and communicates with the tester. When the tester sends a special message, the bootloader must start, clear the flash (the old appplication) and then programm the new application sended by the tester. Sharing interrupts is not the problem. It already works. But the boot loader needs some informations from the application. This informations are hold in an struct which is not initilized by the bootloader. The bootloader should started from the application by calling a software interrupt. Because of that, the Start167.A66 of the bootloader is not executed. I must manualy set the things i need (DPP0,...). Could this be the problem? (Maybe this could help you: I set a special value in ram (with MVAR) before calling the bootloader. The bootloader not allocate this adress and didn't clear it. I try to read out the written value in the bootloader. It's value has changed!) Please excused my bad english!
Did you declare the shared struct as near, which is the default memory type in small memory model? In that case the actual memory location where the struct is stored would depend on DPPs. I suggest declaring the struct as huge, in which case the compiler would not rely on DPPs when accessing the struct. - mike