[Nucleo-H743ZI2] Where to set breakpoint to find cause of board reset

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
michael.o
Posts: 15
Joined: Sun Oct 25, 2020 12:38 am

[Nucleo-H743ZI2] Where to set breakpoint to find cause of board reset

Post by michael.o » Fri Oct 29, 2021 8:25 pm

I have a micropython firmware that integrates the tensorflow micro c++ api. It works for ESP32 and I'm trying to increase the number of boards it supports starting with stm32 with a Nucleo H743ZI2 board (1MB RAM, 2MB Flash).

I'm encountering an issue when I try to run the hello world example where instead of printing out an approximate sine wave it crashes and resets the board.

Is there a specific function I can set a breakpoint on before the board resets where I can see the backtrace of exactly where the fault occured?

I have a test firmware that can be used to reproduce this issue:

1. Download the firmware from:
https://github.com/mocleiri/tensorflow- ... 1397545963

2. Flash the firmware.elf using stm32cubeprogrammer. I have it with alot of debug symbols present because I didn't want variables getting optimized out when trying to see what was going on in visual studio code.

3. After flashing copy https://github.com/mocleiri/tensorflow- ... o_world.py and https://github.com/mocleiri/tensorflow- ... del.tflite
to /flash.

4. Then in run import hello_world to trigger the below behavior:

MicroPython v1.17-123-g7f1434442 on 2021-10-29; NUCLEO_H743ZI2 MICROLITE with STM32H743

Type "help()" for more information.
>>> import microlite
>>> help (microlite)
object <module 'microlite'> is of type module
__name__ -- microlite
__version__ -- e87305ee53c124188d0390b1ef8ec0555760d4d6
interpreter -- <class 'interpreter'>
tensor -- <class 'tensor'>
>>> import hello_world
interpreter_make_new: model size = 2488, tensor area = 2064
MicroPython v1.17-123-g7f1434442 on 2021-10-29; NUCLEO_H743ZI2 MICROLITE with STM32H743
Type "help()" for more information.
>>>

What is supposed to happen is what happens on ESP32 which prints out an approximate sine wave: https://github.com/mocleiri/tensorflow- ... /README.md

michael.o
Posts: 15
Joined: Sun Oct 25, 2020 12:38 am

Re: [Nucleo-H743ZI2] Where to set breakpoint to find cause of board reset

Post by michael.o » Thu Dec 23, 2021 6:22 am

I found out that you can have the board hold on a hard fault. This will show you the stack trace where the problem occurred:

Code: Select all

pyb.fault_debug(1)

Post Reply