Warning
This page is located in archive. Go to the latest version of this course pages. Go the latest version of this page.

HW 03 - Input/Output Operations

This homework combines results of HW01 and HW02. The HW03 expects you are capable to write an application for Unix OS which is capable to communicate over serial interface with the NUCLEO board and send the commands to control the LED and read the button status. The application for Unix OS is the application from HW01 extended by inteface of the serial port access. The program on the NUCLEO side can be the code developed for HW02.

These are proposed steps to achieve the goal:

  • Use the initialization of the HW components
    • UART interface
    • User LED light
    • User Button
  • Adjust the program developed in HomeWork 01 to be able to:
    • Communicate over serial line.
    • Read the state of the button.
    • Write the state of the User LED.
  • Adjust the program from HomeWork 01 to use at least two threads where:
    • the first thread manages reception from the serial line.
    • the second thread manages the user interface.

The expected deliverables are:

  • PC program for UNIX OS: All source codes (.c and .h files) necessary to build the application and a text file containing the command used to compile the project or makefile
  • NUCLEO application: the main.c containing all the required procedures (please, do not send the whole project).

These parameters will be evaluated:

Common section:

  • 1 point - the communication protocol is non trivial - it has more then one character and ends with \r\n characters - describe the communication in the comment section of your source code

Nucleo side:

  • 1 point - the Nucleo stores the incoming communication in the buffer and process the buffer
  • 1 point - the Nucleo is capable to control LED based on commands defined in communication protocol
  • 1 point - the Nucleo is capable to read state of the button based on commands defined in communication protocol

Nucleo side:

  • 1 point - the PC program initializes the serial communication interface
  • 1 point - the PC program is capable to get one command line parameter which is the path to the USB/serial interface
  • 1 point - the PC program uses two threads (see above) and there is no memory leak in the program - e.g. all the malloc has their free
  • 1 point - the PC program is capable to send messages to Nucleo - non trivial messages (see above)
  • 1 point - the PC program is receiving the data into the buffer which is subsequently processed (non-trivial messages - see above)
  • 1 point - the PC program is capable to send a custom command to the Nucleo and in case the Nucleo will not recognise the commnad the Nucleo will reply with “Wrong command” answer and this reply will be displayed by PC application in the terminal window. It is required the custom command will be sent to the Nucleo board over the communication interface and the board will reply over the communication interface.
courses/be5b99cpl/hw/hw03.txt · Last modified: 2019/10/24 11:30 by pacesp