You are not Logged In!

Public:MCUXpresso

From Illini Solar Car Wiki
Revision as of 15:55, 17 September 2018 by imported>Jonathan
Jump to navigation Jump to search


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

Before setting up MCUXpresso you may want to have code locally from Github. See: ((Github Setup|Github Setup Instructions)))

Note: This set-up guide covers windows only. ISC officially supports Windows only. You may find notes on getting a Mac set-up to work elsewhere on the Wiki or you can ask senior team members. We will try to have that linked from here

<macro:mathjax><style>

.insrt_list ol {here

list-style-type: decimal;

}

.insrt_list ol ol {

list-style-type: lower-alpha;

}

.insrt_list ol ol ol {

list-style-type: lower-roman;

}

</style>

</macro:mathjax>

{DIV(class=insrt_list)}

  1. Download the MCUXpresso IDE from the NXP Website.
    1. Register for an NXP account
    2. Download MCUXpresso 10.1.1, 10.2 is not compatible with our set-up at this time. Upgrading our code-base is on the road map.
      1. Find it on the "Previous" tab
      2. Any version prior to 10.2 still available should work
      3. If you are coming from an old version please upgrade to at least v 10.
    3. Agree to the MCUXpresso terms*.
    4. 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 Setup|github software repos set-up)) on your computer to move forward with the set-up process.
  4. 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 (see below on managing workspaces)
      1. The absolute minimum for every workspace is -+mbed+-, -+common+-, and the skeleton for the chip your board uses (likely -+mbed1549_skeleton+- on ARGO-FW)
  5. At this point you are ready to work on and edit existing projects. Continue for instructions on building, debugging, and creating projects.

{DIV}

~42~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.

Appendix & Notes

  • Did you get your code to upload, but now it's not letting you upload code? Make sure that you've ended any previous debugging sessions before trying to upload code again (you can either right click on an instance and terminate it or terminate all from the top menu in MCUXpresso)
  • Is the Debugger crashing on upload, with red messages saying that GDB crashed and can't be relied on? Try opening the breakpoints tab and right click "delete all" to make sure there aren't random ones saved. Also setting too many breakpoints can crash the debugger too. (More details on this in ((Building and Debugging Code)).
  • Is your board hard-faulting on debug? Check the .cproject file and try reverting to an earlier version if things are really ugly. Don’t sink 6 hours into attempting to fix the versioning by committing more changes like we did.
  • Is the debugger not working and the red LED on it is lit up? It’s probably stuck in some weird state. Unplugging it and plugging it back in will usually fix it.
  • Is the debugger really really not letting you upload code, even though it appears to be okay? You may have accidentally disabled the SWD/JTAG pins on the microcontroller, blocking communications. Try holding down PGRM and RESET on your board to force it to go into the on-chip bootloader, which is always able to talk to the debugger.
  • The debugger does not provide power to your board. Make sure it’s powered on…
  • If you need to change the processor (LPC1549 vs LPC11C14), you can do so by right clicking the project and selecting C++ Build > MCU Settings
  • *Note that because of the way that the mbed libraries map the interrupt vector table to let you dynamically set interrupt handlers, there are 512 bytes of RAM that are dedicated to the table
  • *When you change the processor, you may need to adjust the RAM region to start offset by 512 bytes (0x10000200 instead of 0x10000000) and to be 512 bytes smaller (0x1E00 instead of 0x2000) for the LPC11Cx4. Otherwise the linker may attempt to place variables in the space reserved for the interrupt table and you may see variables getting corrupted.
  • The LPCXpresso board is a combination of the LPC-LINK debugger (which you want to use to program your board) and a target board containing a microcontroller. To use the LPC-LINK to program your board, you need to desolder the traces between the two rows of nine pins in the middle of the LPCXpresso board.
  • * For extra mechanical fun, you can also dice the board into two pieces, where the cut point is the line of traces that you desoldered.
  • * If all else fails, try restarting LPCXpresso / plugging in / unplugging the board + debugger board, etc.

Run into other stuff that wasted a bunch of time or was confusing? Add your own notes/tips!

Credit:

This guide updated and edited from Devan Lai's (of CalSol) LPCXpresso set up guide which can be found