You are not Logged In!

Difference between revisions of "Public:MCUXpresso"

From Illini Solar Car Wiki
Jump to navigation Jump to search
(Building and Debugging more obvious)
(Some updates and clarifications)
Line 10: Line 10:
 
''Note: This set-up guide currently covers windows only. ISC has officially only ever supported windows. We are working to make our software more cross platform but instructions for non-Windows may still be lacking. Please add them!''
 
''Note: This set-up guide currently covers windows only. ISC has officially only ever supported windows. We are working to make our software more cross platform but instructions for non-Windows may still be lacking. Please add them!''
 
# Download the MCUXpresso IDE from the [https://www.nxp.com/webapp/swlicensing/sso/downloadSoftware.sp?catid=MCUXPRESSO NXP Website].
 
# Download the MCUXpresso IDE from the [https://www.nxp.com/webapp/swlicensing/sso/downloadSoftware.sp?catid=MCUXPRESSO NXP Website].
## Register for an NXP account
+
##[[File:MCUXpresso.png|right|633x633px]]Register for an NXP account
 
## Download MCUXpresso '''10.1.x'''. ***<u>10.2+ have some compatibility issues with our systems.</u>***
 
## Download MCUXpresso '''10.1.x'''. ***<u>10.2+ have some compatibility issues with our systems.</u>***
 
### Find it on the &quot;Previous&quot;
 
### Find it on the &quot;Previous&quot;
 
+
### Agree to the MCUXpresso terms*.
[[File:MCUXpresso.png]]
+
### Download the version for your OS.
 
 
## Agree to the MCUXpresso terms*.
 
## Download the version for your OS.
 
 
# Install MCUXpresso including Debug Drivers
 
# Install MCUXpresso including Debug Drivers
 
## Also Install all device drivers when prompted (depending on your device settings you may not receive these, may only receive one for them all, or will receive a bunch)
 
## Also Install all device drivers when prompted (depending on your device settings you may not receive these, may only receive one for them all, or will receive a bunch)
 
# At this point you will need to have [[GitHub|github software repos set-up]] on your computer to move forward with the set-up process.
 
# At this point you will need to have [[GitHub|github software repos set-up]] on your computer to move forward with the set-up process.
# Create your workspaces
+
# Create your workspaces:
## '''Argo-fw:''' make a single workspace for all projects
+
## '''Argo-fw:''' make a single workspace for all Argo projects
## '''B-fw:''' make a ''different'' single workspace for all projects
+
## '''B-fw:''' make a single workspace for all Brizo projects
## Where should I put my workspaces? (they are configuration files that are stored on your computer). Common advice varies but do not put them in the repo. You can put them in another folder at the same level as the repo if you like
+
## Where should I put my workspaces files? (they are configuration files that are stored on your computer). Common advice varies but <u>do not put them in the repo</u>. You can put them in another folder at the same level as the repo if you like. Just know where they are, you might need to know later.
# To enable you complete the next step there is one time set-up for the static libraries (common and mbed).
+
# '''For b-fw only:''' To enable you complete the next step there is one time set-up for the static libraries (common and mbed).
 
## In your file explorer navigate to common and extract the the project files .zip archive
 
## In your file explorer navigate to common and extract the the project files .zip archive
## In this there is a .project and .cproject files, move them to the top level common folder
+
## In this there ares a .project and .cproject files, move them to the top level common folder
 
## Remove the (now empty) extracted project files folder
 
## Remove the (now empty) extracted project files folder
 
## Do the same for mbed - note that the archive is called z_project_files.
 
## Do the same for mbed - note that the archive is called z_project_files.
Line 37: Line 34:
 
## Select the checkboxes for the projects you want to import to this workspace
 
## Select the checkboxes for the projects you want to import to this workspace
 
### On ARGO -FW you will want <code> mbed</code> <code> common</code> and all of the projects you need
 
### On ARGO -FW you will want <code> mbed</code> <code> common</code> and all of the projects you need
### On b-fw you will want <code> mbed</code> <code> common</code> <code> LPC15x9_skeleton</code>
+
### On b-fw you will want <code> mbed</code> <code> common</code> <code>LPC15x9_skeleton</code> plus any projects you need
# On b-fw your last step is you select the MCU for your current project workspace. Go into the project properties -> MCU settings and select the MCU. This is a workspace wide setting (more info below if interested)
 
 
# '''At this point you are ready to work on and edit existing projects.''' Continue below for notes and help if you run into some rare known issue.  
 
# '''At this point you are ready to work on and edit existing projects.''' Continue below for notes and help if you run into some rare known issue.  
  
Line 56: Line 52:
 
''Note: this is written based on my understanding and may not be complete or 100% accurate. If anyone has more interest in diving deeper into the configuration of our tool chain please do and update this!''
 
''Note: this is written based on my understanding and may not be complete or 100% accurate. If anyone has more interest in diving deeper into the configuration of our tool chain please do and update this!''
  
Several things have to be configured in the IDE for everything to work correctly. This will briefly discuss where configurations are stored/set. For the most part everything that is relevant can be found in propertied -> C/C++ Build. In these properties all of the different tabs that have a configuration listed at the top are changing settings in that configuration. Importantly this includes dialects, linker scripts, and optimizations. Notably, it does not include the settings on the MCU settings page! That is stored in the workspace settings. That is why we recommend a workspace for each MCU we use.
+
Several things have to be configured in the IDE for everything to work correctly. This will briefly discuss where configurations are stored/set. For the most part everything that is relevant can be found in propertied -> C/C++ Build. In these properties all of the different tabs that have a configuration listed at the top are changing settings in that configuration. Importantly this includes dialects, linker scripts, and optimizations. Notably, it does not include the settings on the MCU settings page! That is stored in the workspace settings. If you are using a different MCU regularly you might want separate workspaces for that - if this becomes a team wide regular thing it probably should become a standard set-up.  
  
 
'''Linker Scripts:'''
 
'''Linker Scripts:'''

Revision as of 20:56, 27 April 2020

About

MCUXpresso is an IDE from NXP who makes the family of chips we use on ISC (or at least they bought the company that did). We use MCUXpresso to build, flash, and debug all of the code on the solar car. You are welcome to use any IDE for writing code, however you must use MCUXpresso to compile, flash, and debug all code.

Setting Up MCUXpresso

Note: This set-up guide currently covers windows only. ISC has officially only ever supported windows. We are working to make our software more cross platform but instructions for non-Windows may still be lacking. Please add them!

  1. Download the MCUXpresso IDE from the NXP Website.
    1. MCUXpresso.png
      Register for an NXP account
    2. Download MCUXpresso 10.1.x. ***10.2+ have some compatibility issues with our systems.***
      1. Find it on the "Previous"
      2. Agree to the MCUXpresso terms*.
      3. Download the version for your OS.
  2. Install MCUXpresso including Debug Drivers
    1. Also Install all device drivers when prompted (depending on your device settings you may not receive these, may only receive one for them all, or will receive a bunch)
  3. At this point you will need to have github software repos set-up on your computer to move forward with the set-up process.
  4. Create your workspaces:
    1. Argo-fw: make a single workspace for all Argo projects
    2. B-fw: make a single workspace for all Brizo projects
    3. Where should I put my workspaces files? (they are configuration files that are stored on your computer). Common advice varies but do not put them in the repo. You can put them in another folder at the same level as the repo if you like. Just know where they are, you might need to know later.
  5. For b-fw only: To enable you complete the next step there is one time set-up for the static libraries (common and mbed).
    1. In your file explorer navigate to common and extract the the project files .zip archive
    2. In this there ares a .project and .cproject files, move them to the top level common folder
    3. Remove the (now empty) extracted project files folder
    4. Do the same for mbed - note that the archive is called z_project_files.
  6. Now import the files into your workspace:
    1. Go to File > Import
    2. Select General > Existing Projects into Workspace
    3. Click "Browse" next to "Select root directory"
    4. Select the base folder for the git repository you are setting up the workspace for.
    5. Select the checkboxes for the projects you want to import to this workspace
      1. On ARGO -FW you will want mbed common and all of the projects you need
      2. On b-fw you will want mbed common LPC15x9_skeleton plus any projects you need
  7. At this point you are ready to work on and edit existing projects. Continue below for notes and help if you run into some rare known issue.

**You may want to note the patent waiver clause in case you decide to use it for personal projects. For solar car related software this should not be a concern unless NXP intend to put a car in their IDE.**

Building and Debugging

Once you've completed the steps above you should be ready to build/debug your code and put it onto the MCU. For instructions on that see: Building and Debugging Code

Rare Problems

If you have a Lenovo non-ThinkPad device, or maybe something else weird running Windows 10, you might run into the debuggers not working even if you've set up everything correctly. The error text when trying to debug was a popup saying Socket exception: connection reset or something similar, and the details were a whole list of things including Java code locations. This problem is probably not with the drivers. The easiest fix was to install MCUXpresso 10.1.0 instead of 10.1.1. It may work with other earlier versions as well but hasn't been tested yet. Also make sure to restart your computer after attempting any changes to MCUXpresso versions and driver installs.

Configurations

If you follow the set-up instructions above you will have everything configured as needed. This section is about why/how those configurations came to be

Note: this is written based on my understanding and may not be complete or 100% accurate. If anyone has more interest in diving deeper into the configuration of our tool chain please do and update this!

Several things have to be configured in the IDE for everything to work correctly. This will briefly discuss where configurations are stored/set. For the most part everything that is relevant can be found in propertied -> C/C++ Build. In these properties all of the different tabs that have a configuration listed at the top are changing settings in that configuration. Importantly this includes dialects, linker scripts, and optimizations. Notably, it does not include the settings on the MCU settings page! That is stored in the workspace settings. If you are using a different MCU regularly you might want separate workspaces for that - if this becomes a team wide regular thing it probably should become a standard set-up.

Linker Scripts:

The linker scripts include all of the info for memory mapping. This info comes from the MCU datasheet and MCUs with the same memory configuration (such as LPC1519 & LPC1549) can use the same one. Generally these files should not be changed.

The Appendix and notes section has been moved to the Building and Debugging Code page since it most had to do with issues related to debugging. -Jonathan (Sep 2019)

Additional Resources

MCUXpresso Product Overview (with documentation)

Doxygen - for documenting your code

Credit:

This set-up guide is adapted from Devan Lai's (of CalSol) LPCXpresso set up guide which can be found here. Our set-up is based on CalSol's the development of Zephyr