CW10.0 - MQX3.6 - MCF51JM128 device doesn't run without ML-Universal adapter connected

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

CW10.0 - MQX3.6 - MCF51JM128 device doesn't run without ML-Universal adapter connected

Jump to solution
670 Views
ARQuattr
Contributor IV

   I'm using a P&E Micro USB Multilink Universal programmer and I have no issues flashing, debugging, and running the program as long as the programmer is connected, but the program doesn't run otherwise if I use any _time_delay calls.  If I get the code running and then disconnect the programmer it continues running, but if cycle power or reset it, the program stops.  I have 10k pull-ups on the BKGD and RESET lines, and the oscillator runs normally, but as I found out, whenever it reaches a _time_delay() function call, it stalls. 

   What I have is a custom board based on the EVB51JM128 reference design, and I created a new MQX3.6 project using that EVB in CW10.0.  I rebuilt the BSP and PSP but it didn't help.  I don't see any MQX or compiler options that would seem to me to affect this.

 

   Are there any suggestions as to what I might try here?

 

Thank you

 

PS.  I originally posted about this in the Coldfire forum as I thought it was a hardware issue, but I beleive now it's related to MQX.  Here's my original post:  https://community.freescale.com/thread/83762

 

 

0 Kudos
1 Solution
424 Views
petr_uhlir
NXP Employee
NXP Employee

This bug was fixed in 3.6.1 release. The issue was caused by incorrect settings of INTC.WCR register which differs from other CFV1 platforms. Replace mcf51JMxx_init() function in "mqx/source/bsp/m51jmevb/bsp_init.c" by the following one and it should work.

 

void mcf51JMxx_init
   (
      void
   )
{
  VMCF51JM_STRUCT_PTR reg_ptr = (VMCF51JM_STRUCT_PTR)BSP_IPSBAR;
  reg_ptr->SIM.SOPT1 = MCF51XX_SOPT1_STOPE_MASK | MCF51XX_SOPT1_WAITE_MASK;
  
  reg_ptr->SIM.SOPT2 = 0;
  reg_ptr->PMC.SPMSC1 = 0x40;
  reg_ptr->PMC.SPMSC2 = 0;
  /* INTC_WCR: ENB=1,MASK=0 */
  reg_ptr->INTC.WCR = 0x80;
  _mqx_clock_init_12MHz();   
}

 

View solution in original post

0 Kudos
2 Replies
425 Views
petr_uhlir
NXP Employee
NXP Employee

This bug was fixed in 3.6.1 release. The issue was caused by incorrect settings of INTC.WCR register which differs from other CFV1 platforms. Replace mcf51JMxx_init() function in "mqx/source/bsp/m51jmevb/bsp_init.c" by the following one and it should work.

 

void mcf51JMxx_init
   (
      void
   )
{
  VMCF51JM_STRUCT_PTR reg_ptr = (VMCF51JM_STRUCT_PTR)BSP_IPSBAR;
  reg_ptr->SIM.SOPT1 = MCF51XX_SOPT1_STOPE_MASK | MCF51XX_SOPT1_WAITE_MASK;
  
  reg_ptr->SIM.SOPT2 = 0;
  reg_ptr->PMC.SPMSC1 = 0x40;
  reg_ptr->PMC.SPMSC2 = 0;
  /* INTC_WCR: ENB=1,MASK=0 */
  reg_ptr->INTC.WCR = 0x80;
  _mqx_clock_init_12MHz();   
}

 

0 Kudos
424 Views
ARQuattr
Contributor IV

Thank you for this information.  It wasn't quite that simple; I needed to install the full 3.6.2, which was painful, but that fixed it.


I first added the reg_ptr->INTC.WCR = 0x80; line, but the INTC struct wasn't defined in mcf51JM.h.  So I tried updating that file, but it still wasn't working.  I installed 3.6.2 and rebuilt the new bsp and psp projects, then the application project, but that was worse (the debugger kept stalling in _int_kernel_isr in dispatch.s).  So I created a new MQX project and imported the source files and finally I got it all to work as expected. 

 

I'm not sure if this is normal (that I can't rebuild a project started with an older version of MQX after upgrading).

 

I also noticed that the bsp shows several files that are missing from the original (3.6.0) locations including maximum_config.h, small_ram_config.h, smallest_config.h, etc.  In the 3.6.0 directory structure they appeared in ...\mqx\build folder, but they are not in the new structure (as reported by CW).  They do still appear in the lib folders for the respective platforms.  Is this normal that these files are included in the bsp project but aren't actually there?  Should I just remove them or do I need to do something else?

 

Thanks again for your help.

 




0 Kudos