AnsweredAssumed Answered

MPC5634M bootloader startup issue

Question asked by Shankar Selvam on Jul 19, 2018

Hello David Tosenovjan and Lukas Zadrapa,

 


I am working on MPC5634M developing CAN UDS based flash bootloader and application.
I have bootloader located at bank 0 and application located at bank1 array 0. I am able to boot up bootloader using BAM rchw located at 0x00000000, reflash the application sector at bank1 array 0. But the problem is when bootloader detects valid application and jumps to _startup() of application code at 0x00080100 and does the start up routine of initialising RAM, it falls through and invokes core exception of IVOR6 for program interrupt.

 

I have investigated little further and found that SRR0 value is 0xFFFFC000, SRR1 value is 0x02003000 and ESR value is 0x80000020(PIL)

 

details of toolchain: CW MCU v11.0 IDE, P&E USB NEXUS debugger.
_start routine in both bootloader and application are used from here C:\Freescale\CW MCU v11.0\MCU\PA_Support\ewl\EWL_Runtime\Runtime_PA\Source.

 

Bootloader LCF:

resetvector: org = 0x00000000, len = 0x00000010
init: org = 0x00000010, len = 0x00000FF0 /* */
exception_handlers: org = 0x00010000, len = 0x0001000 /* */
internal_flash: org = 0x00030000, len = 0x0001FFFF /* */

 

/* SRAM: 0x40000000 - 0x400177FF */
internal_ram: org = 0x40000000, len = 0x0000F700 
heap: org = 0x4000F700, len = 0x00004000 /* Heap */
stack: org = 0x40013700, len = 0x00004000 /* Stack */
NINT: org = 0x40017700, len = 0x00000100 /* non-initialised RAM */

 

Application LCF:

resetvector: org = 0x00080000, len = 0x00000010
init: org = 0x00080010, len = 0x0000FF0 /* */
APPL_HEADER : org = 0x00081000, len = 0x00001000
exception_handlers: org = 0x00082000, len = 0x00001000 /* */
internal_flash: org = 0x00083000, len = 0x0007BFFF /*  */
Appln_area: org = 0x0017FFE0, len = 0x00000020

 

/* SRAM: 0x40000000 - 0x400177FF */
internal_ram: org = 0x40000000, len = 0x0000F700 /* */
heap: org = 0x4000F700, len = 0x00004000 /* Heap */
stack: org = 0x40013700, len = 0x00004000 /* Stack */
NINT: org = 0x40017700, len = 0x00000100 /* non-initialised RAM */

 

Note: I am using default CW linker initialisation of RAM.

/* Freescale CodeWarrior compiler address designations */

_stack_addr = ADDR(stack)+SIZEOF(stack);
_stack_end = ADDR(stack);
_heap_addr = ADDR(heap);
_heap_end = ADDR(heap)+SIZEOF(heap);

/* If INTC HW mode is used it represents the vector base address to set
IVPR and the location of intc_hw_branch_table section. The EXCEPTION_HANDLERS
will point to the IVOR branch table.
*/
__IVPR_VALUE = ADDR(exception_handlers);

/* IVOR branch table location. Used in Exceptions.c */
EXCEPTION_HANDLERS = ADDR(.ivor_branch_table);

/* L2 SRAM Location (used for L2 SRAM initialization) */
L2SRAM_LOCATION = ADDR(internal_ram);

/* How many writes with stmw, 128 bytes each, are needed to cover
the whole L2SRAM (used for L2 SRAM initialization) */
L2SRAM_CNT = 0x17700 / 128;

 

Any help of sorts is much appreciated. 

 

Many thanks in advance.

 

Regards,

Shankar.

Outcomes