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

dist/tools/openocd: add RTT port variable #19723

Merged
merged 1 commit into from
Jun 12, 2023

Conversation

fabian18
Copy link
Contributor

@fabian18 fabian18 commented Jun 9, 2023

Contribution description

We have a test setup with multiple boards connected to a Raspberry Pi and edu-mini debug adapters, which don't support UART.
So we go with USEMODULE+=stdio_rtt. But obviously if all boards try to use the same RTT port (9999) at the same time, it does not work. This PR adds a variable for the RTT port in the OpenOCD script.

Testing procedure

export RTT_PORT=55555 && PROGRAMMER=openocd USEMODULE+=stdio_rtt BOARD=same54-xpro make -C examples/gnrc_networking flash term

+ openocd -c source [find interface/cmsis-dap.cfg] -c transport select swd -f /home/fabian.huessler@ml-pa.loc/RIOT/boards/same54-xpro/dist/openocd.cfg -c tcl_port 0 -c telnet_port 0 -c gdb_port 0 -c init -c rtt setup 0x20000000 0x00040000 "SEGGER RTT" -c rtt start -c rtt server start 55555 0
Open On-Chip Debugger 0.12.0-rc3-00999-gfcb40f49b (2023-05-12-10:54)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
swd
Info : CMSIS-DAP: SWD supported
Info : CMSIS-DAP: FW Version = 03.25.01B6
Info : CMSIS-DAP: Serial# = ATML2748101800010083
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 2000 kHz
Info : SWD DPIDR 0x2ba01477
Info : [atsame5.cpu] Cortex-M4 r0p1 processor detected
Info : [atsame5.cpu] target has 6 breakpoints, 4 watchpoints
Info : starting gdb server for atsame5.cpu on 0
Info : Listening on port 38843 for gdb connections
Info : rtt: Searching for control block 'SEGGER RTT'
Info : rtt: Control block found at 0x20000238
Info : Listening on port 55555 for rtt connections
Info : Listening on port 33839 for tcl connections
Info : Listening on port 34923 for telnet connections
+ /home/fabian.huessler@ml-pa.loc/RIOT/dist/tools/pyterm/pyterm -ts localhost:55555
Twisted not available, please install it if you want to use pyterm's JSON capabilities
2023-06-10 00:33:02,395 # Connect to localhost:55555
Info : accepting 'rtt' connection on tcp/55555
Welcome to pyterm!
Type '/exit' to exit.
2023-06-10 00:33:03,398 # NETOPT_TX_END_IRQ not implemented by driver
2023-06-10 00:33:03,399 # main(): This is RIOT! (Version: 2023.07-devel-578-gce229-merge_buildsystem_changes_for_schunk_testsetup)
2023-06-10 00:33:03,399 # RIOT network stack example application
2023-06-10 00:33:03,399 # All up, running the shell now
> ps
2023-06-10 00:33:15,112 # ps
2023-06-10 00:33:15,113 #       pid | name                 | state    Q | pri | stack  ( used) ( free) | base addr  | current     
2023-06-10 00:33:15,113 #         - | isr_stack            | -        - |   - |    512 (  232) (  280) | 0x20000000 | 0x200001c8
2023-06-10 00:33:15,113 #         1 | main                 | running  Q |   7 |   1536 (  676) (  860) | 0x20000360 | 0x200006d4 
2023-06-10 00:33:15,114 #         2 | pktdump              | bl rx    _ |   6 |   1536 (  240) ( 1296) | 0x20002f8c | 0x2000349c 
2023-06-10 00:33:15,114 #         3 | ipv6                 | bl rx    _ |   4 |   1024 (  444) (  580) | 0x20000a3c | 0x20000cac 
2023-06-10 00:33:15,611 #         4 | udp  ps
``

Issues/PRs references

@github-actions github-actions bot added the Area: tools Area: Supplementary tools label Jun 9, 2023
@benpicco benpicco requested a review from maribu June 12, 2023 09:18
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jun 12, 2023
@riot-ci
Copy link

riot-ci commented Jun 12, 2023

Murdock results

✔️ PASSED

dbfb0ea dist/tools/openocd: add RTT port variable

Success Failures Total Runtime
1 0 1 56s

Artifacts

@maribu
Copy link
Member

maribu commented Jun 12, 2023

bors merge

(No need for a train, can_fast_ci_run should detect this)

@bors
Copy link
Contributor

bors bot commented Jun 12, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 0fdea67 into RIOT-OS:master Jun 12, 2023
@benpicco benpicco added this to the Release 2023.07 milestone Aug 2, 2023
@fabian18 fabian18 deleted the pr/openocd_rtt_port branch January 11, 2025 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants