Add a second related type MCU to an existing project

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

Add a second related type MCU to an existing project

Jump to solution
1,928 Views
jmullen_condose
Contributor III

Good day all!

I have a project that uses the LPC844M201JBD48 MCU. Now that MCUs are 'the new toiletpaper' and virtually unavailable this year, we managed to purchase a few thousand of LPC845M301JBD48, which is the same footprint and will run the same code, but has more RAM and some additional devices (2 USART vs 5 USART for example). I can flash these directly in our products "as is" with MCUxpresso, however since we have them, I would like to add the LPC845 as a variant to the project, so that as we continue to develop software for the product some may be for "either 844 or 845" and some will be for "845 version only".

Rather than make a new '845' project and copy existing code to that project, I would like to have them in the same project. Otherwise, I can see having to duplicate new code or bug fixes for both versions concurrently yet separately... no bueno. Since the two MCUs are really just about like switching between 2 different packages of the 844 (sort of...), perhaps MCUx can allow a setup where I may select between the two versions from the same project, and rebuild as needed for each? I could #if out the 845 specific code, to keep the 844 version within RAM limits. the 844 also uses both USARTs but the new code for 845 I wish to mux in a 3rd one under 'Peripherals'. You see where I am going, eh?

I have been looking and cannot figure out how to do this, if it can be done. Hopefully I just missed something simple...!

Therefore, my specific question: Can I add a 'variant' of such similar processors to an existing MCUx project, if so, how best to? If not, any experience you might share on how best to proceed otherwise, copy project, etc.? 

Cheers!
-jeff-

1 Solution
1,919 Views
ErichStyger
Specialist I

The 'normal' way would be to use a build configuration (see https://mcuoneclipse.com/2016/05/19/build-configurations-in-eclipse/ ) for each device variants, and you are done. Like it is for the build settings:

ErichS_0-1620652796988.png

 

Unfortunately the MCUXpresso device and configuration tool settings are per project and not per Eclipse build configuration. It would need that same configuration drop down as above):

ErichS_1-1620652839168.png

I could be that this will be implemented as feature in a future IDE version.

What I have done is the following:

- have one project for each device

- use a common folder with the common parts which is linked into each project

That way there is no need for 'copy-paste' things and I can easily keep things shared and common.

How this looks you can see with the following project(s) on GitHub:

https://github.com/ErichStyger/MetaClockClock

This one is using different Kinetis and LPC devices for the same project, organized in the above way.

I hope this helps,

Erich

 

PS: 'the new toilet paper' :-))))))

View solution in original post

1 Reply
1,920 Views
ErichStyger
Specialist I

The 'normal' way would be to use a build configuration (see https://mcuoneclipse.com/2016/05/19/build-configurations-in-eclipse/ ) for each device variants, and you are done. Like it is for the build settings:

ErichS_0-1620652796988.png

 

Unfortunately the MCUXpresso device and configuration tool settings are per project and not per Eclipse build configuration. It would need that same configuration drop down as above):

ErichS_1-1620652839168.png

I could be that this will be implemented as feature in a future IDE version.

What I have done is the following:

- have one project for each device

- use a common folder with the common parts which is linked into each project

That way there is no need for 'copy-paste' things and I can easily keep things shared and common.

How this looks you can see with the following project(s) on GitHub:

https://github.com/ErichStyger/MetaClockClock

This one is using different Kinetis and LPC devices for the same project, organized in the above way.

I hope this helps,

Erich

 

PS: 'the new toilet paper' :-))))))