Developing for lpc17xx chip on a custom board lpc link 2

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

Developing for lpc17xx chip on a custom board lpc link 2

1,221 Views
thomasbrickell
Contributor II

I am trying to set up and develop on a LPC17xx chip, specifically LCP1758. The chip is currently already in a custom board and needs some firmware changes. I have a LPC link2 debug board, I also have a olimex jtag available from previous adventures into ARM. Unfortunately I do not have the target board available yet however I have a very short window to be able to work on it so am trying to prepare.

I have set-up a test LPC 1758 work-space and project in mcuxpresso but because there is no target connected to the Link2 debugger I can't go any further.

 questions:

1.

I getting confused as to whether I should be using the J-link firmware or the CMSIS-DAP? I am guessing the CMSIS-DAP... How can I stitch between JTAG and SWD?

2.

I am unable to do any pin configuration to the target within the project. One route in gives me the error "MCU not selected", but this should be solved by the mcuxpresso downloading config online (different to the LPCopen SDK?). Another error message also pops up with a dialog "The selected project is not based on MCUxpresso SDK which I guess is because it is LCP open. If this is the case how do I go about configuring the peripherals on the chip? Do I just have to manually do it as per the user manual (chapter 8 and on)? Possible but hardly quick start.

I feel like I am missing a few bits of information that are stopping fully understanding the development process with mcuxpresso.

Labels (1)
5 Replies

1,072 Views
thomasbrickell
Contributor II

Perfecto! Ok that makes sense now. I did not realise the significance of the SDK Vs non SDK LPC open tool. I've done a bit of old school muc development so no problems now I know I don't need to worry about the configure tool.

Thanks

Tommy

0 Kudos

1,072 Views
Sabina_Bruce
NXP Employee
NXP Employee

I'm glad to help!

Don't hesitate to contact us again in the future if you have more questions or doubts! 

0 Kudos

1,072 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello Thomas,

Hope you are doing well.

I'll be happy to guide you through your questions.

1. First I'd like to point you to the debug considerations post we have. 

Design Considerations for Debug 

Here you will find described "Switching between JTAG and SWD modes of debug". If you wish to switch your debug considerations, you need to select your project in mcuxpresso right click and find the option Debug As..

Here you can select JTAG or SWD.

2. The steps found in this thread will allow you to import the example projects provided in the LPCOpen folder. 

*Note: For this LPC, since it is an older family the examples will be found in LPCOpen, there is not an SDK builder for this particular chip.

The path to find this folder is C:\nxp\MCUXpressoIDE_11.1.0_3209\ide\Examples\LPCOpen  I recommend to use the following zip folder.

pastedImage_8.png

When importing the examples please make sure you have selected the two projects as shown in the thread, if not it will not be able to build with the configurations for the chip.

Programing a LPC17XX with NXP IDE 

Please let me know if you have further questions.

Best Regards,

Sabina

-----------------------------------------------------------------------------------------------------------------------

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

----------------------------------------------------------------------------------------------------------------------- 

0 Kudos

1,072 Views
thomasbrickell
Contributor II

Hi Sabina,

I already have the lpc projects and specifically the LPC1769 zip in my workspace. I start a new project and base it on the LPC1758, the project compiles, but there is "no mcu selected" and the config tool doesn't allow me to do anything.

pastedImage_3.png

All ok and compiles with newly created project.

pastedImage_4.png

but I still can't set up the peripherals or am I just meant to manual set the registers from defined in the chips user manual?

In addition to this When I reopen the project by opening the workspace and then selecting project from the drop down menu I get this error. This means now the "build" link is greyed out.

pastedImage_1.png

and the below error is shown.

pastedImage_2.png

0 Kudos

1,072 Views
Sabina_Bruce
NXP Employee
NXP Employee

Ok, thank you for the images. I now understand what is going on. 

The LPC17xx is an older family which is not part of an SDK in addition the config tools provided in mcuxpresso ide, such as the pins tools, clocks tool, peripheral tool, etc are not enabled for this part. So you will not be able to use it as you might have done in the past with other microcontrollers. 

In this same manner, the build option will be greyed out, because it is not compatible with working with these windows. You should return to the normal code view by clicking the develop button.

pastedImage_1.png

The libraries included in the zip folders I previously mentioned of the LPCOpen already have functions and macros defined that will help you get started. You can follow the example code provided or you can browse these functions within the src folder of the chip folder.

pastedImage_2.png

Here for example you have an ACD_init which you can refer to setup this particular peripheral.

pastedImage_3.png

Or you can use the ADC example in the same zip LPCOpen folder to base your application on.

pastedImage_4.png

I hope this helps. 

Best Regards,

Sabina