Discussion in "ARM Development" started by    Vito    May 14, 2009.
Thu May 14 2009, 04:34 pm
#1
Hi All, i am a newcomer (and newbie).
I will already explain my question.

I am working on a Host driver for Max3421 on a Lpc2148 based card.
I am using the Maxim usb laboratory source.
My problem is that when the source issues the reset_host() function that should reset the USB Host, happens the following:

1. It reset the lpc2148 too.
Once the microprocessor restarts:
2. the second time it does reset_host it doesn't reset the LPC2148 but it locks in a while controlling when the PLL will become stable, and never exits from there....

any idea why this could be happening ?
i was thinking that the problem could be the SPI reading... but i am not sure...
i'm too noob to know.
Thanks in advance.

Bye

Vito
Thu May 14 2009, 05:20 pm
#2
can u post the code in zip, I have not seen the Maxim codes yet.

are you using polling based SPI or what?
Thu May 14 2009, 05:51 pm
#3
Ok that is the source in the zip...
But i discovered another thing.... Is just the USB process that restarts microcontroller... and not Host_restart()...
but the point 2) is still valid: it blocks in that while after the restart....
Thu May 14 2009, 05:52 pm
#4
p.s.

I ask my apologies for the source is in a very messed manner....
but you know... it's a consequence of a 'fast modify job'
thank you
Thu May 14 2009, 05:54 pm
#5
P.P.S.

Ops.... apologies again.... the first row of Reset_Host() is commented... but that was a guess....
in the official code... it's enabled.... nothing changes for me btw...
Thu May 14 2009, 06:50 pm
#6
i downloaded USB code from Maxim site too.. as per shown in block diagram, it should only reset the Host controller not the micro itself. well i need to take a close look on the code. are you trying to monitor it somehow?
Thu May 14 2009, 07:09 pm
#7
well i'm just doing some debugging stuff with text of uart0puts();

i tried to comment the Reset_Host()... i guess if that call is necessary... and that way it goes on...
but... i discovered that it's not that Reset_Host() that resets the microcontroller...
i putted a wait_ms(300) to the beginning of the vUsbTask() function... and now it does not resets anymore the microcontroller...!!
it blocks the same in the while() in the Host_Reset();
i got to come until he prints "waiting for a device".... but obviously nothing happens....

now i have 2 guess... ::
1) i'm not communicating well by the SPI
2) i'm not doing well with IRQs that the Host needs to read via the SPI

i'd like to have a your opinion..

thanks alot


[ Edited Thu May 14 2009, 07:11 pm ]
Thu May 14 2009, 07:10 pm
#8
i wonder if that reset_host() is necessary......


[ Edited Thu May 14 2009, 07:12 pm ]
Thu May 14 2009, 07:18 pm
#9
well according to USB documentation in USB2.0
only first reset is necessary which is just after u plugin the device.

after host send the GET_DESCRIPTOR command to slave, it is not required to send reset after that. but its generally recommended to do that.

after that host sets address of the slave connected.
Thu May 14 2009, 07:23 pm
#10
uhm.... so... the first call to the reset_host should be there.....i guess..

the truth is that the critical block in that function is just this:

while(!(Host_SPI_Read(rUSBIRQ) & bmOSCOKIRQ)) {};

from that locked while i was doubting that i'm not doing well the stuff with SPI or IRQs.....
or twice the things


[ Edited Thu May 14 2009, 07:27 pm ]

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

AngeloFoown
Sat Apr 13 2024, 12:17 pm
JamesLex
Sat Apr 13 2024, 05:23 am
RobertWah
Fri Apr 12 2024, 08:01 pm
solar_qcor
Fri Apr 12 2024, 08:38 am
Rosalvascuth
Thu Apr 11 2024, 06:07 am
WilliamAmazy
Wed Apr 10 2024, 10:13 pm
slm_pkPn
Wed Apr 10 2024, 08:43 pm
LaurenBramn
Wed Apr 10 2024, 02:08 pm