PQT - Doubt about use with STM32F7508-DK platform

Hi guys I need help, I’m trying to use the PQT project but there is something implicit or that I missed that is blocking me. I don’t understand where and how I should perform the CORE configuration steps for example. I tried to add all the files into the Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/projects/coremark folder but I got stuck in steps 3, 4 and 5:

  • Step 3: some files already exist in the STM32F7508-DK board project;
  • Step 4: I think I understand from the documentation in the code, but it’s still not clear enough;
  • Step 5: I have no idea which file(s) we are talking about.

Hi @acmlira

Step 3: The platform can already provide a coremark implementation meaning some files may already exist.
Step 4: what is not clear to you? what is to be implemented and how? Here you have to implement some RAM accesses to ensure the access of different types of differently aligned RAM, implement some RAM accesses to measure RAM speed and call the entry point of the coremark tests.
Step 5: We are talking here about adding the main of the core tests (https://github.com/MicroEJ/PlatformQualificationTools/blob/master/tests/core/c/inc/t_core_main.h) to the usual C main found in our platforms in order to run them: MicroEJ Core Engine — MicroEJ Documentation

Hope it’ll help,
Gaëtan for MicroEJ

Thank you @gaetan.harel :slight_smile:

It’s clearer now. About step 3, It’s done. About step 4, I implemented the methods returning NULL or 0 (I think this shouldn’t be a problem for now?). About step 5, I still don’t know which file I should "add the call to the function T_CORE_main() just before the call to microej_main()".

Hello @acmlira

I said previously to add it in the C main of your platform. It could have different names depending on the platform that is why the PQT documentation is non-committal about it. The STM32F7508-DK Platform uses this C main: https://github.com/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/blob/master/stm32f7508_freertos-bsp/projects/microej/main/src/main.c .

The startup of the firmware on this platform follows this path:

Gaëtan for MicroEJ

Hey @gaetan.harel we’re getting close :slight_smile:

So, I’m doing the final step (I think) which is the build of BSP and linkage. I got this error:

15:35:42 **** Incremental Build of configuration Debug for project application ****
make -j4 all 
arm-none-eabi-gcc "C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/projects/microej/main/src/core_portme.c" -mcpu=cortex-m7 -std=gnu11 -g3 -DUSE_HAL_DRIVER '-DDRAWING_DMA2D_BPP=16' -DSTM32F7XX -DSTM32F750xx -DUSE_STM32F7508_DISCO '-DMBEDTLS_CONFIG_FILE="mbedtls_config.h"' -c -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/projects/microej/comm/inc" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/projects/microej/config/inc" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/projects/microej/core/inc" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/projects/microej/fs/inc" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/projects/microej/hal/inc" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/projects/microej/main/inc" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/projects/microej/net/inc" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/projects/microej/ssl/inc" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/projects/microej/thirdparty/systemview/inc" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/projects/microej/thirdparty/systemview-freertos/inc" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/projects/microej/trace/inc" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/projects/microej/ui/inc" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/projects/microej/util/inc" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/projects/microej/watchdog/inc" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/sdk/Drivers/BSP/Components/Common" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/sdk/Drivers/BSP/STM32F7508-Discovery" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/sdk/Drivers/CMSIS/Core/Include" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/sdk/Drivers/CMSIS/Device/ST/STM32F7xx/Include" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/sdk/Drivers/CMSIS/Include" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/sdk/Drivers/STM32F7xx_HAL_Driver/Inc" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/third_party/FatFs/src" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/third_party/FreeRTOS/Source/CMSIS_RTOS" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/third_party/FreeRTOS/Source/include" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/third_party/FreeRTOS/Source/portable/GCC/ARM_CM7/r0p1" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/third_party/LwIP/src/include" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/third_party/LwIP/src/include/compat/posix" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/third_party/LwIP/system" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/third_party/mbedTLS/include" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/third_party/ST/STM32_USB_Host_Library/Core/Inc" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/third_party/ST/STM32_USB_Host_Library/Class/CDC/Inc" -I"C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/projects/microej/SW4STM32/platform/inc" -Ofast -ffunction-sections -mslow-flash-data -Wall -fstack-usage -MMD -MP -MF"main/src/core_portme.d" -MT"main/src/core_portme.o" --specs=nano.specs -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -o "main/src/core_portme.o"
C:/Users/acmli/Documents/MicroEJ/Platform-STMicroelectronics-STM32F7508-DK/stm32f7508_freertos-bsp/projects/microej/main/src/core_portme.c:37:33: error: 'ITERATIONS' undeclared here (not in a function)
  volatile ee_s32 seed4_volatile=ITERATIONS;
                                 ^~~~~~~~~~
make: *** [main/src/subdir.mk:134: main/src/core_portme.o] Error 1
"make -j4 all" terminated with exit code 2. Build might be incomplete.

15:36:25 Build Failed. 2 errors, 0 warnings. (took 43s.295ms)

I was looking for this ÌNTERATIONS variable and I found some similar declarations on /stm32f7508_freertos-bsp/projects/coremark/EWARM/coremark.ewp:230 & 1303 and /stm32f7508_freertos-bsp/projects/coremark/SW4STM32/.cproject:46 & 146. Maybe these files aren’t been used during the pipeline. I think I did something wrong haha

You are missing a define see the documentation of the coremark project: https://github.com/eembc/coremark/blob/e2a9f018b7066562d499dadb09064f884a624316/README.md#make-flag-iterations

Thanks @gaetan.harel :slight_smile:

So, I tried and I managed to perform all the steps but I don’t think I was successful. See the log:

STMicroelectronics ST-LINK GDB server. Version 5.5.0
Copyright (c) 2019, STMicroelectronics. All rights reserved.

Starting server with the following options:
        Persistent Mode            : Disabled
        Logging Level              : 1
        Listen Port Number         : 61234
        Status Refresh Delay       : 15s
        Verbose Mode               : Disabled
        SWD Debug                  : Enabled
        InitWhile                  : Enabled

Waiting for debugger connection...
Debugger connected
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.4.0                  
      -------------------------------------------------------------------

ST-LINK SN  : 066AFF545057717867191541
ST-LINK FW  : V2J38M27
Voltage     : 3.24V
SWD freq    : 4000 KHz
Connect mode: Under Reset
Reset mode  : Hardware reset
Device ID   : 0x449
Device name : STM32F74x/STM32F75x
Flash size  : 64 KBytes
Device type : MCU
Device CPU  : Cortex-M7



Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_a12168.srec
  File          : ST-LINK_GDB_server_a12168.srec
  Size          : 177576 Bytes
  Address       : 0x08000000 


Erasing memory corresponding to segment 0:
Erasing memory corresponding to segment 1:
Erasing external memory sectors [0 1]
Download in Progress:


File download complete
Time elapsed during download operation: 00:00:06.618



Verifying ...




Download verified successfully 


Debugger connection lost.
Shutting down...

Hi @acmlira

Do you have a .hex file (the binary firmware, result of the whole compilation)? Can you test flashing it with STM32CubeProgrammer? Here you have an issue where you downloaded the firmware but you loose the probe connection afterwards. Do you have an application starting on-board if you reset the board manually through the reset button?

Gaëtan for MicroEJ

Hey @gaetan.harel

Yes, I have the .hex file. I tried to flash it with STM32CubeProgrammer, it works but I got the same result. No application, just a white screen.

Hello

Did you use the external loader? On this board we are using the external flash so you need to be able to program it so with STM32CubeProgrammer you need to select this external loader before flashing:

Could you also provide logs of what is happening on the board? Is the VM starting?

To get back your logs you must use the UART available via mini USB port on CN14 and connect a serial terminal with the following configuration: baudrate 115200, data bits 8, stop bits 1, parity none.

Gaëtan for MicroEJ

Hey @gaetan.harel

Take a look on the flashing log:

09:02:57 : ST-LINK SN : 066AFF545057717867191541
09:02:57 : ST-LINK FW : V2J38M27
09:02:57 : Board : STM32F7508-DK
09:02:57 : Voltage : 3.24V
09:02:57 : SWD freq : 4000 KHz
09:02:57 : Connect mode: Normal
09:02:57 : Reset mode : Software reset
09:02:57 : Device ID : 0x449
09:02:57 : Revision ID : Rev Z
09:02:57 : UPLOADING OPTION BYTES DATA ...
09:02:57 : Bank : 0x00
09:02:57 : Address : 0x40023c14
09:02:57 : Size : 8 Bytes
09:02:57 : UPLOADING ...
09:02:57 : Size : 1024 Bytes
09:02:57 : Address : 0x8000000
09:02:57 : Read progress:
09:02:57 : Data read successfully
09:02:57 : Time elapsed during the read operation is: 00:00:00.007
09:03:01 : Memory Programming ...
09:03:01 : Opening and parsing file: application.hex
09:03:01 : File : application.hex
09:03:01 : Size : 4768 Bytes
09:03:01 : Address : 0x08000000
09:03:01 : Erasing memory corresponding to segment 0:
09:03:01 : Erasing internal memory sector 0
09:03:01 : Download in Progress:
09:03:02 : File download complete
09:03:02 : Time elapsed during download operation: 00:00:00.402
09:03:02 : Verifying ...
09:03:02 : Read progress:
09:03:02 : Download verified successfully
09:03:02 : RUNNING Program ...
09:03:02 : Address: : 0x08000000
09:03:02 : Application is running
09:03:02 : Start operation achieved successfully

About the logs, I think there’s no logs. The board is connected to COM3, I opened the UART using minicom via WSL2 in /dev/ttyS3 with this setup: 115200 8N1 | NOR | Minicom 2.7.1 | VT102 | Offline | ttyS3. No luck :frowning:

Hey @gaetan.harel

Thanks for helping me solve the problem. Actually it wasn’t a problem anymore, it was my fault. I’m going to describe here some tips to help others who have the same problem I had:

  • About post 6, as I wasn’t seeing output, we solved this using Termite (from CompuPhase);
  • The other mistake was using the wrong .hex, it is always worth checking the modification date and also the subfolders. In my case the .hex was in the Debug folder.