[STM32F7-DISC] Hard Fault on every example

Hi all,
I’m trying to get started with LVGL & µPython to do some rapid UI prototying, but I can’t seem to get any of the examples to get past the first few lines.

I have the 32F746GDISCOVERY board. From what I understand from the documentation, this board is supported by Micropython under the name “STM32F7DISC”.

To build my firmware I did:

git clone --recurse-submodules https://github.com/lvgl/lv_micropython.git
# Commit: dd0175596c9e3d3cda62dc3134484ada1d2d7520
make -C mpy-cross
cd ports/stm32/
make BOARD=STM32F7DISC
make BOARD=STM32F7DISC deploy-stlink
mpremote

In the python shell:

MicroPython v1.17-588-gdd0175596-dirty on 2021-12-02; F7DISC with STM32F746
Type "help()" for more information.
>>> pyb.fault_debug(True)
>>> import lvgl as lv
>>> lv.init()
>>> x = lv.obj()
HardFault
R0    82000100
R1    00000001
R2    00000001
R3    00000000
R12   0000001e
SP    2004fd48
LR    0807f423
PC    0805ce4e
XPSR  21000000
HFSR  40000000
CFSR  00008200
BFAR  82000114
Stack:
  2004fd48  82000100
  2004fd4c  00000001
  2004fd50  00000001
  2004fd54  00000000
  2004fd58  0000001e
  2004fd5c  0807f423
  2004fd60  0805ce4e
  2004fd64  21000000
  2004fd68  00000001
  2004fd6c  00000000
  2004fd70  00000000
  2004fd74  200140dc
  2004fd78  2004fea4
  2004fd7c  080bed3c
  2004fd80  20014000
  2004fd84  c002f6ae
  2004fd88  00000000
  2004fd8c  0807ac73
  2004fd90  080d0301
  2004fd94  00000001
  2004fd98  00000000
  2004fd9c  2004fe9c
  2004fda0  080ee4e4
  2004fda4  08077fb3
  2004fda8  00000000
  2004fdac  0807f423
  2004fdb0  00000000
  2004fdb4  00000000
  2004fdb8  2004fe9c
  2004fdbc  0807d825
  2004fdc0  0807d815
  2004fdc4  08090cad
  2004fdc8  00000000
  2004fdcc  08098553
  2004fdd0  080ecf70
  2004fdd4  00000006
  2004fdd8  c002f6af
  2004fddc  2004fe9c
  2004fde0  2004fe88
  2004fde4  08098965
  2004fde8  2004fea4
  2004fdec  00000000
  2004fdf0  00000000
  2004fdf4  08038cc7
  2004fdf8  00000080
  2004fdfc  2004fea0
  2004fe00  2004fe78
  2004fe04  00000000
  2004fe08  00000002
  2004fe0c  2004fe98
  2004fe10  00000020
  2004fe14  c002f5d0
  2004fe18  2004fef8
  2004fe1c  08024e75
  2004fe20  08038a0b
  2004fe24  2004fe88
  2004fe28  00000000
  2004fe2c  2004fe88
  2004fe30  2004fea4
  2004fe34  20014cb4
  2004fe38  00000000
  2004fe3c  00000000
  2004fe40  00000000
  2004fe44  2004fdf8
  2004fe48  00003c00
  2004fe4c  00000000
  2004fe50  00000000
  2004fe54  00000000
  2004fe58  00000000
  2004fe5c  00000000
  2004fe60  00000000
  2004fe64  2004fe88
  2004fe68  00000000
  2004fe6c  c002f5d0
  2004fe70  2004fea8
  2004fe74  20014cb4
  2004fe78  00000000
  2004fe7c  00000000
  2004fe80  00000000
  2004fe84  0803003b
  2004fe88  c002f5d0
  2004fe8c  c002f6ad
  2004fe90  2004fe98
  2004fe94  00000002
  2004fe98  20014098
  2004fe9c  080ee4e4
  2004fea0  00000000
  2004fea4  0802ffcd
  2004fea8  00000000
  2004feac  c002f600
  2004feb0  c002f6a0
  2004feb4  0000fa71
  2004feb8  00000016
  2004febc  00000000
  2004fec0  00000000
  2004fec4  00000000
  2004fec8  00000000
  2004fecc  00000000
  2004fed0  00000000
  2004fed4  08044a8f
  2004fed8  00000000
  2004fedc  080c70e7
  2004fee0  20014748
  2004fee4  00000002
  2004fee8  00000002
  2004feec  08055115
  2004fef0  c002f970
  2004fef4  c002f930
  2004fef8  00000000
  2004fefc  00000000
  2004ff00  08044a65
  2004ff04  2004ff68
  2004ff08  00000016
  2004ff0c  200146f8
  2004ff10  00000000
  2004ff14  00000000
  2004ff18  00000000
  2004ff1c  00000000
  2004ff20  00000000
  2004ff24  2004fed8
  2004ff28  00003c00
  2004ff2c  00000000
  2004ff30  00000000
  2004ff34  00000000
  2004ff38  00000000
  2004ff3c  00000000
  2004ff40  00000078
  2004ff44  080c7139
  2004ff48  00000000
  2004ff4c  20014cb4
  2004ff50  080c70e8
  2004ff54  080c7074
  2004ff58  080c70c2
  2004ff5c  08044e2b
  2004ff60  00000000
  2004ff64  00000000
  2004ff68  00000020
  2004ff6c  0000000c
  2004ff70  c002f3d0
  2004ff74  00000000
  2004ff78  20014748
  2004ff7c  200146f4
  2004ff80  20014748
  2004ff84  00000000
  2004ff88  20014000
  2004ff8c  200140a8
  2004ff90  00000000
  2004ff94  0804faab
  2004ff98  00000000
  2004ff9c  00000000
  2004ffa0  00000000
  2004ffa4  0804e865
  2004ffa8  2004ffd0
  2004ffac  00000001
  2004ffb0  00000101
  2004ffb4  00000001
  2004ffb8  00000002
  2004ffbc  00000004
  2004ffc0  00000008
  2004ffc4  00100000
  2004ffc8  e8a72200
  2004ffcc  00000000
  2004ffd0  00000000
  2004ffd4  00000000
  2004ffd8  00000000
  2004ffdc  00000000
  2004ffe0  00000000
  2004ffe4  00000000
  2004ffe8  00000000
  2004ffec  00000000
  2004fff0  00000000
  2004fff4  0805b433

FATAL ERROR:
            HardFault

Can anyone offer some help? Am I doing something wrong?

Thanks in advance,
Dries

Hi @Dries007 !
You didn’t initialize the display driver

Please see the examples on https://github.com/lvgl/lv_binding_micropython/tree/master/examples

You can find stm32 driver initialization there.

Thanks for the quick help; with that info I was able to glue together a few bits and pieces and get an image to load on the screen with touch working!