https://github.com/peronchichino/fhtw_bic_mcsd_assign4
https://github.com/peronchichino/fhtw_bic_mcsd_assign4
c l432kc nucleo nucleo-board stm32
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/peronchichino/fhtw_bic_mcsd_assign4
- Owner: Peronchichino
- Created: 2023-04-05T10:35:24.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-05T17:50:26.000Z (almost 2 years ago)
- Last Synced: 2025-01-03T12:44:28.711Z (6 months ago)
- Topics: c, l432kc, nucleo, nucleo-board, stm32
- Language: C
- Homepage:
- Size: 610 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FHTW_BIC_MCSD_Assign4 Description:
UART Task
Using the Nucleo STNM32LKC evaluation board realize a small communication protocol that shall follow a bi-directional frame-based protocol pattern relying entirely on ASCII characters.Task Description
The layout of frames are as follows:+---+---+---+---+-[...]--+---+---+
| S | C | S | | E |
| o | M | E | DATA | o |
| F | D | P | | F |
+---+---+---+---+-[...]--+---+---+
Every frame starts with a "start-of-frame" (SoF) character (#), followed by a "command" (CMD) character, a separator (SEP), a variable number of "DATA" characters, and an "end-of-frame" (EoF) terminating character (\n).Every command shall be acknowledged from the receiving side with an ACK in case of success and NACK message in case of an error.
Under Linux ensure that you have the proper privileges to read/write to the serial interface (typically you’ll need to add yourself to the group dialout - sudo usermod -a -G dialout yourUserName.
You are free to define your own commands and data values. The following example shows a possible scenario:
PC → STM32L#r,0:100\n # command: r (get a random value)
# data: 0:100 (in the range [0,100])
STM32L → PCACK\n # positive acknowledge of receipt
#a,42\n # send an answer: a, data value: 42
PC → STM32LACK\n # positive acknowledge
# Points:
4/10