This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Sharing variable (struct) in Bootloader with Application

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

I declared #pragma NOINIT for disable initialization or clearing the struct. But if i read out the content of the struct in the bootloader, the values are not correct. What could cause this error?

Parents
  • 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

Reply
  • 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

Children
No data