cancel
Showing results for 
Search instead for 
Did you mean: 

IAR and Engineering Mode

Led
Senior

I have a STM32MP157c-DK2, programming on Windows-10.

What works:

  • Build Yocto, adapt it, flash the image to the SD-Card.
  • Use STM32CubeIDE to program and debug code on CM4

My goal is to setup a proper workflow of the project, where I can integrate our standard build environment, using cmake, build scripts, IAR (not yet sure I want/need that).

Couple of issues I faces:

Setup and generate code for an empty project for the DK2 with CubeMX for IAR. Running the example code it tells me 'no MCU device found' (Using CN11 'ST-Link').

a) Do I miss some configurations?

b) Is it engineering or production mode?

c) Do I need to set the boot pins? According en.DM00591354.pdf there is no engineering mode possible with the boot pins. Is this correct? If I use Bootpins = 0x100 it behaves same way.

d) Are there reasons not to use IAR (except costs)?

Alternative would be, to work with STM32CubeIDE. But I not yet fully happy with it (still a bit buggy). And it will be difficult to integrate our continous integration build environment.

1 ACCEPTED SOLUTION

Accepted Solutions
Nawres GHARBI
ST Employee

Hi @Led​ 

could you please test with those fixes

  1. remove the verify download and use flash loader in the debugger config
  2. Specify port 2 in the STLink config
  3. Set the reset mode to core in the STLink config

Regards

Nawres

View solution in original post

20 REPLIES 20
Olivier GALLIEN
ST Employee

​Hi @Led​ ,

IAR system has been tested in both Production and Engineer mode on DK2 with some examples provided in CubeFirmware Package.

Did you try one ?

'no MCU device found' message may come from old version of IAR not supporting MP1. Which version are you using ?

Sorry for the error in en.DM00591354.pdf.

Engineering boot mode is well supported as you can see in alternative reference documentation here :  https://wiki.st.com/stm32mpu/wiki/STM32MP157X-DKX_-_hardware_description

Not that for Production mode the load of firmware to the target linux file system is not handle by IAR. You need to scp it under /lib/firmware.

I'm sorry to hear you are not fully happy with STM32CubeIDE solution. Please share your concern/issues in order I can escalate them to the team.

Hope it help

Olivier

Olivier GALLIEN
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.
Olivier GALLIEN
ST Employee

​Hi @Led​ 

'no MCU device found' is also message you get if you try to load the firmware while in Production mode.

Switching to Engineering mode should make it works.

For Production mode this require manual operation to copy firmware to target and start it.

FYI IAR has been provided as simpler enabler and we recommand and support STM32CubeIDE.  

Olivier

Olivier GALLIEN
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.

Thanks Oliver

I'm Using IAR 8.42, almost newest one.

Ah, interesting: I loaded the example GPIO_EXTI. This works (mostly - once it also failed).

Tried again with the code generated by CubeMX --> does still not work.

Steps I created it:

  • Open CubeMX version 5.6
  • Choose 'Acces to board selector'
  • Selecting the board STM32MP1-DK2
  • Generate the code for EWARM
  • Open the generated project with IAR, compile and 'download and debug'
  • Then the error occurs "Fatal: No MCU device found"

I now also checked the ST-Link parameters to be the same as for the example. Maybe there is still one wrong?

The problem with such tool is mostly that it's hard to integrate them into a continous build system. How to build a STM32CubeIDE project with Jenkins and run static analyses, doxygen documentation, CppUTest Unit Tests and coverage automatically?

Is there a command line interface to execute the build of STM32CubeIDE? In that case I could forget about IAR.

By the way i appreciate the STM32CubeIDE. Easy to start and a lot of integration. Just some starter issues. If I have time I will list some issues.

Additional note: In production mode, I can not program at all.

Led
Senior

To me it would be helpful if there is a more detailed and all-at-one-place description how to enter the engineering mode. For example, my internal notes:

o  Load an example from ST for EWARM

o  Power off the board

o  Set to boot pin to Boot0 to 0 and Boot2 to 1 (ON), which corresponds to the boot value 0x100.

o Connect USB to CN11

o  Power the board

o  IAR: Build the code, then click on Download and Debug

Potentially I have something missing as I still have issues to program with IAR...

Led
Senior

No update here? I still struggle on this and wasted now huge amount of time!

Meanwhile my code compiles with IAR and STM32CubeIDE, but I can not run or debug it. I compared all possible configuration in CubeIDE with my working example. The executed code is now also the same. Only name of project and file structure is different. Same result running the .elf file directly on Linux.

Using Engineering mode, the debugger breaks at address 0xe0bbdd0.

General question: how is the startup file handled in CubeIDE?

Olivier GALLIEN
ST Employee

Hi @Led​ 

In order I can escalate issues you are facing could you please clarify your status.

For IAR :

Understand you succeed to debug GPIO_EXTI example ? Do you confirm ?

For STM32CubeIDE :

Last comment make me think you also face problem ?

Is it project generated from CubeMX standalone or from STM32CubeIDE / CubeMX pluggin ?

Again did you succeed to debug a Cube example ?

Which version of STM32CubeIDE are you using ?

For continuous integration with STM32CubeIDE it's possible.

It's actually supported as a generic eclipse feature ( nothing ST specific)

https://gnu-mcu-eclipse.github.io/advanced/headless-builds/

BR,

Olivier

Olivier GALLIEN
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.

Hey Oliver, Thanks a lot for your reply! I appreciate this very much!

Thanks for the link of continuous integration. I will check that

Current state: I restarted the whole project setup, based on the working example I have (a combination of OpenAMP_TTY_echo and ADC_SingleConversion).

One thing I found: The own implementation of Uart and the TTY_echo Uart usage lead to a HardFault Crash when initializing the IPCC. But this does not explain why I could not even enter the Debug mode. Now that I have also removed all the functionality from the examples, I have a (hopefully) working basis to continue.

## IAR

Still the same state, but I did not investigate further (as described in my 2nd post):

- The GPIO_EXTI example does work

- The project simply generated by CubeMX does not work

## CubeIDE

- seems now to work. (But I know that my working-colleque had same issues as I)

## Open questions:

A) is the startup_stm32mp157caax.s file relevant for STM32CubeIDE? If yes, how is it linked into the project?

Led
Senior

# Improvements

While I was working I noted down things that did not work properly or were annoying and therefore cost a lot of time. I would like to send these points to ST to help to improve. Hope someone will care for maybe one or the other point.

## To improve for the ST examples

- Template is configured for STM32MP157CAAx instead of STM32MP157CACx

- Generating the project with CubeMX and the Template project do not have the same directory structure.

- Examples and Template Code have warnings

## To improve for STM32CubeIDE

- Removing a project does not execute properly. If afterwards a project with the same same is imported again, it is not possible because the project still exists in the workspace.

- Open a file main.c. Then search for something in main.c with 'File Search' (CTRL+H) and open the found item. Then the file is opened a second time and can be edited independently. This is extremely confusing. At least the files should stay in sync.

- CubeMX drawings of pinout: The picture is reloaded about 3 times everytime over 4 seconds, at every tiny change of the GUI.

- If another serial device is connected than the DK-2 board, the automatic connection results in strange errors. For example: connect an Serial-USB FTDI cable for the serial logs printed by FW, but forgetting to connect the serial console (USB-micro) connection of the DK-2.

- Renaming of the project name is not properly done. Or renaming ends in the error "exception has been caught .. Reason: null argument:". From that point on the project is rubbish.

- Often seen Java null pointer exceptions.

- After debugging I suddenly have the 'Console' window opened twice or 3 times.

- The function 'clean Project' does not always clean everything.

- Sometimes th CTRL key does not work anymore. Only restart of the program helps.

## To improve Documentation

- Add at one place a more detailed and all at one place description how to enter Engineering Mode.