You are not Logged In!

Difference between revisions of "Public:MCUXpresso"

From Illini Solar Car Wiki
Jump to navigation Jump to search
Line 70: Line 70:
  
 
This set-up guide is adapted from Devan Lai's (of CalSol) LPCXpresso set up guide which can be found [http://goo.gl/tMMmVG here]. Our set-up is based on CalSol's the development of [https://calsol.berkeley.edu/vehicles/ Zephyr]
 
This set-up guide is adapted from Devan Lai's (of CalSol) LPCXpresso set up guide which can be found [http://goo.gl/tMMmVG here]. Our set-up is based on CalSol's the development of [https://calsol.berkeley.edu/vehicles/ Zephyr]
 
~tc~ (alias(MCUXpresso Setup)) ~/tc~
 

Revision as of 20:21, 8 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. 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"

MCUXpresso.png

    1. Agree to the MCUXpresso terms*.
    2. Download the version for your OS.
  1. 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)
  2. At this point you will need to have github software repos set-up on your computer to move forward with the set-up process.
  3. Create your workspaces
    1. Argo-fw: make a single workspace for all projects
    2. B-fw: make a different single workspace for all projects
    3. 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
  4. 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 is 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.
  5. 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
  6. 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)
  7. At this point you are ready to work on and edit existing projects. Continue below for notes, common issues, and how to create a new project. Also see: Building and Debugging Code

**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.**

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. That is why we recommend a workspace for each MCU we use.

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