akash ganjare

Page switching between FLASH and RAM concept of xcp.

Discussion created by akash ganjare on Jan 11, 2018

hi, i am using autosar 4.0.2 "XCP protocol". currently i want to use page switching concept i.e. if i send command(0xEB) via xcp pdu i should able to switch page from ram to flash and from flash to ram.


1 page access is given to XCP master on which parameter calibration will be performed and 2nd page access will be given to ECU(MPC5744P) on which current execution will be running.

basic concept is i want to modify (online calibration) RAM parameter and after my calibration is over i want to switch back page to my flash stored parameter without reset by XCP command.


please refer page no 61(1.5.1 Memory Page Switching ) from below pdf for more details related to page switching concept:




for this supplementation vector has given below to application api where we need to implement the switching mechanism.


1)FUNC(uint8, XCP_CODE) XcpAppl_SetCalPage( uint8 Segment, uint8 Page, uint8 Mode )()

2) FUNC(uint8, XCP_CODE) XcpAppl_GetCalPage( uint8 Segment, uint8 Mode )()


my linker file configuration:

    /* 5744P - Flash 2.0 MB - 0x01000000 - 0x011FFFFF */
    flash_rsvd1         : ORIGIN = 0x01000000, LENGTH = 0x20
    flash_memory        : ORIGIN = 0x01000020, LENGTH = 0x1EFFE0
    flash_vec           : ORIGIN = 0x011F0000, LENGTH = 0x10000
    flash_rsvd2         : ORIGIN = 0x01200000, LENGTH = 0


    /* 5744P - SRAM 384 KB : 0x40000000 - 0x4005FFFF */
    ram_rsvd1           : ORIGIN = 0x20000000, LENGTH = 0
    int_sram            : ORIGIN = 0x40000000, LENGTH = 0x40B60
    res_ram             : ORIGIN = 0x40040B60, LENGTH = 0x60
    iram_stack          : ORIGIN = 0x40040BC0, LENGTH = 0x1000
    int_timers          : ORIGIN = 0x40041BC0, LENGTH = 0x0340
    int_results         : ORIGIN = 0x40041F00, LENGTH = 0x0100
    int_sram_no_cacheable : ORIGIN = 0x40042000, LENGTH = 0x1E000
    ram_rsvd2             : ORIGIN = 0x40060000, LENGTH = 0


Please let me know:


1) how i can switch pages from flash to ram and vice versa.

2) what SFR should i use to perform this action along with flow.

3) how i get know segment and page address of flash and RAM.

4) can i write RAM parameter page to flash after calibration? how ?

5) which pre-condition should i consider for this page switching thank you for your support in advance.