Git Product home page Git Product logo

nuttx-test-task's Introduction

О проекте

Это первый пробный проект на базе nuttx.

Задача

Разработать драйвер SPI и приложение для взаимодействия с ним.

Приложение должно отправлять в SPI два типа данных:

  1. Счетчик
  2. Произведение двух случайно сгенерированных матриц

Реализовать работу драйвера в двух задачах.

Комментарии

  1. При разработке я исходил из того, что вносить изменения в код nuttx, в том числе добавлять новый код, не нужно. Таким образом новый драйвер описан не в папке nuttx/drivers, а в папке приложения.
  2. Драйвер взаимодействует с условным устройством под названием "denis"
  3. Не реализована поддержка CS для SPI. Нужно больше времени

Вероятно, подход "чистого" репозитория nuttx неправильный. И добавлять поддержку новых плат, устройств и их драйверов нужно непосредственно в nuttx. Тогда не было бы проблем с SPI CS.

Сборка

Проект основан на nuttx версии 11.0.0-RC2

1. Подготовить окружение:

Необходимо, чтобы в общей папке были помещены два репозитория:

git clone https://github.com/apache/incubator-nuttx.git nuttx
git clone https://github.com/apache/incubator-nuttx-apps apps

Более подробно можно посмотреть тут

2. Клонировать текущий репозиторий в папку apps/examples/test_task и обновить сабмодули:

cd apps/examples
git clone [email protected]:chuyec/nuttx-test-task.git test_task
cd test_task
git submodule update --recursive

3. Выбрать стандартную плату и конфигурацию:

cd nuttx
make distclean
tools/configure.sh -l stm32f4discovery:nsh

4. Сконфигурировать Kconfig:

cd nuttx
make apps_distclean
make menuconfig
  1. Application Configuration ---> Examples ---> Select [*] Test Task
  2. RTOS Features ---> Tasks and Scheduling ---> Application entry point ---> Type 'test_task_main'
  3. System Type ---> STM32 Peripheral Support ---> Select SPI1
  4. Library Routines ---> Standard C I/O ---> Select Enable floating point in printf

4. Собрать:

cd nuttx
make

5. Зашить:

openocd -f interface/stlink-v2.cfg -f target/stm32f4x.cfg -c 'init' -c 'program nuttx verify reset' -c 'shutdown'

6. Наблюдать работу приложения в терминале:

picocom -b 115200 /dev/ttyACM0

nuttx-test-task's People

Contributors

chuyec avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.