cancel
Showing results for 
Search instead for 
Did you mean: 

STMH743XI-E02 fails to validate NN model on target. LOAD ERROR: STM32 - no connected board(s), invalid firmware or the board should be re-started.

oekk
Associate II

Hi, I am trying to deploy a Keras model that fits in the board STMH743XI-E02. In order to do so, I've created the model, and loaded it into the project according to the current documentation.

I've tried to use several USART ports to enable communications with the board, and I've tested the USART communications with an example project that correctly send the data to my terminal. Meaning, that my configuration is correct, at least on the board to use the USART.

But when it comes to use STM32CUBEMX and the AI additional package, after analyzing the model, and validate it on desktop, the following error appears to me, once and again:

LOAD ERROR: STM32 - no connected board(s), invalid firmware or the board should be re-started

  • My last configuration usses USART1 Asynchronous for communications. I'be tried with pins:
    • PB14, PB15
    • PA9, PA10
    • PD8, PD9 (USART3)
  • I've used the validation template on the AI package.
  • The clock is set to 480MHz on the Clock configuration tab.
  • Minimmum Stack size to 0x2000 on the Project Manager tab.
  • The model fits without compression, occuping:
    • 324.78 KBytes Flash
    • 9.37 KBytes RAM
    • 290840 MACC
  • I have my own validation data inputs and outputs and on desktop they work ok.
  • I'm using the latests version of the tools.

My questions are:

  1. Do I need to perform further configuration to generate the code?
  2. What actions do I need to perform to be able to validate the model on target using the UI? Any option to achieve this stage without UI?

Attached, project.ioc, the STMCUBEMX project and the model I've used along with the validation data.

Thank you very much for your time.

16 REPLIES 16
fauvarque.daniel
ST Employee

on this board there are some jumpers to put in the right place to have the USART1 sent to the ST-Link

0690X00000AsDfyQAF.jpgand the USART1 is connected on PB14 and PB15

You should be able to use the automatic validation on the target specifying explicitly USART1 and PB14/PB15 for the ports

Otherwise you can always add the validation AI component to your project, enable USART1 in asynchronous mode, then in AI configure the Platform Settings to USART1, generate the code, flash it on the board then go back to MX to launch the validation on the target without auto generation

I've seen on some boards, after a first connection on the PC there is a need to do a reset by hand for the validation to work correctly.

A good practice is to configure the USART to run at 115200 Bauds, this is the default value taken by the underlying command line for validation.

Regards

Daniel


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
fauvarque.daniel
ST Employee

BTW you can always use the stm32ai command line but as the UI triggers the command line you'll have the same answer.


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Thank you for your response on such short notice.

  • I am aware of the jumpers, I have them on the right possition.
  • The USART is configurated at 115200 Bauds too.
  • My connections to the board are power (PSDU DC5V) and usb on CN23 (ST-LINK/V3E).

> I've seen on some boards, after a first connection on the PC there is a need to do a reset by hand for the validation to work correctly.

What do you mean by this?

Just that a first validation on the target failed after flash, hitting the reset button and restarting the validation made it work. I didn't see this behavior on this specific board actually.

To move forward on the debugging of your issue, you can launch a pseudo tty on the COM port on the PC and press the reset button on the board. Normally you should see some text displayed.

You can also verify that your main.c looks like that:

 MX_GPIO_Init();

 MX_CRC_Init();

 MX_X_CUBE_AI_Init();

 /* USER CODE BEGIN 2 */

 /* USER CODE END 2 */

 /* Infinite loop */

 /* USER CODE BEGIN WHILE */

 while (1)

 {

  /* USER CODE END WHILE */

 MX_X_CUBE_AI_Process();

  /* USER CODE BEGIN 3 */

 }

and in app_x-cube-ai.c you have something like:

void MX_X_CUBE_AI_Init(void)

{

  MX_UARTx_Init();

  aiValidationInit();

  /* USER CODE BEGIN 0 */

  /* USER CODE END 0 */

}

void MX_X_CUBE_AI_Process(void)

{

  aiValidationProcess();

  /* USER CODE BEGIN 1 */

  /* USER CODE END 1 */

}


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
oekk
Associate II

Hi,

I've tried to do the debug with TeraTerm but it just doesn't show anything with this program. When debugging with the UART example that is provided for this board I can see the printf in the TeraTerm but not with this one. After reset the board 3 times with the AI program, a character is ploted in the PuTTY term.

  • The code on main.c and app_x-cube-ai.c looks like the one you just pasted here.
  • I can see some characters in the tty on the COM port but nothing meaningful.
    • ▒ (after several resets)

oekk
Associate II

Maybe this is helpful,

After generating the code without validating the model, and debuging it, it stops in these lines, in stm32h7xx_haluart.c:

> /* Wait until flag is set */

> while ((__HAL_UART_GET_FLAG(huart, Flag) ? SET : RESET) == Status)

>   /* Check for the Timeout */

>  if (Timeout != HAL_MAX_DELAY)

fauvarque.daniel
ST Employee

If you see some strange characters it may be due to the mismatch between the USART configuration and the TeraTerm configuration.

Both should be at the same baud rate (115200 by default) 8 bit word length, no parity, 1 stop bit.


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

I do have that configuration.

fauvarque.daniel
ST Employee

Just tried a project with STM32CubeMX 5.4, X-Cube-AI 4.1.0, IAR EWARM and it worked fine on that board

Here is what I did

start from the STM32CubeMX board selector and select STM32H743I-EVAL

answer no to initialize peripherals to their default values

add X-Cube-AI 4.1.0 Core and Validation

enable USART1 Asynchonous (it will go to the right pins)

In X-Cube-AI enter the platform settings (USART1) and enter your network

In Project Manager, give a name for the project and in the Code Generator section check "Copy only the necessary library files"

generate the code, compile and flash it.

then go back in X-Cube-AI and launch the validation on the target.

I used the default board configuration (clock at 64Mhz). If you change the D1CPRE clock to 480Mhz you need to also change the RCC Power regulator voltage scale to "Power Regulator Voltage Scale 0"

Hope it helps

Daniel


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.