AnsweredAssumed Answered

USB not working after cpu reset.

Question asked by Vincent Gagliardo on Apr 9, 2013
Latest reply on Apr 11, 2013 by Vincent Gagliardo

Device: mcf52258

RTOS: MQX 3.8.1

 

Operation for bootloader (bare metal) is as follows:

1) USB is working and responding fine.

2) reset cpu as shown in snippit A below.  STACK_POINTER = 0x0000, START_ADDRESS = 0x0004

3) bootloader restarts and usb works fine.

 

Operation for main application (using MQX RTOS) is as follows:

1) USB is working and responding fine.

2) Disable interrupts with _int_disable() and then execute code snippit A. STACK_POINTER = 0x9000, START_ADDRESS = 0x9004

3) Main application restarts.  Heartbeat LED and serial comm indicate it is running.  However, usb driver is non-responsive.

 

As I step through the code, I can see code where I execute the Data 0/1 toggle for my IN endpoint.  Using my usb bus tools, I can see that the usb bus is non-responsive.  Any idea what is going on here?

 

 

 

Code Snippet A

   //Disable USB interrupts

  MCF_USB_OTG_ERR_ENB = 0x00;  //disable usb error interrupts

  MCF_USB_OTG_INT_ENB = 0x00; //disable usb token interrupts

  MCF_INTC0_IMRH |= MCF_INTC_INTFRCH_INTFRC53; //Mask USB interrupt

 

  asm(move.w #0x2700,sr); //disable interrupts

 

  size_1 = *((unsigned long int *)(STACK_POINTER));   // get the stack pointer from flash

  size_2 = *((unsigned long int *)(START_ADDRESS));   // get the jump to startup address from flash

 

  // start moduleware execution - this sequence is identical to the ROM boot sequence for the processor

  asm

  {

  move.l size_1, A7;   // load stack pointer

  move.l size_2, A0;

  jmp (A0);            // jump to moduleware     

  }

 

Outcomes