Crystal value for LPC546xx USB ISP bootloader

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

Crystal value for LPC546xx USB ISP bootloader

Jump to solution
2,853 Views
guanix
Contributor II

On a custom board using LPC54605J512, we would like to use the ISP pins to have the option of invoking the USB1 MSC or DFU bootloader from a blank chip, without any code already loaded into flash.

My question is: Are there any restrictions on the crystal used in order to use a USB bootloader in this way? Does the USB ROM bootloader assume a fixed crystal value, or does it automatically measure the crystal value using the frequency measurement function and configure the USB PLL accordingly?

I can see that the LPC54608 development board uses a 12 MHz crystal, so presumably this value is supported. But I would prefer to use a higher frequency crystal that can be physically smaller, for example 25 MHz.

Labels (1)
1 Solution
2,007 Views
kerryzhou
NXP TechSupport
NXP TechSupport
Hi Guanix,
Sorry for my misleading, after the internal communication with our AE department, I get that:
The on chip Boot ROM assume there is a 12 Mhz Xtal connected, the M4 Core will be clocked from the internal FRO @48MHz,
while the USB1 PHY will be clocked from the clock generated from the 12MHz Xtal & USB PLL.
So, If you want to use USB1 Boot ROM, please use the external 12Mhz crystal.
Our user manual will also update these information.
Thanks a lot for your understanding.
Have a great day,
Kerry
 
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

14 Replies
2,007 Views
guanix
Contributor II

I now have a board that is designed for bootloader operation with USB1 with 12 MHz crystal, and it is not working.

Before going into detailed review of the schematics and other things that could be wrong:

There any simple things I can do in the debugger to see what is going on? For example, is it possible to set a breakpoint inside the ROM code that decides whether to invoke the USB1 bootloader (to see if the problem is wrong ISP pins, or wrong eCRP), or to set later breakpoints to infer that the problem is, e.g., crystal value, or something else?

0 Kudos
2,007 Views
thorstenwilmer
Contributor II

I had a similar situation - but I knew what's wrong. The boot rom is binary, debugging this is not easy. I wouldn't try it.

I'd check if the precondition for USB 1 to work are given.

1 - 12 Mhz crystal works:

Write a small test program, which switches to the external clock. Does this work? 

2 - Check that USB works

Flash a USB example, where USB 1 is used. Does this work?

Most likely the answer here is no, you can now use the PC to see what's wrong.

- did the PC see the device being connected?

If no, something is wrong with the USB data connection, e.g. not connected.

- did the PC see the connection but didn't enumerate

Then the actual communication is broken.

In this case I'd check the power supplies.

Is the reference resistor connected?

0 Kudos
2,008 Views
kerryzhou
NXP TechSupport
NXP TechSupport
Hi Guanix,
Sorry for my misleading, after the internal communication with our AE department, I get that:
The on chip Boot ROM assume there is a 12 Mhz Xtal connected, the M4 Core will be clocked from the internal FRO @48MHz,
while the USB1 PHY will be clocked from the clock generated from the 12MHz Xtal & USB PLL.
So, If you want to use USB1 Boot ROM, please use the external 12Mhz crystal.
Our user manual will also update these information.
Thanks a lot for your understanding.
Have a great day,
Kerry
 
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
2,007 Views
bt_lee
Contributor II

Hi Kerry,

I am Bt. I just saw this thread. and I am confused ...

Please, let me know below ....

1. Full-speed USB0 Boot ROM can run on crystal-less environment (clocked from FRO @48MHz)    Yes/No ?

2. Full-speed USB1 Boot ROM can run on crystal-less environment (clocked from FRO @48MHz)    Yes/No ?

3. Hi-speed USB1 Boot ROM cannot run on crystal-less  //  Required an external 12MHz Crystal.       Yes/No ?

4. Both of USB0 & USB1 Boot ROM cannot.    //   Required an external 12MHz Crystal.           Yes/No ?

    External 12MHz Crystal - It is mandatory for running USB Boot ROM.

0 Kudos
2,007 Views
bt_lee
Contributor II

Is it right ?

USB0 controller ---> Full-speed controller

USB1 controller ---> Hi-speed controller

So,

USB0 support crystal-less operation (only in USB device mode, at reset/power-on, DFU, ISP states)

USB1 always require an external 12MHz crystal for entire operation.

UM10912 Rev2.1 page 9

pastedImage_1.png

0 Kudos
2,007 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi  Bt. Lee,
    USB0 can use the internal FRO,  so it can be crystal-less, include bootloader.
    But USB1 need to use the external 12Mhz crystal.

Wish it helps you!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
2,007 Views
bt_lee
Contributor II

Thank you. 

I understood that

FRO can be used as USB0 clock source (device mode), can't as USB1 clock source.

External XTAL can be used to both of USB0, USB1 clock source.

I had double checked ... p.87 figure.7 in UM10912

pastedImage_2.pngpastedImage_1.png

If so, device with crystal-less USB full-speed device feature....

Is this feature stable enough ?

Is it recommended for mass-production USB full-speed device like as mouse, keyboard, etc. ?

Unless price issue, Is it recommended to use XTAL when considering end-user environments ?

0 Kudos
2,007 Views
bt_lee
Contributor II

I wrote the previous question because of below.

        Errata sheet LPC546xx R1.7 _ section 3.17 (p.15)

pastedImage_1.png

0 Kudos
2,007 Views
carstengroen
Senior Contributor II

Yes.

I have both LPC54608 and LPC54606 boards without any external xtals, and the USB bootloader works just fine (USB0 fullspeed).

The only thing that needs connection for this is power and USB connector :smileyhappy: (and the 3 ISP pins needs to be connected to the right pullup/down externally)

2,007 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi guanix,

   Please check this information from the user manual,

47.jpg

It means you need to get 48Mhz for USB clock input, so when you choose the crystal, you need to check it, whether it can get the 48Mhz.

You can try to calculate it.

If you still have question about it, please let me know!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------

0 Kudos
2,007 Views
guanix
Contributor II

Hi Kerry,

Thank you for your response.

I understand that in normal USB1 device operation, I have to write code that enables a CPU clock source that is at least 60 MHz, and I have to enable the crystal oscillator and configure the USB PLL to run at 48 MHz.

But my understanding is that (from chapter 3 of the manual) if I set ISP-2=0, ISP-1=0, and ISP-0=1 at reset, the chip will invoke a built-in ROM bootloader that allows programming flash as USB1 DFU. My understanding was also that this would work even for a completely blank chip with no program in the flash.

The only way this could work as I understand it is that the ROM bootloader, stored in the 64 KB on-chip boot ROM referred to in section 3.1, is itself able to configure the crystal oscillator and USB PLL, without any code on my part.

My question is about what assumptions the ROM bootloader makes about crystal values, if any. If I use a 25 MHz crystal, it is possible to configure USB PLL correctly to generate a 48 MHz output, and this is easy if I am managing USB1 myself. But in USB1 DFU operation from ROM bootloader, my code is not involved, only the ROM code. If the ROM assumes 12 MHz, it would not work.

0 Kudos
2,007 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi guanix,

    If you use the USB ROM bootloader, you don't need to add external crystal, the ROM bootloader will choose the internal FRO automatically, you just need to enter the USB ROM bootloader mode is OK.

Wish it helps you!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
2,007 Views
guanix
Contributor II

The USB0 bootloader can run crystalless, but USB1 requires a crystal and USB PLL, no?

From Table 5 on page 22 of the manual (revision 2.0) it looks like the ROM bootloader supports both USB0 and USB1 (USB0 with MSC mode only, USB1 with both DFU and MSC). I would prefer USB1 so the USB port can be used for high-speed operation later, in the application, instead of being limited to full-speed.

0 Kudos
2,007 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Guanix,

   To full speed, both USB0 and USB1 can run crystal-less in the ROM bootloader .

   USB0 also support DFU mode.

pastedImage_1.png

You can use USB1.


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos