USB Attach/Detach Problem

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

USB Attach/Detach Problem

656 Views
ericd
Contributor I

Hi all,

 

I'm using the MCF51JM128. have two sections of code that run independently.  Each section is created as a different CW project using Processor Expert.  The first code section is a bootloader that reads from a USB thumbdrive and re-flashes the second main application section.  This bootloader uses the USB host stack. I jump from one section to another at the "_startup" address to supposedly initialize everything appropriately.

 

Normally, after a hard power cycle, the bootloader runs first and checks to see if a re-flashing is required.  If no re-flashing is required, it will immediately jump to the main application section. Within the main application I do not use the USB stack. I only monitor the USB attach bit in the INT_STAT register via the interrupt to determine if the user has inserted or removed a thumbdrive to bring up a "software update screen".  In this scenario, the attach/detach detection works fine.

 

The problem arises when the bootloader does a re-flashing and then jumps to the main application.  In this scenario, I continually get an attach event interrupt with or without a thumbdrive inserted (I do clear the interrupt by writting to the INT_STAT register each time). 

 

--Eric

Labels (1)
0 Kudos
2 Replies

436 Views
TomE
Specialist II

Can you have the boot reflash and then tell the user to remove the USB stick? Then the boot should be reset the CPU, resulting in a normal boot.  Problem not solved, but avoided.

Tom

0 Kudos

436 Views
miduo
NXP Employee
NXP Employee

Hi, Eric

I am not quite understand what your mean the "re-flashing". What the main difference operation between them?

Best Regards,

Fang

0 Kudos