NixOS on ARM: Difference between revisions

m →‎Enable UART: Rework into a more generic and useful section
Line 466: Line 466:
Some '''''users''''' have provided best effort caches for 32 bit ARM, but none are currently available.
Some '''''users''''' have provided best effort caches for 32 bit ARM, but none are currently available.


== Enable UART ==
== Troubleshooting ==


If you try to use UART to log on NixOS, you might hang on the line "Starting kernel ...". To enable UART, you will need to add at the end of the line that contains <code>loglevel4</code> in the file <code>/extlinux/extlinux.conf</code> the text:
=== Hanging at <code>Starting kernel ...</code> ===
{{file|/extlinux/extlinux.conf||<nowiki>
When booting a NixOS system, it may look like it is hung at <code>Starting kernel ...</code>.
    console=ttyAMA0,115200n8
 
</nowiki>}}
It is unlikely to be hung at this part. This is the last message printed by U-Boot. U-Boot prints to both the display and the console at once.
{{file|/extlinux/extlinux.conf||<nowiki>
 
    console=ttyS0,115200n8
To view the kernel messages and boot output, the <code>stdout</code>” of the kernel needs to be configured appropriately.
</nowiki>}}
 
The actual device (<code>ttyAMA0</code>, <code>ttyS0</code>, <code>ttyS1</code>) will depend on the hardware.
The kernel's <code>stdout</code> will differ depending on semantics.
 
* When there are no valid <code>console=</code> kernel command-line arguments, it will default to the <code>/chosen/stdout-path</code> device tree property. (Generally a serial console.)
* When valid <code>console=</code> parameters are present, the kernel picks the leftmost valid one as <code>stdout</code>.
 
In other words, the solution may be to enable the appropriate <code>console=</code> parameters according to your hardware configuration and system.
 
* For the display, add <code>console=tty0</code>.
* For a serial console, refer to the target device configuration.


== NixOS installation & configuration ==
== NixOS installation & configuration ==