New to Lpc51u68

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

New to Lpc51u68

Jump to solution
2,297 Views
AndyHo
Contributor III

Hi,

I am new to use nxp mcu, and I have a lpc51u68(om40005) board, after some study and demo code compare, I still have some questions, and hope can get help here,thanks.

1. I plan to implement a gamepad device for PC , like Xbox/ps2, have some buttons and joysticks, so I check hid mouse example code, but no gpio/adc related  code in it , even pin is not defined? How to combine them correctly? So can anyone provide a example as a base?

2. There are some tools and resources but confuse me, like lpcscrypt,lpc open, mcu boot loader...what are those for? Or only lpcxresso is the only tool I need? 

3. From my previous project using pic18, they provide a USB loader for image update, but I need another USB to do it on om40005, how to do it using 1 USB only in lpcxresso, and what is the manufacturing tool for Flash new image without 2nd USB? Or there are alternative way to flash? Ex. Mass storage

4. Simple question, all example code initial debug serial, but I can't see any output from onboard uart, ex, shell example, even select uart debug before run demo. How to make debug serial work and how to wire,

Thank you

Tags (2)
0 Kudos
Reply
1 Solution
1,657 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Andy,

I will give  a brief answer to you above question.

4.  - The Flash Magic just a tool to flash application image  to chip. It is not developed by NXP, there is more information

in the Flash Magic website Flash Magic - Welcome , also after you install it, you can find user manual  in "Help"

pastedImage_2.png

This is the same function with your bootloader, there is bootloader code in ROM ( AN12037), when enter in ISP mode ,

we can use the Flash Magic communicate with Bootloader, then send hex file , flash it. About how to enter ISP mode,

please have a look at the boar user manual.

- The LPC51U68's ROM have bootloader support update frimware through USB, UART, SPI, I2C,  If you still want to create a Second bootloader by yourself,  there is an application about USB Secondary bootloadr for LPC11u6x, you can refer to it : https://www.nxp.com/docs/en/application-note/AN12037_LPC11U6x.zip    

- About MCUBoot, it just for Kinetis products, not LPC.

- About "  OM40005 have an additional chip call DFU to do it, but it will not exist for production, I hope I can simulate production phase on OM40005 but how to? I don't know why not do DFU with 51u68 only?"

Sorry I don't understand this question accurately. The DFU link on board is update firmware (debug probe) of LPC4322 chip, this chip is the debugger function when debug LPC51U68 on this board.  For example update it to Jlink or CMSIS-DAP.  

1-3: About the question using USB, could you please create a new thread about USB, sorry I'm not very good at it,

there will be USB expert help you .


Have a great day,
TIC

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

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
4 Replies
1,657 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Andy Ho,

First of all, to development lpc51u68, I recommend you the IDE is MCUXpresso IDE:

MCUXpresso IDE|Eclipse-based Integrated Development Environment (IDE) | NXP 

 Driver is MCUXpresso SDK:

https://mcuxpresso.nxp.com/en/select      

(LPCxpresso IDE is the old IDE for LPC products, the LPCopen also the old driver for LPC.)

About how to use MCUXpresso IDE and SDK demos, please refer to "MCUXpresso_IDE_User_Guide.pdf",

mainly the parts of "5.4 Obtaining and Installing an SDK" and "7. Importing Example Projects (from installed SDKs)".

Then I will answer your four questions:

1. After download SDK for lpc51u68, you can find some USB examples, maybe this one named

"lpcxpresso51u68_dev_composite_hid_mouse_hid_keyboard_bm" can help you:

pastedImage_4.png

2. You only need MCUXpresso IDE and SDK .

3. About flash new image , you can use "Flash Magic" tool when chip enter into ISP mode, about the detail please

refer to LPC51u68 User Manual  about the part "Chapter 3: LPC51U68 Boot process".

Download Flash Magic at http://www.flashmagictool.com/ 

4. About " all example code" , could you please tell me which example. For SDK examples,  after open it on

MCUXpresso IDE, please set SDK Debug Console to UART console, the UART will work.

pastedImage_7.png

Hope it helps,

BR

Alice

0 Kudos
Reply
1,657 Views
AndyHo
Contributor III

Hi Alice,

Thank you very much for the detail guide you provided.

After some study and work, now I can make a gamepad with 1 button to work by merge GPIO/LED and USB HID MOUSE example, but I still have some question and hope you can help, thank you

1. USB performance (code structure?)

    The GPIO/LED example implement the GPIO read/write in the while() in main, so if I merge the same code in USB HID mouse, I found the button action will read after USB_DeviceHidMouseAction done, not parallel run, it will cause button action may missed or response slow,  if I put the GPIO code in USB_DeviceHidMouseAction, it may cause USB timeout, what is the good way to implement USB+IO? or use RTOS?

2. USB code implementation

    The USB HID mouse always report because the code is  implemented using polling, I hope handle GPIO as interrupt, and only send report when interrupt happened, so  I try not to call USB_DeviceHidSend if no button status changed in USB_DeviceHidMouseAction, and usb interface seems not work anymore.

    So the question is, how to make USB report on demand?

3. USB power management

    I see the LPC MCU have several power mode, but what is the lowest power mode for LPC usb device? if means if no gamepad action, can MCU enter this mode, and wakeup when gamepad button/joystick pressed? It may be able to implemented in timer , or USB "selective suspend". (I see your similar Q&A, power consumption, studying)

   Consider question 1 and 2 and 3, are there any related example code and document about LPCXpresso USB library?  

4. Thank you for provide flashmagic tool and I will study it, but The chapter3 introduce the architecture only, no more information about making those images and production line HOW-TOs.

   I would like to know are there any MXP official release tool and document related? I can found some related information e.g MCUBOOT, which can't found in 51u68 product page, don't know whether or not it can this, even know whether it is 51u58 compatible. those resources you may know after you search the long post, otherwise, no one knows. 

   OM40005 have an additional chip call DFU to do it, but it will not exist for production, I hope I can simulate production phase on OM40005 but how to? I don't know why not do DFU with 51u68 only?

Regards

Andy

0 Kudos
Reply
1,658 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Andy,

I will give  a brief answer to you above question.

4.  - The Flash Magic just a tool to flash application image  to chip. It is not developed by NXP, there is more information

in the Flash Magic website Flash Magic - Welcome , also after you install it, you can find user manual  in "Help"

pastedImage_2.png

This is the same function with your bootloader, there is bootloader code in ROM ( AN12037), when enter in ISP mode ,

we can use the Flash Magic communicate with Bootloader, then send hex file , flash it. About how to enter ISP mode,

please have a look at the boar user manual.

- The LPC51U68's ROM have bootloader support update frimware through USB, UART, SPI, I2C,  If you still want to create a Second bootloader by yourself,  there is an application about USB Secondary bootloadr for LPC11u6x, you can refer to it : https://www.nxp.com/docs/en/application-note/AN12037_LPC11U6x.zip    

- About MCUBoot, it just for Kinetis products, not LPC.

- About "  OM40005 have an additional chip call DFU to do it, but it will not exist for production, I hope I can simulate production phase on OM40005 but how to? I don't know why not do DFU with 51u68 only?"

Sorry I don't understand this question accurately. The DFU link on board is update firmware (debug probe) of LPC4322 chip, this chip is the debugger function when debug LPC51U68 on this board.  For example update it to Jlink or CMSIS-DAP.  

1-3: About the question using USB, could you please create a new thread about USB, sorry I'm not very good at it,

there will be USB expert help you .


Have a great day,
TIC

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

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply
1,657 Views
AndyHo
Contributor III

Hi Alice,

Thank you again for your very useful information, I will give it a try.

Regards,

Andy

0 Kudos
Reply