kumquat-buildroot/board/stmicroelectronics/stm32f429-disco/flash.sh
Dario Binacchi c85312affd configs/stm32f429_disco: fix kernel bootup
The kernel generated by the configuration for the STM32f429-discovery
board is buggy:

Fixes:
 Unhandled exception: IPSR = 00000006 LR = fffffff1
 CPU: 0 PID: 1 Comm: init Not tainted 4.11.0 #2
 Hardware name: STM32 (Device Tree Support)
 task: 9041a000 task.stack: 907c0000
 PC is at ret_fast_syscall+0x2/0x4a
 LR is at tty_ioctl+0x1ad/0x75c
 pc : [<0800d942>]    lr : [<080c2e05>]    psr: 4000000b
 sp : 907c1fa8  ip : 0000001c  fp : 905961a2
 r10: 00000000  r9 : 907c0000  r8 : 0800dae0
 r7 : 00000036  r6 : 905e7e60  r5 : 00000000  r4 : 905e7ebc
 r3 : 00000000  r2 : 00000000  r1 : 00000000  r0 : 00000000
 xPSR: 4000000b
 CPU: 0 PID: 1 Comm: init Not tainted 4.11.0 #2
 Hardware name: STM32 (Device Tree Support)
 [<0800fbf9>] (unwind_backtrace) from [<0800f05b>] (show_stack+0xb/0xc)
 [<0800f05b>] (show_stack) from [<0800f553>] (__invalid_entry+0x4b/0x4c)

Inspired by commit a3e3d9c198 ("configs/stm32f469_disco_xip_defconfig:
alternative defconfig for XIP"), update the stm32f429_disco_defconfig
configuration to use a newer kernel. Current setup kernel + rootfs fits
in 1.6MB on-chip flash memory.

The kernel has been moved to new flash bank due to growth of dtb size.

Remove upstream patch.

For better binary size optimization gcc LTO is turned on.

Signed-off-by: Dario Binacchi <dariobin@libero.it>
Acked-by: Christophe Priouzeau <christophe.priouzeau@foss.st.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2021-12-17 22:58:11 +01:00

27 lines
849 B
Bash
Executable File

#!/bin/bash
OUTPUT_DIR=$1
BOARD_NAME=${2:-stm32f429discovery}
if ! test -d "${OUTPUT_DIR}" ; then
echo "ERROR: no output directory specified."
echo "Usage: $0 OUTPUT_DIR BOARD_NAME"
echo ""
echo "Arguments:"
echo " OUTPUT_DIR The Buildroot output directory."
echo " BOARD_NAME One of the available boards among:"
echo " stm32f429discovery, stm32f429disc1"
exit 1
fi
${OUTPUT_DIR}/host/bin/openocd -f board/${BOARD_NAME}.cfg \
-c "init" \
-c "reset init" \
-c "flash probe 0" \
-c "flash info 0" \
-c "flash write_image erase ${OUTPUT_DIR}/images/stm32f429i-disco.bin 0x08000000" \
-c "flash write_image erase ${OUTPUT_DIR}/images/stm32f429-disco.dtb 0x08004000" \
-c "flash write_image erase ${OUTPUT_DIR}/images/xipImage 0x0800C000" \
-c "reset run" \
-c "shutdown"