docs/guides/lwl: move lwl's README.txt to lwl.rst

This PR moves the lwl's READEME.txt file to Documentation/guides/lwl.rst

Signed-off-by: Luchian Mihai <luchiann.mihai@gmail.com>
This commit is contained in:
Luchian Mihai
2025-12-22 13:58:09 +02:00
committed by simbit18
parent 8198d6992c
commit 172dd3959a
3 changed files with 51 additions and 47 deletions
+1
View File
@@ -61,4 +61,5 @@ Guides
rust.rst rust.rst
optee.rst optee.rst
qemu_tips.rst qemu_tips.rst
lwl.rst
@@ -1,3 +1,4 @@
=============================
Console over Lightweight Link Console over Lightweight Link
============================= =============================
@@ -8,8 +9,8 @@ It works with openOCD and other debuggers that are capable of reading and
writing memory while the target is running...it should run with JLink writing memory while the target is running...it should run with JLink
for example, if you've got the SDK and modify this file accordingly. for example, if you've got the SDK and modify this file accordingly.
Principle of operation is simple; An 'upword' of 32 bits communicates Principle of operation is simple; An `'upword'` of 32 bits communicates
from the target to the host, a 'downword' of the same size runs in the from the target to the host, a `'downword'` of the same size runs in the
opposite direction. These two words can be in any memory that is opposite direction. These two words can be in any memory that is
read/write access for both the target and the debug host. A simple ping read/write access for both the target and the debug host. A simple ping
pong handshake protocol over these words allows up/down link communication. pong handshake protocol over these words allows up/down link communication.
@@ -25,7 +26,8 @@ upwordaddr if you want to work with fixed locations.
Bit configuration Bit configuration
----------------- -----------------
Downword (Host to target); Downword (Host to target)
^^^^^^^^^^^^^^^^^^^^^^^^^
A D U VV XXX O2 O1 O0 A D U VV XXX O2 O1 O0
@@ -38,7 +40,8 @@ O2 23-16 8 - Octet 2
O1 15-08 8 - Octet 1 O1 15-08 8 - Octet 1
O0 07-00 8 - Octet 0 O0 07-00 8 - Octet 0
Upword (Target to Host); Upword (Target to Host)
^^^^^^^^^^^^^^^^^^^^^^^
A 31 1 - Service Active (Set by device) A 31 1 - Service Active (Set by device)
D 30 1 - Downsense ack (Toggled to acknowledge receipt of downlink data) D 30 1 - Downsense ack (Toggled to acknowledge receipt of downlink data)
@@ -61,7 +64,8 @@ In the first terminal execute the openocd command to connect to the board.
Assuming that you already flashed to firmware (nuttx.bin) with the LWL Assuming that you already flashed to firmware (nuttx.bin) with the LWL
console support. For stm32f4discovery board I use this command: console support. For stm32f4discovery board I use this command:
------------------------------------------ .. code-block:: console
$ sudo openocd -f board/stm32f4discovery.cfg $ sudo openocd -f board/stm32f4discovery.cfg
Open On-Chip Debugger v0.10.0-esp32-20200526-6-g4c41a632 (2020-06-23-10:12) Open On-Chip Debugger v0.10.0-esp32-20200526-6-g4c41a632 (2020-06-23-10:12)
Licensed under GNU GPL v2 Licensed under GNU GPL v2
@@ -90,13 +94,13 @@ invalid command name "ocd_mdw"
0x2000000c: 994b5b1b 0x2000000c: 994b5b1b
0x2000000c: 994b5b1b 0x2000000c: 994b5b1b
...
The "0x2000000c:..." will repeat all the time. ...
Now in another terminal execute: Now in another terminal execute:
------------------------------------------ .. code-block:: console
$ ./ocdconsole.py $ ./ocdconsole.py
==Link Activated ==Link Activated
@@ -107,9 +111,8 @@ help usage: help [-v] [<cmd>]
? echo exit hexdump ls mh sleep xd ? echo exit hexdump ls mh sleep xd
cat exec help kill mb mw usleep cat exec help kill mb mw usleep
nsh> nsh>
------------------------------------------
This code is designed to be 'hardy' and will survive a shutdown and This code is designed to be `'hardy'` and will survive a shutdown and
restart of the openocd process. When your target application restart of the openocd process. When your target application
changes then the location of the upword and downword may change, changes then the location of the upword and downword may change,
so they are re-searched for again. To speed up the start process so they are re-searched for again. To speed up the start process
@@ -124,4 +127,4 @@ better performance it could use interrupts to detect when the memory
position was modified to read the data. position was modified to read the data.
It also will avoid using busy waiting inside the driver, look at It also will avoid using busy waiting inside the driver, look at
nuttx/arch/arm/src/common/arm_lwl_console.c for more information. ``nuttx/arch/arm/src/common/arm_lwl_console.c`` for more information.