AnsweredAssumed Answered

Default state of CPU HCS12 XEP100 and Processor Expert

Question asked by Grzegorz Konopko on Mar 5, 2013
Latest reply on Apr 3, 2013 by Grzegorz Konopko



I have one problem:

HW: HCS12X (XEP100), CodeWarrior + PE


I have written firmware bootloader in order to download and later on upgrade application.


case 1:

When I start application without bootloader (just flash application) than everythink works well.


case 2:

When I first flash bootloader, than using bootloader will download application, than strange think happen:

periodic IRQ from one timer is not working with desired period but much, much less (50 times?). It is quite strange because all application works well beside this IRQ. Application call ISR of this timer what is proof IRQ vector is OK, it is different IRQ offset from bootloader (is set in cpu.c), what I have tested but is called with other period.



- Both: bootloader and application use Processor Expert.

- bootloader start first and after all itself initialization call _EntryPoint() of application, so I expect _EntryPoint() will do all initialization work and all timers and PLL settings should works as without bootloader (see case 1).

- the only difference between application from case 1 and case 2 is address of _ResetVectorTable[] (from vectors.c generated by PE) due vectors from application and bootloader should not overlap.


So from my testing I suspect that something is wrong with CPU and/or peripheral (PLL? clock division?) state after initialization in case 2!

1. So my question is: How to secure default CPU state when call application under bootloader (both using Processor Expert for initialization).

In other words I suspect that

a) hardware or software reset and start from _EntryPoint() of bootloader than call _EntryPoint() of application

  is not equivalent of:

b) hardware or software reset and than start from _EntryPoint() of application.

2. Any other suspect in this problem?


Best Regards