Using NuttX OS as a library on Atmel Studio 7
2017-10-19 20:50
288 查看
This document explains how to add NuttX OS to your application on Atmel Studio 7, using NuttX OS as a library. With Atmel Studio 7 easy-to-use feature, you can easily set up the project by following below steps. This project will base on Atmel SAMD21 Xplained Pro, a 32bit ARM Cortex-M0+ MCU with up to 48MHz operating frequency.
Before we start it, must make sure you have executed the ./configure.sh to select samd21-xplained\nsh as NuttX OS configuration file. Then now you should execute:
make export
It will take several minutes to cross compile NuttX OS source file and then you will get a zip file like this nuttx-export-7.22.zip. Now let’s start creating the project on Atmel Studio 7. Launch Atmel Studio 7 and select File->New ->Project to create a new project for SAMD21 Xplained Pro.
Please select GCC C Executable Project, input project Name and choose the proper folder you want to save your project.
The last step is to choose the device for the project, of source, we should choose ATSAMD21J18A. Click OK and wait for Atmel Studio 7 generating project file automatically.
Copy exported file to your project folder and modify the fold name to ‘nuttx-7.22’.
Remove unnecessary files from project.
Add nuttx-7.22 header files and libraries to project.
Right click ‘nuttx_samd21’ project and select ‘Properties’, let us configure the project, such as ‘Directories’, Linker library and so on.
The last step is to copy nsh_main.c from nuttx-7.22\apps\examples\nsh folder to your project and rename the file to main.c. OK, we can compile the project now and wait for the compiling result. Error message will show like below picture. The way to correct these errors is to remove spi_bitband.c.
We are luck, only 2 Errors left. In main.c, please comment there are 2 header files.
//#include “platform/cxxinitialize.h”
//#include “nshlib/nshlib.h”
Otherwise the error message will tell you that no such file or directory.
The compiling process was succeeded, flash memory usage was 42 KB and data memory usage was 3.4 KB.
If you do not need to use nsh library, it will take less flash memory usage. Only 24 KB flash memory used for running NuttX on SAMD21 Xplained with rich OS features. That is a big surprise for me.
Before start running NuttX OS on SAMD21 Xplained, we should set up debug tools in Atmel Studio 7.
Now we can debug the NuttX OS based project on Atmel Studio 7, have fun with NuttX and Atmel Studio 7 & SAMD21 Xplained.
At the end of this blog, I want to thank Alan for his help and suggestion. The readers can visit his blog and there are many articles about NuttX will helpful for you. Alan C. Assis
Before we start it, must make sure you have executed the ./configure.sh to select samd21-xplained\nsh as NuttX OS configuration file. Then now you should execute:
make export
It will take several minutes to cross compile NuttX OS source file and then you will get a zip file like this nuttx-export-7.22.zip. Now let’s start creating the project on Atmel Studio 7. Launch Atmel Studio 7 and select File->New ->Project to create a new project for SAMD21 Xplained Pro.
Please select GCC C Executable Project, input project Name and choose the proper folder you want to save your project.
The last step is to choose the device for the project, of source, we should choose ATSAMD21J18A. Click OK and wait for Atmel Studio 7 generating project file automatically.
Copy exported file to your project folder and modify the fold name to ‘nuttx-7.22’.
Remove unnecessary files from project.
Add nuttx-7.22 header files and libraries to project.
Right click ‘nuttx_samd21’ project and select ‘Properties’, let us configure the project, such as ‘Directories’, Linker library and so on.
The last step is to copy nsh_main.c from nuttx-7.22\apps\examples\nsh folder to your project and rename the file to main.c. OK, we can compile the project now and wait for the compiling result. Error message will show like below picture. The way to correct these errors is to remove spi_bitband.c.
We are luck, only 2 Errors left. In main.c, please comment there are 2 header files.
//#include “platform/cxxinitialize.h”
//#include “nshlib/nshlib.h”
Otherwise the error message will tell you that no such file or directory.
The compiling process was succeeded, flash memory usage was 42 KB and data memory usage was 3.4 KB.
If you do not need to use nsh library, it will take less flash memory usage. Only 24 KB flash memory used for running NuttX on SAMD21 Xplained with rich OS features. That is a big surprise for me.
Before start running NuttX OS on SAMD21 Xplained, we should set up debug tools in Atmel Studio 7.
Now we can debug the NuttX OS based project on Atmel Studio 7, have fun with NuttX and Atmel Studio 7 & SAMD21 Xplained.
At the end of this blog, I want to thank Alan for his help and suggestion. The readers can visit his blog and there are many articles about NuttX will helpful for you. Alan C. Assis
相关文章推荐
- Issue 71 - pymssql - Undefined symbols on Mac, CentOS, Redhat with pre-compiled build - A fast MS SQL Server client library for Python directly using C API instead of ODBC. It is Python DB-API 2.0 compliant. Works on Linux, *BSD, Solaris, Mac OS X and Win
- Using VNC on a debian/Ubuntu server with a OS X Mac
- run helloworld on s3c2410 using skyeye without OS
- 完美解决 use app:showAsAction when not using the appcompat library
- First ASP.NET Core Application on a Mac Using Visual Studio Code
- run helloworld on s3c2410 using skyeye without OS
- How to access HBase from spark-shell using YARN as the master on CDH 5.3 and Spark 1.2
- Hadoop 2.x build native library on Mac os x
- Error when using imshow on OS X
- How to use libusb1.0 library to develop the application on Mac OS X
- Using Clang as a Library----Choosing the Right Interface for Your Application---翻译
- ASP.NET on Mac OS X Snow Leopard at one fell swoop using mod_mono
- using zsh on MAC OS X
- Install Hive using Mysql as metadata store On Ubuntu.
- How to run a Java Program as a daemon (service) on Linux (openSUSE) using a shell script
- How to capture video frames from the camera as images using AV Foundation on iOS
- Unable to print reports as PDF files on the server using batch processing AX
- Using UTF-8 as the internal representation for strings in C and C++ with Visual Studio
- How to enable sorting on a GridView using an IEnumerable list as datasource
- 【OpenGL Programming On macOS using glfw 】0: Build a Simple OpenGL Program