Hello,
I am making a firmware update in flash memory of MPC5748G, and I am writing in a different sector a new startup code, text code, etc. I want to modify the BAF configuration so after a reset it will start from the new sector and not from the old one. What registers should I modify for that?
Thanks,
Vlad
已解决! 转到解答。
Hi,
this is copied from reference manual:
So, it is necessary to place a constant to one of addresses shown above. Something like this:
#pragma ghs section rodata=".boot_header"
const uint32_t bootheader = 0x005A0002; // e200z4a will start execution
const uint32_t z2_reset_vector = 0;
const uint32_t cnfg1_bits = 0;
const uint32_t cnfg2_bits = 0;
const uint32_t startAddress = (uint32_t) _start; //start address of e200z4a
const uint32_t z4b_reset_vector = 0;
const uint32_t reserved_for_future_use = 0;
#pragma ghs section rodata=default
If there are more valid boot headers, the first one is used. If you want to make other boot header active, it is necessary either erase the previous one or jump to specified start address of second application by your software.
Regards,
Lukas
Hi,
this is copied from reference manual:
So, it is necessary to place a constant to one of addresses shown above. Something like this:
#pragma ghs section rodata=".boot_header"
const uint32_t bootheader = 0x005A0002; // e200z4a will start execution
const uint32_t z2_reset_vector = 0;
const uint32_t cnfg1_bits = 0;
const uint32_t cnfg2_bits = 0;
const uint32_t startAddress = (uint32_t) _start; //start address of e200z4a
const uint32_t z4b_reset_vector = 0;
const uint32_t reserved_for_future_use = 0;
#pragma ghs section rodata=default
If there are more valid boot headers, the first one is used. If you want to make other boot header active, it is necessary either erase the previous one or jump to specified start address of second application by your software.
Regards,
Lukas