Problem with USB bootloader application and PE..

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem with USB bootloader application and PE..

Jump to solution
1,549 Views
yomioye2006
Contributor I

Hi,

       I have attached a boot loader application  created without PE and an application created with PE.. I'm lost for what to do to make this boot loader work well with an application created with PE.. This boot loader has been verified to work well with a project created without PE. I've copied the linker file and applied it to the PE project but still won't work. I've attached all projects.  I did'not create the boot loader and no_PE applications so my knowledge of boot loaders is limited to what I read from the ANSI 3748 document.

 

1.  du_vfd.zip is the application created with processor expert

 

2.  no_pE is the application created without Processor expert. It works with bootloader

 

3.  SX01896-A00 is the bootloader application.   

 

Can someone with a lot more experience look at these an tell me what I'm not doing right or need to do? my processor is Coldfire V1 MCF51JM128  using code warrior 10.6 with PE. Thanks .

Original Attachment has been moved to: du_vfd.zip

Original Attachment has been moved to: SX01896-A00.zip

Original Attachment has been moved to: no_pE.zip

Labels (1)
0 Kudos
1 Solution
1,174 Views
DavidS
NXP Employee
NXP Employee

Hi Yomi,

The only other suggestion that comes to mind is making sure the vector table gets copied to SRAM and the VBR then points to that SRAM location.

Can you not use the debugger to see where the code crashes?

In the past I have set breakpoints in my bootloader and step through code to see flash erase, see the file is valid, see flash getting programmed, and finally seeing what values the code will use for PC and Stack Pointer before jumping to the new PC location.

Regards,

David

View solution in original post

0 Kudos
6 Replies
1,174 Views
DavidS
NXP Employee
NXP Employee

Hi Yomi,

I only had short time to look at your issue.

I looked at the Xmap and s-record files for the PE and non-PE projects.

It looks to me that the PE based project does not have the vector table in the correct location.

Hopefully this will be helpful enough clue to resolve your issue.

Regards,

David

0 Kudos
1,174 Views
yomioye2006
Contributor I

David,

        Thanks for looking at my issue. Can you please suggest a way for me to fix this? I tried moving the vectors to no avail using processor expert move vector to 0x00800000 ram address. It always end up generating a asm or mcf exception or in one instance my application runs once but on power cycle would not run again and I would have to power cycle to re program it.

0 Kudos
1,174 Views
DavidS
NXP Employee
NXP Employee

Hi Yomi,

Please update your Vectors.c (i.e. @0x00000000 to 0x0000d000) as follows and see if this resolves your issue.

File attached too.

const tIsrFunc _InterruptVectorTable[111] @0x0000d000 = { /* Interrupt vector table */

  /* ISR name No. Address  Lvl Pri Name Description */

  (tIsrFunc)_SP_INIT,  /* 0x00 0x00000000 - - ivINITSP used by PE */

  _startup,  /* 0x01 0x00000004 - - ivINITPC used by PE */

Regards,

David

0 Kudos
1,174 Views
yomioye2006
Contributor I

David,

         This moved the vectors from 0x00000000 to 0x0000d000 in flash and but the issues still persist. I'm still unable to flash my program using the bootloader and also my board fails to come alive if i turn off power and I'd have to power cycle to be able to re flash it with PE Micro MultiLink. What else does one have to do beside configuring vectors and properly setting the linker files to  use the mcf51jm128 bootloader application?

0 Kudos
1,175 Views
DavidS
NXP Employee
NXP Employee

Hi Yomi,

The only other suggestion that comes to mind is making sure the vector table gets copied to SRAM and the VBR then points to that SRAM location.

Can you not use the debugger to see where the code crashes?

In the past I have set breakpoints in my bootloader and step through code to see flash erase, see the file is valid, see flash getting programmed, and finally seeing what values the code will use for PC and Stack Pointer before jumping to the new PC location.

Regards,

David

0 Kudos
1,174 Views
yomioye2006
Contributor I

Hi David,

     I used the below code to copy the vector table to the SRAM

void move_vect_table(void)

{

          int i;

   // PCP 13-011: Copy vector table to RAM 

   dword *pdst;

   dword *psrc;

   pdst=(dword*)0x00800000;

   psrc=(dword*)APP_FLASH;

   for (i=0;i<111;i++)

   {

  *pdst++ = *psrc++;

   }

   // Write new base address

   asm (move.l #0x00800000,d0);

   asm (movec d0,vbr);

}

APP_FLASH is defined

#if (defined __DEBUG__)

  #define APP_FLASH 0x00011000              //APP_FLASH 0x00011000

#else

  #define APP_FLASH 0x0000D000              //APP_FLASH 0x0000D000

#endif

In Excettions .c, I have

__declspec(weak) vectorTableEntryType vector_0   @(APP_FLASH+INITSP) = (vectorTableEntryType)   &_SP_INIT;

__declspec(weak) vectorTableEntryType vector_1   @(APP_FLASH+INITPC) = (vectorTableEntryType)   &_startup;

__declspec(weak) vectorTableEntryType vector_2   @(APP_FLASH+Vaccerr) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_3   @(APP_FLASH+Vadderr) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_4   @(APP_FLASH+Viinstr) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_5   @(APP_FLASH+VReserved5) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_6   @(APP_FLASH+VReserved6) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_7   @(APP_FLASH+VReserved7) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_8   @(APP_FLASH+Vprviol) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_9   @(APP_FLASH+Vtrace) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_10  @(APP_FLASH+Vunilaop) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_11  @(APP_FLASH+Vunilfop) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_12  @(APP_FLASH+Vdbgi) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_13  @(APP_FLASH+VReserved13) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_14  @(APP_FLASH+Vferror) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_15  @(APP_FLASH+VReserved15) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_16  @(APP_FLASH+VReserved16) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_17  @(APP_FLASH+VReserved17) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_18  @(APP_FLASH+VReserved18) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_19  @(APP_FLASH+VReserved19) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_20  @(APP_FLASH+VReserved20) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_21  @(APP_FLASH+VReserved21) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_22  @(APP_FLASH+VReserved22) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_23  @(APP_FLASH+VReserved23) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_24  @(APP_FLASH+Vspuri) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_25  @(APP_FLASH+VReserved25) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_26  @(APP_FLASH+VReserved26) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_27  @(APP_FLASH+VReserved27) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_28  @(APP_FLASH+VReserved28) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_29  @(APP_FLASH+VReserved29) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_30  @(APP_FLASH+VReserved30) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_31  @(APP_FLASH+VReserved31) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_32  @(APP_FLASH+Vtrap0) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_33  @(APP_FLASH+Vtrap1) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_34  @(APP_FLASH+Vtrap2) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_35  @(APP_FLASH+Vtrap3) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_36  @(APP_FLASH+Vtrap4) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_37  @(APP_FLASH+Vtrap5) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_38  @(APP_FLASH+Vtrap6) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_39  @(APP_FLASH+Vtrap7) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_40  @(APP_FLASH+Vtrap8) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_41  @(APP_FLASH+Vtrap9) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_42  @(APP_FLASH+Vtrap10) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_43  @(APP_FLASH+Vtrap11) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_44  @(APP_FLASH+Vtrap12) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_45  @(APP_FLASH+Vtrap13) = asm_exception_handler;

  #if CONSOLE_IO_SUPPORT == 1

  __declspec(weak) vectorTableEntryType vector_46 @(APP_FLASH+Vtrap14)     = TrapHandler_printf;

  #else

  __declspec(weak) vectorTableEntryType vector_46 @(APP_FLASH+Vtrap14)     = asm_exception_handler;

  #endif

__declspec(weak) vectorTableEntryType vector_47  @(APP_FLASH+Vtrap15) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_48  @(APP_FLASH+VReserved48) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_49  @(APP_FLASH+VReserved49) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_50  @(APP_FLASH+VReserved50) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_51  @(APP_FLASH+VReserved51) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_52  @(APP_FLASH+VReserved52) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_53  @(APP_FLASH+VReserved53) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_54  @(APP_FLASH+VReserved54) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_55  @(APP_FLASH+VReserved55) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_56  @(APP_FLASH+VReserved56) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_57  @(APP_FLASH+VReserved57) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_58  @(APP_FLASH+VReserved58) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_59  @(APP_FLASH+VReserved59) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_60  @(APP_FLASH+VReserved60) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_61  @(APP_FLASH+Vunsinstr) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_62  @(APP_FLASH+VReserved62) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_63  @(APP_FLASH+VReserved63) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_64  @(APP_FLASH+Virq) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_65  @(APP_FLASH+Vlvd) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_66  @(APP_FLASH+Vlol) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_67  @(APP_FLASH+Vspi1) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_68  @(APP_FLASH+Vspi2) = asm_exception_handler;

// PCP13-011: __declspec(weak) vectorTableEntryType vector_69  @(APP_FLASH+Vusb) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_69  @(APP_FLASH+Vusb) = (vectorTableEntryType)      &UsbISR;

__declspec(weak) vectorTableEntryType vector_70  @(APP_FLASH+VReserved70) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_71  @(APP_FLASH+Vtpm1ch0) = (vectorTableEntryType)  &FC1_Interrupt ;         //added &FC1_Interrupt

__declspec(weak) vectorTableEntryType vector_72  @(APP_FLASH+Vtpm1ch1) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_73  @(APP_FLASH+Vtpm1ch2) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_74  @(APP_FLASH+Vtpm1ch3) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_75  @(APP_FLASH+Vtpm1ch4) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_76  @(APP_FLASH+Vtpm1ch5) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_77  @(APP_FLASH+Vtpm1ovf) = (vectorTableEntryType)  &Cpu_ivVtpm2ovf;        //added

__declspec(weak) vectorTableEntryType vector_78  @(APP_FLASH+Vtpm2ch0) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_79  @(APP_FLASH+Vtpm2ch1) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_80  @(APP_FLASH+Vtpm2ovf) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_81  @(APP_FLASH+Vsci1err) =  (vectorTableEntryType) &AS1_InterruptError;    //added

__declspec(weak) vectorTableEntryType vector_82  @(APP_FLASH+Vsci1rx) =   (vectorTableEntryType) &AS1_InterruptRx;       //added

__declspec(weak) vectorTableEntryType vector_83  @(APP_FLASH+Vsci1tx) = (vectorTableEntryType)   &AS1_InterruptTx;       //added

__declspec(weak) vectorTableEntryType vector_84  @(APP_FLASH+Vsci2err) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_85  @(APP_FLASH+Vsci2rx) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_86  @(APP_FLASH+Vsci2tx) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_87  @(APP_FLASH+Vkeyboard) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_88  @(APP_FLASH+Vadc) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_89  @(APP_FLASH+Vacmpx) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_90  @(APP_FLASH+Viic1x) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_91  @(APP_FLASH+Vrtc) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_92  @(APP_FLASH+Viic2x) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_93  @(APP_FLASH+Vcmt) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_94  @(APP_FLASH+Vcanwu) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_95  @(APP_FLASH+Vcanerr) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_96  @(APP_FLASH+Vcanrx) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_97  @(APP_FLASH+Vcantx) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_98  @(APP_FLASH+Vrnga) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_99  @(APP_FLASH+VReserved99) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_100 @(APP_FLASH+VReserved100) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_101 @(APP_FLASH+VReserved101) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_102 @(APP_FLASH+VReserved102) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_103 @(APP_FLASH+VReserved103) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_104 @(APP_FLASH+VL7swi) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_105 @(APP_FLASH+VL6swi) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_106 @(APP_FLASH+VL5swi) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_107 @(APP_FLASH+VL4swi) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_108 @(APP_FLASH+VL3swi) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_109 @(APP_FLASH+VL2swi) = asm_exception_handler;

__declspec(weak) vectorTableEntryType vector_110 @(APP_FLASH+VL1swi) = asm_exception_handler;

Still can't get the Vbr to point to right location. Do you have any suggestions to get this application to flash correctly? Is there something in the startup code or initialization of PE that impedes proper flashing? I can't seem to locate anything and I'm not very good with debugging pointers at this stage. Thanks.

0 Kudos