USB Attach/Detach Problem

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

USB Attach/Detach Problem

1,216 次查看
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

标签 (1)
标记 (3)
0 项奖励
回复
2 回复数

996 次查看
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 项奖励
回复

996 次查看
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 项奖励
回复