[Buildroot] [git commit] configs/stm32f769_disco_sd: fix boot failure after uClibc bump

Julien Olivain via buildroot <[email protected]>
Newsgroups net.busybox.buildroot
Message-ID <[email protected]>
commit: https://gitlab.com/buildroot.org/buildroot/-/commit/dd67de1bd3374a75ab1845ef29e3ad3c3bed2aac
branch: https://gitlab.com/buildroot.org/buildroot/-/tree/master

Since uClibc was bumped to 1.0.58 (c7fef3704c70, "package/uclibc:
bump to 1.0.58"), the board hangs after starting init:

    [    1.231624] Run /sbin/init as init process
    [    1.235599]   with arguments:
    [    1.238549]     /sbin/init
    [    1.241331]     earlyprintk
    [    1.244018]   with environment:
    [    1.247143]     HOME=/
    [    1.249554]     TERM=linux
    [    1.252177]     consoleblank=0

No error message is printed and the boot simply stalls at this
point.

The STM32F769 has no MMU, and uClibc's standard malloc()
implementation returns NULL for allocations performed during early
init on this target, causing init to fail.

Fix this by switching to MALLOC_SIMPLE, a plain mmap-based allocator
meant for small/noMMU systems, via a uClibc config fragment. Unlike
the STM32F429/STM32F469 fix, the fragment is kept board-specific
since the STM32F769 is a Cortex-M7 board and does not belong to the
stm32f4xx family.

Signed-off-by: Dario Binacchi <[email protected]>
Signed-off-by: Julien Olivain <[email protected]>
---
 board/stmicroelectronics/stm32f769-disco/uclibc-fragment.config | 2 ++
 configs/stm32f769_disco_sd_defconfig                            | 1 +
 2 files changed, 3 insertions(+)

diff --git a/board/stmicroelectronics/stm32f769-disco/uclibc-fragment.config b/board/stmicroelectronics/stm32f769-disco/uclibc-fragment.config
new file mode 100644
index 0000000000..fb8fa9ee01
--- /dev/null
+++ b/board/stmicroelectronics/stm32f769-disco/uclibc-fragment.config
@@ -0,0 +1,2 @@
+# MALLOC is not set
+MALLOC_SIMPLE=y
diff --git a/configs/stm32f769_disco_sd_defconfig b/configs/stm32f769_disco_sd_defconfig
index 065d5b59bf..d09b81b19b 100644
--- a/configs/stm32f769_disco_sd_defconfig
+++ b/configs/stm32f769_disco_sd_defconfig
@@ -1,6 +1,7 @@
 BR2_arm=y
 BR2_cortex_m7=y
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_5_15=y
+BR2_UCLIBC_CONFIG_FRAGMENT_FILES="board/stmicroelectronics/stm32f769-disco/uclibc-fragment.config"
 BR2_GLOBAL_PATCH_DIR="board/stmicroelectronics/stm32f769-disco/patches"
 BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
 BR2_ROOTFS_POST_BUILD_SCRIPT="board/stmicroelectronics/stm32f769-disco/post-build.sh"
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.