linguini1 commented on code in PR #17238:
URL: https://github.com/apache/nuttx/pull/17238#discussion_r2456572144


##########
Documentation/guides/semihosting.rst:
##########
@@ -2,10 +2,176 @@
 Semihosting
 ===========
 
-.. warning:: 
-    Migrated from: 
-    https://cwiki.apache.org/confluence/display/NUTTX/Semihosting
+Overview
+========
 
+NuttX supports many types of semihosting (syslog, file host sharing, poweroff, 
etc).
+The focus of this document is syslog and file sharing, since these are the 
most common
+features used when porting NuttX to a new platform or when testing requires 
files from
+the host machine (i.e. to play an audio file).
+
+Semihosting SYSLOG
+------------------
+
+This feature is highly valuable, particularly during the porting process to a 
new chip.
+It allows the developer to track events and diagnose issues during the early 
initialization
+phase, even if the UART driver support hasn't been implemented. Furthermore, 
it serves as a
+critical debugging tool when a physical serial port isn't available for 
monitoring.
+
+These are the steps to get semihost syslog working on stm32f4discovery board, 
but it could
+be adapted to other boards as well:
+
+1. Select the stm32f4discovery board with the nsh profile:
+
+.. code-block:: bash
+
+    $ ./tools/configure.sh stm32f4discovery:nsh
+      Copy files
+      Select CONFIG_HOST_LINUX=y
+      Refreshing...
+
+2. Run the menuconfig to select the necessary options:
+
+.. code-block:: bash
+
+    $ make menuconfig
+
+3. Enable the debug options to be displayed over syslog semihost (we want see 
the memory allocations) :
+
+.. code-block:: bash
+
+    Build Setup  --->
+        Debug Options  --->
+            [*] Enable Debug Features
+            [*]   Enable Error Output (NEW)
+            [*]     Enable Warnings Output (NEW)
+            [*]       Enable Informational Debug Output (NEW)
+            ...
+            [*]   Memory Manager Debug Features
+            [*]     Memory Manager Error Output 
+            [*]     Memory Manager Warnings Output 
+            [*]     Memory Manager Informational Output 
+
+4. Enable the semihost syslog support:
+
+.. code-block:: bash
+
+    System Type  --->
+        [*] Semihosting SYSLOG support
+
+5. We need to disable the /dev/console otherwise the serial initialization 
will be called:
+
+.. code-block:: bash

Review Comment:
   I don't think any of these are valid bash code. For these menu descriptions 
I would use `text`, and for the ones with commands starting with `$` use 
`console`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to