Minimal boilerplate in MCUXpresso

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

Minimal boilerplate in MCUXpresso

Jump to solution
1,847 Views
yoursunny
Contributor III

I received a Rapid IoT Prototyping Kit from Hackster.io. I looked at the Rapid IoT Studio, but its graphic logic does not make sense to me. I prefer to develop with real C code.

I'm having trouble coming up with a minimal boilerplate in MCUXpresso as a starting point. I have already installed MCUXpresso as well as SDKs for the two microcontroller. However:

  • I don't see an "atomosphere_app" folder in the MK64F12 SDK, which is mentioned on Getting Started step 4.
  • From MCUXpresso IDE - Quickstart Panel, if I use Import project(s) from file system command, the only project showing up is "kboot_k64f". The "hello_world" example does not show up.
  • From MCUXpresso IDE - Quickstart Panel, if I use Import SDK example(s) command, "hello_world" example shows up. However, Build command reports error C:\Users\sunny\Documents\NXP\rapid_iot_k64f_hello_world\Debug/../nwk_ip/base/shell/shell_ip.c:3120: undefined reference to `_sprintf'.
  • I also tried the "hello_world" with Newlib instead of Redlib. The error becomes: ../nwk_ip/core/interface/sockets.h:253:8: error: redefinition of 'struct timeval'

Can anyone provide a GitHub repository of a minimal working boilerplate for the Rapid IoT Prototyping Kit?

Labels (1)
0 Kudos
1 Solution
1,568 Views
yoursunny
Contributor III

I got an answer on Hackster. It turns out that when I import the SDK example, I must select the following in Advanced Settings:

  • Check Redlib: Use floating point version of printf
  • Uncheck Redlib: Use character rather than string based printf
  • Uncheck Redirect SDK "PRINTF" to C library "printf"
  • Uncheck Include semihost HardFault handler

These are described in SLN-RPK-NODE-UG page144.

After making the above changes, I'm able to obtain the file Debug/rapid_iot_k64f_hello_world.axf. This file cannot be uploaded to the kit directly.

I notice that the commands to generate .bin file are commented out. To generate rapid_iot_k64f_hello_world.bin, I need to:

  1. In Project Explorer panel, right-click the project, and select Properties
  2. In Properties for rapid_iot_k64f_hellow_world dialog, select C/C++ Building - Settings from left navigation.
  3. Switch to Build steps tab.
  4. Under Post-build steps, click Edit
  5. Uncomment (remove #) arm-none-eabi-objcopy and checksum commands.

With these changes, I'm able to obtain a Debug/rapid_iot_k64f_hello_world.bin file that can be successfully uploaded to the kit.

View solution in original post

0 Kudos
4 Replies
1,569 Views
yoursunny
Contributor III

I got an answer on Hackster. It turns out that when I import the SDK example, I must select the following in Advanced Settings:

  • Check Redlib: Use floating point version of printf
  • Uncheck Redlib: Use character rather than string based printf
  • Uncheck Redirect SDK "PRINTF" to C library "printf"
  • Uncheck Include semihost HardFault handler

These are described in SLN-RPK-NODE-UG page144.

After making the above changes, I'm able to obtain the file Debug/rapid_iot_k64f_hello_world.axf. This file cannot be uploaded to the kit directly.

I notice that the commands to generate .bin file are commented out. To generate rapid_iot_k64f_hello_world.bin, I need to:

  1. In Project Explorer panel, right-click the project, and select Properties
  2. In Properties for rapid_iot_k64f_hellow_world dialog, select C/C++ Building - Settings from left navigation.
  3. Switch to Build steps tab.
  4. Under Post-build steps, click Edit
  5. Uncomment (remove #) arm-none-eabi-objcopy and checksum commands.

With these changes, I'm able to obtain a Debug/rapid_iot_k64f_hello_world.bin file that can be successfully uploaded to the kit.

0 Kudos
1,568 Views
mrharmonsr
Contributor III

The online starter guide did not work for me either

In the download package there was an updated starter guide that is better.

For the atmosphere sample app I had to go online with the studio and "export" the app.

Then I copied the exported files into the workspace I had set up and imported the project.

The import did not work for me if the files were NOT in the workspace.

(Same with the SDK's - I had to put them in my workspace!)

After importing the SDKs and the Atmosphere App I was able to build and run the code!

0 Kudos
1,568 Views
jjacques
Contributor I

To save anyone from the confusion I had, correction for above is to Download from the Embedded view within the project to get the source. Exporting doesn't give the source zip.

0 Kudos
1,568 Views
estephania_mart
NXP TechSupport
NXP TechSupport

Hello, 

By any chance, have you checked this post? https://community.nxp.com/thread/489834  I believe this might help you solve your problems while getting used to the MCUXpresso IDE. 

If you still have troubles after using the guide, just let me know here so I can try to help you solve your issues. 

Regards, 

Estephania