Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imxrt-multi: add support for console over RTT #514

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

jmaksymowicz
Copy link
Contributor

@jmaksymowicz jmaksymowicz commented Sep 13, 2024

Allows for UART-like devices to be created which transmit data over RTT.

Description

Console can be defined to use either UART (as before) or an RTT channel. For now it is not possible to have console through both UART and RTT.

Each RTT channel can be configured to work in non-blocking or blocking mode. In non-blocking mode data is discarded if there is no space left in the buffer. In blocking mode the code attempts to detect if there is a host receiving data over the RTT interface and if there is, the code waits a pre-defined period until there is space left in the buffer.

Motivation and Context

With this change it is possible to access console (e.g. psh) over RTT interface.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (refactoring, style fixes, git/CI config, submodule management, no code logic changes)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: imxrt1170

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

CHange implements library for RTT (multichannel, bidirectional)
communicaton over debug probe JTAG/SWD.

JIRA: RTOS-754
ret = (ret == 0) ? rtt_initChannel(1, chn, buf, RTT_TX_BUF_SIZE) : ret;
ret = (ret == 0) ? rtt_initChannel(0, chn, buf + RTT_TX_BUF_SIZE, RTT_RX_BUF_SIZE) : ret;
ret = (ret == 0) ? mutexCreate(&uart->lock) : ret;
/* TODO: cacluate approx. baud rate based on buffer size and polling rate */

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[codespell] reported by reviewdog 🐶
cacluate ==> calculate

ret = (ret == 0) ? rtt_initChannel(1, chn, buf, RTT_TX_BUF_SIZE) : ret;
ret = (ret == 0) ? rtt_initChannel(0, chn, buf + RTT_TX_BUF_SIZE, RTT_RX_BUF_SIZE) : ret;
ret = (ret == 0) ? mutexCreate(&uart->lock) : ret;
/* TODO: calcuate approx. baud rate based on buffer size and polling rate */

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[codespell] reported by reviewdog 🐶
calcuate ==> calculate

Copy link

github-actions bot commented Sep 13, 2024

Unit Test Results

7 723 tests  +23   7 008 ✅ +23   37m 14s ⏱️ - 1m 48s
  443 suites + 7     715 💤 ± 0 
    1 files   ± 0       0 ❌ ± 0 

Results for commit f5e6b4d. ± Comparison against base commit 10cca0a.

This pull request removes 1 and adds 24 tests. Note that renamed tests count towards both.
phoenix-rtos-tests/psh/touch ‑ armv7m7-imxrt117x-evk:phoenix-rtos-tests/psh/touch
phoenix-rtos-tests/mem/mmap ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/mem/mmap.test_mmap.len__not_page_aligned
phoenix-rtos-tests/mem/mmap ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/mem/mmap.test_mmap.len__not_page_aligned_file
phoenix-rtos-tests/mem/mmap ‑ armv7a7-imx6ull-evk:phoenix-rtos-tests/mem/mmap.test_mmap.len__zero
phoenix-rtos-tests/mem/mmap ‑ armv7a9-zynq7000-qemu:phoenix-rtos-tests/mem/mmap.test_mmap.len__not_page_aligned
phoenix-rtos-tests/mem/mmap ‑ armv7a9-zynq7000-qemu:phoenix-rtos-tests/mem/mmap.test_mmap.len__not_page_aligned_file
phoenix-rtos-tests/mem/mmap ‑ armv7a9-zynq7000-qemu:phoenix-rtos-tests/mem/mmap.test_mmap.len__zero
phoenix-rtos-tests/mem/mmap ‑ armv7a9-zynq7000-zedboard:phoenix-rtos-tests/mem/mmap.test_mmap.len__not_page_aligned
phoenix-rtos-tests/mem/mmap ‑ armv7a9-zynq7000-zedboard:phoenix-rtos-tests/mem/mmap.test_mmap.len__not_page_aligned_file
phoenix-rtos-tests/mem/mmap ‑ armv7a9-zynq7000-zedboard:phoenix-rtos-tests/mem/mmap.test_mmap.len__zero
phoenix-rtos-tests/mem/mmap ‑ armv7m4-stm32l4x6-nucleo:phoenix-rtos-tests/mem/mmap.test_mmap.len__not_page_aligned
…

♻️ This comment has been updated with latest results.

multi/imxrt-multi/rttuart.h Outdated Show resolved Hide resolved
multi/imxrt-multi/rttuart.h Outdated Show resolved Hide resolved
multi/imxrt-multi/uart.c Outdated Show resolved Hide resolved
multi/imxrt-multi/rttuart.c Outdated Show resolved Hide resolved
multi/imxrt-multi/rttuart.c Outdated Show resolved Hide resolved
multi/imxrt-multi/config.h Outdated Show resolved Hide resolved
multi/imxrt-multi/rtt.c Outdated Show resolved Hide resolved
librtt/librtt.c Show resolved Hide resolved
librtt/librtt.c Show resolved Hide resolved
librtt/librtt.c Outdated Show resolved Hide resolved
Fix rtt structure read before initialization
Add better argument validation
Add volatile modifier where necessary
Add option to use cached memory for buffers
Renamed files and functions from "rtt" to "librtt"

JIRA: RTOS-754
Add more utility functions to probe channel status.

JIRA: RTOS-754
multi/imxrt-multi/config.h Outdated Show resolved Hide resolved
multi/imxrt-multi/config.h Outdated Show resolved Hide resolved
multi/imxrt-multi/imxrt-multi.c Outdated Show resolved Hide resolved
Remove hard-coded RTT address and get it from memory map.
Change RTT initialization to keep existing buffer contents if buffers
are valid.
Allow more channels in the control block than defined at compile
time (they will not be usable by the userspace driver).

JIRA: RTOS-754
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants