How to modify system initialization (LPCOpen project)

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

How to modify system initialization (LPCOpen project)

Jump to solution
1,742 Views
Eugene723
Contributor II

I'm learning MCUXpresso, so I created "LPCOpen - C project" for LPC1788 MCU, no board.

In "cr_startup_lpc177x_8x.c" source file "ResetISR" calls "SystemInit", which after several more invocations ends up calling "Chip_SetupIrcClocking" located in "sysinit_17xx_40xx.c" source file wherein internal oscillator IRC is setup. This all happens before "main" is called.

 

How do I change this setup, for example switch to external oscillator? Do I change "sysinit_17xx_40xx.c" source file (downloaded with LPCOpen 2.10 devkit) directly or shall I write my own clock configuration routine and call it from "main"?

Note that this is NOT a question regarding which registers need which values.

Understandably, "Clocks" perspective doesn't work since my project is not based on MCUXpresso SDK.

 

Please advise.

 

Thank you,

Eugene

Tags (2)
0 Kudos
1 Solution
1,706 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello,

I recommend to use at first the examples, then if you need more information let me know.

  1. use the 3rd option. Pavel_Hernandez_0-1662764434855.png

     

  2. then find the LPCOpen project at this direction, C:\nxp\MCUXpressoIDE_11.6.0_8187\ide\Examples\LPCOpen.
  3. Select the MCU. Pavel_Hernandez_1-1662764579991.png

     

  4. Click next and select the example.Pavel_Hernandez_2-1662764617891.png

     

Best regards,
Pavel

View solution in original post

0 Kudos
5 Replies
1,664 Views
Feiy
Contributor I

Hi Pavel,

  Thank you very much for replying my question, I already figure out how to add library path for releases. I created another  two new cases 1. I need secondary boot loader c code for lpc11u24 . 2. Could I convert keil project to lpcopen? since I use keil software development tool for long time, now I want switch it to lPCXpressor. Thank you again!

0 Kudos
1,655 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello,

I have your case too, for the secondary bootloader, let me get more information today, and about the Keil to LPCOpen let me do a review but I do not warranty anything. And you want to use LPCxpresso or MCUXpresso?

Best regards,
Pavel

0 Kudos
1,726 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello,

In order to get more details or what are trying to do,  Could you tell me what example are you trying to set up?

If you want to set up the external crystal you could use the sysinit_17xx_40xx.h to use the function to enable the external crystal [Chip_Clock_EnableCrystal].

Best regards,
Pavel

0 Kudos
1,715 Views
Eugene723
Contributor II

Hi Pavel,

Thanks for the reply. My goal eventually is to port source code developed for our proprietary board into MCUXpresso toolchain.

I'm not using any example: on newly installed MCUXpresso, I picked "New Project" from Quickstart Panel, then selected LPC1788 and no board. Step-by-step wizard generated two projects: "lpc_chip_177x_8x" that compiles into library and my test project where "main" function resides.

Following your suggestion, I found function “Chip_SetupXtalClocking” that isn’t called from anywhere in the generated code. I can invoke it from “Chip_SystemInit” found in “sysinit_17xx_40xx.c” instead of “Chip_SetupIrcClocking”. But my question is – since “sysinit_17xx_40xx.c” was supplied as part of LPCOpen chip library – is it OK to edit this code file?

Eugene

0 Kudos
1,707 Views
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello,

I recommend to use at first the examples, then if you need more information let me know.

  1. use the 3rd option. Pavel_Hernandez_0-1662764434855.png

     

  2. then find the LPCOpen project at this direction, C:\nxp\MCUXpressoIDE_11.6.0_8187\ide\Examples\LPCOpen.
  3. Select the MCU. Pavel_Hernandez_1-1662764579991.png

     

  4. Click next and select the example.Pavel_Hernandez_2-1662764617891.png

     

Best regards,
Pavel

0 Kudos