Skip to contentSkip to conversation

raspberrypi3: fix serial console (add enable_uart=1)

PATCH New Peter Seiderer 3 participants 6 messages Aug 11, 2016 – Aug 16, 2016 Broadcom BCM2711/BCM2835 Arm architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 raspberrypi3: fix serial console (add enable_uart=1)

- enhance post-image.sh script to add 'enable_uart=1' to config.txt on request
- add BR2_ROOTFS_POST_SCRIPT_ARGS="--add-rpi3-config-enable-uart" in raspberrypi3_defconfig

---
 board/raspberrypi/post-image.sh | 13 +++++++++++++
 board/raspberrypi/readme.txt    |  6 +++++-
 configs/raspberrypi3_defconfig  |  1 +
 3 files changed, 19 insertions(+), 1 deletion(-)
board/raspberrypi/post-image.sh +13 -0
index 73ffd65..3dc5902 100755
@@ -5,6 +5,19 @@ BOARD_NAME="$(basename ${BOARD_DIR})"
 GENIMAGE_CFG="${BOARD_DIR}/genimage-${BOARD_NAME}.cfg"
 GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
 
+case "${2}" in
+	--add-rpi3-config-enable-uart)
+	if ! grep -qE 'enable_uart=1' "${BINARIES_DIR}/rpi-firmware/config.txt"; then
+		echo "Adding 'enable_uart=1' to config.txt."
+		cat << __EOF__ >> "${BINARIES_DIR}/rpi-firmware/config.txt"
+
+# fixes rpi3 console
+enable_uart=1
+__EOF__
+	fi
+	;;
+esac
+
 # Mark the kernel as DT-enabled
 mkdir -p "${BINARIES_DIR}/kernel-marked"
 ${HOST_DIR}/usr/bin/mkknlimg "${BINARIES_DIR}/zImage" \
board/raspberrypi/readme.txt +5 -1
index a170f8f..d101816 100644
@@ -58,7 +58,7 @@ After building, you should obtain this tree:
     +-- rpi-firmware/
     |   +-- bootcode.bin
     |   +-- cmdline.txt
-    |   +-- config.txt
+    |   +-- config.txt              [3]
     |   +-- fixup.dat
     |   `-- start.elf
     +-- sdcard.img
@@ -69,6 +69,10 @@ After building, you should obtain this tree:
 
 [2] This is the mkknlimg DT-marked kernel.
 
+[3] For Pi 3 an additional 'enable_uart=1' will be added to fix
+    (serial) console output. Alternatives are 'dtoverlay=pi3-miniuart-bt'
+    or 'dtoverlay=pi3-disable-bt'.
+
 How to write the SD card
 ========================
 
configs/raspberrypi3_defconfig +1 -0
index 4eb5333..62f47da 100644
@@ -34,3 +34,4 @@ BR2_TARGET_ROOTFS_EXT2_4=y
 # BR2_TARGET_ROOTFS_TAR is not set
 BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi3/post-build.sh"
 BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi3/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="--add-rpi3-config-enable-uart"
Signature · 1 line
2.8.1
#1 lore raw

PATCH 1/1 raspberrypi3: fix serial console (add enable_uart=1)

Quoted 67 lines · Peter Seiderer

- enhance post-image.sh script to add 'enable_uart=1' to config.txt on request
- add BR2_ROOTFS_POST_SCRIPT_ARGS="--add-rpi3-config-enable-uart" in raspberrypi3_defconfig

---

board/raspberrypi/post-image.sh | 13 +++++++++++++
board/raspberrypi/readme.txt    |  6 +++++-
configs/raspberrypi3_defconfig  |  1 +
3 files changed, 19 insertions(+), 1 deletion(-)
board/raspberrypi/post-image.sh +0 -0
index 73ffd65..3dc5902 100755
@@ -5,6 +5,19 @@ BOARD_NAME="$(basename ${BOARD_DIR})"

GENIMAGE_CFG="${BOARD_DIR}/genimage-${BOARD_NAME}.cfg" GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"

board/raspberrypi/post-image.sh +13 -0
+case "${2}" in
+	--add-rpi3-config-enable-uart)
+	if ! grep -qE 'enable_uart=1' "${BINARIES_DIR}/rpi-firmware/config.txt"; then
+		echo "Adding 'enable_uart=1' to config.txt."
+		cat << __EOF__ >> "${BINARIES_DIR}/rpi-firmware/config.txt"
+
+# fixes rpi3 console
+enable_uart=1
+__EOF__
+	fi
+	;;
+esac
+

# Mark the kernel as DT-enabled
mkdir -p "${BINARIES_DIR}/kernel-marked" ${HOST_DIR}/usr/bin/mkknlimg "${BINARIES_DIR}/zImage" \

board/raspberrypi/readme.txt +1 -1
index a170f8f..d101816 100644
@@ -58,7 +58,7 @@ After building, you should obtain this tree:
    +-- rpi-firmware/
    |   +-- bootcode.bin
    |   +-- cmdline.txt
-    |   +-- config.txt
+    |   +-- config.txt              [3]
    |   +-- fixup.dat
    |   `-- start.elf
    +-- sdcard.img
@@ -69,6 +69,10 @@ After building, you should obtain this tree:
 

[2] This is the mkknlimg DT-marked kernel.

+[3] For Pi 3 an additional 'enable_uart=1' will be added to fix

board/raspberrypi/readme.txt +3 -0
+    (serial) console output. Alternatives are 'dtoverlay=pi3-miniuart-bt'
+    or 'dtoverlay=pi3-disable-bt'.
+

How to write the SD card
========================

configs/raspberrypi3_defconfig +0 -0
index 4eb5333..62f47da 100644
@@ -34,3 +34,4 @@ BR2_TARGET_ROOTFS_EXT2_4=y
 # BR2_TARGET_ROOTFS_TAR is not set
Quoted 3 lines

BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi3/post-build.sh" BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi3/post-image.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="--add-rpi3-config-enable-uart?

This lowers the core clock speed to minimum, so if you are doing some high definition video decode or interlace then you might want this disabled. I would recommend keeping it disabled by default.

Quoted 7 lines

--
2.8.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160811/11a33ed7/attachment.asc>

#2 lore raw

PATCH 1/1 raspberrypi3: fix serial console (add enable_uart=1)

Hello Khem Raj,

Quoted 61 lines · Khem Raj
Quoted 61 lines · Peter Seiderer

- enhance post-image.sh script to add 'enable_uart=1' to config.txt on request
- add BR2_ROOTFS_POST_SCRIPT_ARGS="--add-rpi3-config-enable-uart" in raspberrypi3_defconfig

---

board/raspberrypi/post-image.sh | 13 +++++++++++++
board/raspberrypi/readme.txt    |  6 +++++-
configs/raspberrypi3_defconfig  |  1 +
3 files changed, 19 insertions(+), 1 deletion(-)
board/raspberrypi/post-image.sh +0 -0
index 73ffd65..3dc5902 100755
@@ -5,6 +5,19 @@ BOARD_NAME="$(basename ${BOARD_DIR})"

GENIMAGE_CFG="${BOARD_DIR}/genimage-${BOARD_NAME}.cfg" GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"

board/raspberrypi/post-image.sh +13 -0
+case "${2}" in
+	--add-rpi3-config-enable-uart)
+	if ! grep -qE 'enable_uart=1' "${BINARIES_DIR}/rpi-firmware/config.txt"; then
+		echo "Adding 'enable_uart=1' to config.txt."
+		cat << __EOF__ >> "${BINARIES_DIR}/rpi-firmware/config.txt"
+
+# fixes rpi3 console
+enable_uart=1
+__EOF__
+	fi
+	;;
+esac
+

# Mark the kernel as DT-enabled
mkdir -p "${BINARIES_DIR}/kernel-marked" ${HOST_DIR}/usr/bin/mkknlimg "${BINARIES_DIR}/zImage" \

board/raspberrypi/readme.txt +1 -1
index a170f8f..d101816 100644
@@ -58,7 +58,7 @@ After building, you should obtain this tree:
    +-- rpi-firmware/
    |   +-- bootcode.bin
    |   +-- cmdline.txt
-    |   +-- config.txt
+    |   +-- config.txt              [3]
    |   +-- fixup.dat
    |   `-- start.elf
    +-- sdcard.img
@@ -69,6 +69,10 @@ After building, you should obtain this tree:
 

[2] This is the mkknlimg DT-marked kernel.

+[3] For Pi 3 an additional 'enable_uart=1' will be added to fix

board/raspberrypi/readme.txt +3 -0
+    (serial) console output. Alternatives are 'dtoverlay=pi3-miniuart-bt'
+    or 'dtoverlay=pi3-disable-bt'.
+

How to write the SD card
========================

Quoted 13 lines
Quoted 9 lines
configs/raspberrypi3_defconfig +0 -0
index 4eb5333..62f47da 100644
@@ -34,3 +34,4 @@ BR2_TARGET_ROOTFS_EXT2_4=y
 # BR2_TARGET_ROOTFS_TAR is not set

BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi3/post-build.sh" BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi3/post-image.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="--add-rpi3-config-enable-uart?

This lowers the core clock speed to minimum, so if you are doing some high definition video decode or interlace then you might want this disabled. I would recommend keeping it disabled by default.

Is this (maybe) a vote for my initial proposed patch ([1]) to add dtoverlay=pi3-miniuart-bt?

The current situation for Pi 3 (no dtoerlay, no enable_uart) is no serial console and an unusable default console on HDMI (with a doubled (but unusable) login prompt)...

Regards,
Peter

Quoted 9 lines
Quoted 8 lines

--
2.8.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#3 lore raw

PATCH 1/1 raspberrypi3: fix serial console (add enable_uart=1)

Hello Khem Raj,

Quoted 79 lines · Peter Seiderer

Hello Khem Raj,

Quoted 61 lines · Khem Raj
Quoted 61 lines · Peter Seiderer

- enhance post-image.sh script to add 'enable_uart=1' to config.txt on request
- add BR2_ROOTFS_POST_SCRIPT_ARGS="--add-rpi3-config-enable-uart" in raspberrypi3_defconfig

---

board/raspberrypi/post-image.sh | 13 +++++++++++++
board/raspberrypi/readme.txt    |  6 +++++-
configs/raspberrypi3_defconfig  |  1 +
3 files changed, 19 insertions(+), 1 deletion(-)
board/raspberrypi/post-image.sh +0 -0
index 73ffd65..3dc5902 100755
@@ -5,6 +5,19 @@ BOARD_NAME="$(basename ${BOARD_DIR})"

GENIMAGE_CFG="${BOARD_DIR}/genimage-${BOARD_NAME}.cfg" GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"

board/raspberrypi/post-image.sh +13 -0
+case "${2}" in
+	--add-rpi3-config-enable-uart)
+	if ! grep -qE 'enable_uart=1' "${BINARIES_DIR}/rpi-firmware/config.txt"; then
+		echo "Adding 'enable_uart=1' to config.txt."
+		cat << __EOF__ >> "${BINARIES_DIR}/rpi-firmware/config.txt"
+
+# fixes rpi3 console
+enable_uart=1
+__EOF__
+	fi
+	;;
+esac
+

# Mark the kernel as DT-enabled
mkdir -p "${BINARIES_DIR}/kernel-marked" ${HOST_DIR}/usr/bin/mkknlimg "${BINARIES_DIR}/zImage" \

board/raspberrypi/readme.txt +1 -1
index a170f8f..d101816 100644
@@ -58,7 +58,7 @@ After building, you should obtain this tree:
    +-- rpi-firmware/
    |   +-- bootcode.bin
    |   +-- cmdline.txt
-    |   +-- config.txt
+    |   +-- config.txt              [3]
    |   +-- fixup.dat
    |   `-- start.elf
    +-- sdcard.img
@@ -69,6 +69,10 @@ After building, you should obtain this tree:
 

[2] This is the mkknlimg DT-marked kernel.

+[3] For Pi 3 an additional 'enable_uart=1' will be added to fix

board/raspberrypi/readme.txt +3 -0
+    (serial) console output. Alternatives are 'dtoverlay=pi3-miniuart-bt'
+    or 'dtoverlay=pi3-disable-bt'.
+

How to write the SD card
========================

Quoted 13 lines
Quoted 9 lines
configs/raspberrypi3_defconfig +0 -0
index 4eb5333..62f47da 100644
@@ -34,3 +34,4 @@ BR2_TARGET_ROOTFS_EXT2_4=y
 # BR2_TARGET_ROOTFS_TAR is not set

BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi3/post-build.sh" BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi3/post-image.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="--add-rpi3-config-enable-uart?

This lowers the core clock speed to minimum, so if you are doing some high definition video decode or interlace then you might want this disabled. I would recommend keeping it disabled by default.

Quoted 9 lines

Is this (maybe) a vote for my initial proposed patch ([1]) to add dtoverlay=pi3-miniuart-bt?

The current situation for Pi 3 (no dtoerlay, no enable_uart) is no serial console and an unusable default console on HDMI (with a doubled (but unusable) login prompt)...

Regards,
Peter

Sorry, forgot to add the link:

[1] http://lists.busybox.net/pipermail/buildroot/2016-May/160334.html

Regards,
Peter

Quoted 14 lines
Quoted 9 lines
Quoted 8 lines

--
2.8.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#4 lore raw

PATCH 1/1 raspberrypi3: fix serial console (add enable_uart=1)

Quoted 86 lines · Peter Seiderer

Hello Khem Raj,

Quoted 82 lines · Peter Seiderer

Hello Khem Raj,

Quoted 61 lines · Khem Raj
Quoted 61 lines · Peter Seiderer

- enhance post-image.sh script to add 'enable_uart=1' to config.txt on request
- add BR2_ROOTFS_POST_SCRIPT_ARGS="--add-rpi3-config-enable-uart" in raspberrypi3_defconfig

---

board/raspberrypi/post-image.sh | 13 +++++++++++++
board/raspberrypi/readme.txt    |  6 +++++-
configs/raspberrypi3_defconfig  |  1 +
3 files changed, 19 insertions(+), 1 deletion(-)
board/raspberrypi/post-image.sh +0 -0
index 73ffd65..3dc5902 100755
@@ -5,6 +5,19 @@ BOARD_NAME="$(basename ${BOARD_DIR})"

GENIMAGE_CFG="${BOARD_DIR}/genimage-${BOARD_NAME}.cfg" GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"

board/raspberrypi/post-image.sh +13 -0
+case "${2}" in
+ --add-rpi3-config-enable-uart)
+ if ! grep -qE 'enable_uart=1' "${BINARIES_DIR}/rpi-firmware/config.txt"; then
+         echo "Adding 'enable_uart=1' to config.txt."
+         cat << __EOF__ >> "${BINARIES_DIR}/rpi-firmware/config.txt"
+
+# fixes rpi3 console
+enable_uart=1
+__EOF__
+ fi
+ ;;
+esac
+

# Mark the kernel as DT-enabled
mkdir -p "${BINARIES_DIR}/kernel-marked" ${HOST_DIR}/usr/bin/mkknlimg "${BINARIES_DIR}/zImage" \

board/raspberrypi/readme.txt +1 -1
index a170f8f..d101816 100644
@@ -58,7 +58,7 @@ After building, you should obtain this tree:
    +-- rpi-firmware/
    |   +-- bootcode.bin
    |   +-- cmdline.txt
-    |   +-- config.txt
+    |   +-- config.txt              [3]
    |   +-- fixup.dat
    |   `-- start.elf
    +-- sdcard.img
@@ -69,6 +69,10 @@ After building, you should obtain this tree:
 

[2] This is the mkknlimg DT-marked kernel.

+[3] For Pi 3 an additional 'enable_uart=1' will be added to fix

board/raspberrypi/readme.txt +3 -0
+    (serial) console output. Alternatives are 'dtoverlay=pi3-miniuart-bt'
+    or 'dtoverlay=pi3-disable-bt'.
+

How to write the SD card
========================

Quoted 13 lines
Quoted 9 lines
configs/raspberrypi3_defconfig +0 -0
index 4eb5333..62f47da 100644
@@ -34,3 +34,4 @@ BR2_TARGET_ROOTFS_EXT2_4=y
 # BR2_TARGET_ROOTFS_TAR is not set

BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi3/post-build.sh" BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi3/post-image.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="--add-rpi3-config-enable-uart?

This lowers the core clock speed to minimum, so if you are doing some high definition video decode or interlace then you might want this disabled. I would recommend keeping it disabled by default.

Is this (maybe) a vote for my initial proposed patch ([1]) to add dtoverlay=pi3-miniuart-bt?

yes that looks better to me. as long as it is has enable/disable knob

Quoted 29 lines
Quoted 6 lines

The current situation for Pi 3 (no dtoerlay, no enable_uart) is no serial console and an unusable default console on HDMI (with a doubled (but unusable) login prompt)...

Regards,
Peter

Sorry, forgot to add the link:

[1] http://lists.busybox.net/pipermail/buildroot/2016-May/160334.html

Regards,
Peter

Quoted 14 lines
Quoted 9 lines
Quoted 8 lines

--
2.8.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#5 lore raw

PATCH 1/1 raspberrypi3: fix serial console (add enable_uart=1)

In reply to Peter Seiderer
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Peter" == Peter Seiderer <[email protected]> writes:

Hi,

Quoted 9 lines
Quoted 3 lines

This lowers the core clock speed to minimum, so if you are doing some high definition video decode or interlace then you might want this disabled. I would recommend keeping it disabled by default.

Is this (maybe) a vote for my initial proposed patch ([1]) to add dtoverlay=pi3-miniuart-bt?

The current situation for Pi 3 (no dtoerlay, no enable_uart) is no serial console and an unusable default console on HDMI (with a doubled (but unusable) login prompt)...

Yes, I guess having a flakey/less-performant bluetooth connection is less bad than the alternatives ..

Signature · 1 line
Bye, Peter Korsgaard