MCUXpresso IDE Confusion - Page 1
Forum section: electronics / general

author: ivyandnine
author_rank: Newbie
timestamp: February 24, 2019, 08:41:52 am
content: To any NXP aficionados,I'm trying to get a basic project for the NXP MKE04Z8VFK4 microcontroller but I'm having a lot of difficulties understanding how toget a basic project up and running. I've kind of gathered that the "MCUXpresso SDK Builder" is used to generate ... something that getsimported into the IDE? Also very confused how the local configuration tool fits into this (Why does the web "MCUXpresso SDK Builder"configuration tool have pin config too?).Thanks for any help <3

author: newbrain
author_rank: Super Contributor
timestamp: February 24, 2019, 10:28:21 am
content: I'm more an STM32 aficionado, but I'll try to help!MCUXpresso is yet another horrible Eclipse based tool, and navigating your way in the tiny little twisting menus is not fun at all.Chance wants that I used the very same MCU (quite cheap in the 16 pins package), so I had to go through the process.Below are the steps I did, I'm on Windows 10 but I expect them to be the same in other OSes.First step, create the SDK:Support for this MCU is not included in the MCUXpresso, so, as you have correctly guessed, you need to generate and download the SDK online for your choice of MCU. See the first screenshot below.Why they can't have them ready for download in the relevant MCU pages, is beyond my understandingSecond step: Import the SDK in MCUXpresso.Select "Show View" and then "Others" from the "Window" menu (See ScreenShot).Type SDK in the box that has appeared and select "Installed SDK", "Open" (SSS)The "Installed SDK" panel should now be open in the console area (SSS).Drag and drop the downloaded SDK, confirm, you should now have it listed in the "Installed SDK" panel (SSS).Though it is possible to directly DnD the zip file, I'd advise to expand it to a folder, and use that instead.Third Step: Create projectNow that the SDK is installed, we can try to create a project.Start a new project (from File menu or the Quickstart panel), select the MCU in the wizard (no need to select a board), SSS.In the following page, select the peripherals you intend to use, click "Finish".We now have a project in project in Project Explorer, SSS.Fourth Step: Config ToolsSelect ConfigTools from the window menu, and then the newly create project in the box (SSS).Only the Pin and the Clock tools are available for this MCU.As much as people berate the STM32CubeMX, I find it miles ahead of this tool.To go back to your code/project view, select the C perspective (e.g. in the top right of the window).At this point, it's only a matter of writing your code!Note that a project created and built like this will take most of the memory of that small MCU.The empty project I generated for this post, selecting only GPIO and UART in the wizard used 7300 Bytes out of 8KiB...Code:Building target: MKE04Z8xxx4_Test.axfInvoking: MCU Linkerarm-none-eabi-gcc -nostdlib -Xlinker -Map="MKE04Z8xxx4_Test.map" -Xlinker --gc-sections -Xlinker -print-memory-usage -Xlinker --sort-section=alignment -mcpu=cortex-m0plus -mthumb -T MKE04Z8xxx4_Test_Debug.ld -o "MKE04Z8xxx4_Test.axf" ./startup/startup_mke04z4.o ./source/MKE04Z8xxx4_Test.o ./source/semihost_hardfault.o ./drivers/fsl_clock.o ./drivers/fsl_common.o ./drivers/fsl_gpio.o ./drivers/fsl_uart.o ./device/system_MKE04Z4.o ./board/board.o ./board/clock_config.o ./board/peripherals.o ./board/pin_mux.oMemory region Used Size Region Size %age UsedPROGRAM_FLASH: 7304 B 8 KB 89.16%SRAM: 464 B 1 KB 45.31%Finished building target: MKE04Z8xxx4_Test.axfmake --no-print-directory post-buildPerforming post-build stepsarm-none-eabi-size "MKE04Z8xxx4_Test.axf"; # arm-none-eabi-objcopy -v -O binary "MKE04Z8xxx4_Test.axf" "MKE04Z8xxx4_Test.bin" ; # checksum -p MKE04Z8xxx4 -d "MKE04Z8xxx4_Test.bin";textdatabssdechexfilename7300446077641e54MKE04Z8xxx4_Test.axf11:20:41 Build Finished (took 1s.161ms)How to reduce this bloat, might be the topic for another post...Personally, I don't use MCUXpresso. I still stand by Visual Studio + VisualGDB (it's a paid product, though) which can directly import NXP SDKs.By the way, what are you using to debug and program?If you use aBlackmagic probe, let me know about the results (I'm the one who contributed this MCU, as I had no other suitable debuggers).HTH!

author: ivyandnine
author_rank: Newbie
timestamp: February 24, 2019, 05:06:37 pm
content: Thanks so much newbrain!!!<3 You saved me like 2 days worth of work. Seriously, NXP should be paying *you* to write guides.I got a basic project up and running from your guide in 30 minutes.A couple of questions that came up that I would appreciate your input on:1) Would you recommend using VisualDBG over MCUXpresso? I saw VisualDBG and it looked super nice. My worries about it were (a) that it would end up being one of those tools that has a few edge cases it couldn't do that make it a huge pain in the ass in comparison to the standard IDE and (b) because I'm working on an open source project, that might be a pain for people wanting to contribute because it costs some money. Do you have any comments on my worries here? I'd love to be able to use Visual Studio instead of this eclipse environment.2) I actually haven't purchased a debug / SWD programming probe yet. I was just laying out some boards and getting a feel for the IDE environment. Would you recommend the Black Magic Probe over other options?I'm also planning on using i.MXRT1052 in a future project so not sure if that affects any of your comments here. (Like does the black magic probe also have good support for this i.MXRT1052? The "Support Targets" doesn't list the i.MX line)

author: newbrain
author_rank: Super Contributor
timestamp: February 24, 2019, 06:47:53 pm
content: Glad to have been of some help!Quote from: ivyandnine on February 24, 2019, 05:06:37 pmMy personal preferences as for IDEs are:Visual Studio + VisualGDBVS Code + makefiles, orEmacs + makefilescopy con source.c (or "cat > source.c" on Linux)...Wax TabletsDolores Umbridge's Black QuillAnything Eclipse basedBut this is really one of the most controversial topics in history...VisualGDB has a 30 day test period, so you can try it and decide for yourself: in the forum some people like it some don't, so it's really your call.The list of supported HW is quite long, and it includes also many non-Arm MCUs (even Atmel/Arduino).Using MCUs not supported by default might mean some fiddling with defines and compiler options, but is very doable.The open source angle might be considered independent, as long as a working makefile is provided and maintained along with the source.Quote from: ivyandnine on February 24, 2019, 05:06:37 pmHonestly, I don't have one, but it seems to be a nice HW product, if a bit pricey.Being a cheapskate, I loaded the BM probe FW on a (slightly modified) ST-Link V2.1 snapped off a fried Nucleo board. It works for my purposes, and I like not needing a GDB server (e.g. OpenOCD). This comes handy especially if I'm using VS Code.I clean my conscience by contributing new MCUs if I come across something that's not yet supported (MKE04, MSP432 from TI and, coming soon, STM32WB55).Quote from: ivyandnine on February 24, 2019, 05:06:37 pmThat MCU series is not currently supported neither by VGDB nor by BM probe, as far as I can see in the code, and, IIUC, neither from OpenOCD, so I'm of little help there.Being a Cortex-M7 with the usual SWD/JTAG interfaces, it should be possible to add to the BM probe, if the flash controller is reasonable, but I fear that for the moment tehre aren't many "pre-cooked" alternatives to the NXP provided tools.Please consider that I do this as a hobby (though I work with SW that one could consider "embedded"), so my advice is worth more or less what you pay for it.

author: ehughes
author_rank: Frequent Contributor
timestamp: February 26, 2019, 01:27:27 pm
content: The SDk builder generates a .zip package with examples, etc that get imported into the IDE. Once you import it, new project wizard can make examples, etc for your specific part.The config tools (Clocks and Pins) are actually the same software, one is just web based. In the case of the RT1052, the clock and pin tools are *very* helpful.For the RT Series, I use the Segger Ozone debugger with J-Link. It is by far the best debugger I have used. You can easily stream variables, etc out without halting the CPU, have real time graphs, etc.

author: ElektroQuark
author_rank: Unknown
timestamp: June 28, 2019, 11:06:59 am
content: How does VGDB manage clocks? Any helper included?Using only the SDK basic files or Keils packs doesn't help with system clock. Some old packs did thought, they had some predefined system clock options selectable. Mcuxpresso and the clocks utility are a big help.How about the big code line you have to write to simply toogle a pin with the SDK definitions?

author: newbrain
author_rank: Super Contributor
timestamp: June 28, 2019, 11:07:49 pm
content: Quote from: ElektroQuark on June 28, 2019, 11:06:59 amSimply put, it doesn't.Given the number of different MCU supported, having helpers for each one would be a titanic endeavour...BUT, you can do as many do (myself included, when I'm lazy): just use the vendor's helper (e.g. STM32MXCube, or theMCUXpresso Config Tools) and then import the project.Many tutorials can be found on the VGDB site.In the case of i.MX RT10xx, though, the story gets a bit complicated: in order to program the external memory (usually a QSPI) one needs to write anOpenOCD plug-in.I'll check as soon as I receive the complimentary RT1020 EVK board I've just won*. For the moment, it correctly imported the SDK I generated.To reiterate my disgust for Eclipse (at least in this vendor's version):VisualStudio 2019 starts in a couple of seconds (I have a decent PC: R7 2700X, 24GB, Samsung M.2 disk).In April, I suggested a minor improvement to the VS installer, yesterday I got a mail from Microsoft saying it had been implemented.MCUXpresso takes north of 15s to start.Year after year the dark theme is still half-baked, and the light one now makes inactive #ifdefs unreadable.*Answering a poll on MCUxpresso. I was polite, but not very kind.