cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP1 Project from scratch STM32CubeMX problems ! (Cortex M)

debugging
Lead
  1. Select a new prject in CibeMX this case STM32Mp157AAA )
  2. Select PZ1 and PZ2 pin. Configure Pz1 output assign PZ2 for EXT IN and assign to Cortex M4
  3. Generate MX output file

Issue 1: No GPIO pin initliaziation code is generated !

  1. Load project i n AX6 workbench tool
  2. Added manual GPIO and code to main.c

Issue 2: When compiling. most errors are related to EXTI (example below)

It seems stm32mp1xx_hal.exti.h and .c are not included and compiled into the project. This is probably casued by that CubeMX did not include the GPIO pins How to do add the files to the project to compile ? The "includes" in the project does point to the include folder with the exti files.

Also noticed that when adding an I2C port, CubeMX onlu prpvided one set of SCL/SCA pin option (port H) while clicking the pins on the matrix there are many more pins supporting I2C ports. for example ZP5/6 are not shown as a choice but can support I2C.

I am able to compile the demo projects from the DK2/MP1 CubeMX package and add GPIO and eXTI code without problems but not when creating from scratch with CubeMX and AC6 workbench.

Further requested to STM:

A. Please fix CubeMX/AC6WB for the MP1

B. Try steps above. Can you reproduce ? if, yes, please fix ?

Though I am new to the MP1 and STM environment, m not sure why there are so few issues reports for the MP1/CubeMX, probably others know such typical bugs and workarounds ?

HAL_UNLOCK

../Src/main.c:307:3: error: unknown type name 'EXTI_ConfigTypeDef'; did you mean 'EXTI_Core_TypeDef'?

  EXTI_ConfigTypeDef EXTI_ConfigStructure;

  ^~~~~~~~~~~~~~~~~~

1 ACCEPTED SOLUTION

Accepted Solutions
debugging
Lead

cleaning up old issues

Cube MX does not have a function to highlight alternative pins for a pin in the list CubeMX selects at default. . Now that we are 4 years later this feature will probably will never happen. 

Have no looked at the M4 issues anymore since being too busy  bringing up a custom board design on STM32MP15 and CubeMX configuration went fine (Except for the keyboard lock issues, see another post)

 

View solution in original post

4 REPLIES 4
debugging
Lead

It seems when adding peripherals manually it is needed 1. to manual copy the .h and .c files to the related folders and 2, uncomment these hal files in the hal_conf files. Now it compiles and runs on the M4. However still having one issue that can't compile. This function/macro is defined is in lock_resource.h and lock_resource.c, and put the files both in the same folders as another project that does compile and link with this fucntion sucessfully. But just can't figure out how to include these in the project for building. Tried to add these in object.list, but that file contents gets overwritten.

Function : PERIPH_UNLOCK();

Olivier GALLIEN
ST Employee

Hi @debugging​ 

I confirm the issue related to code generation for EXTI. Sorry for that and inconvenience. I will escalate it internally.

For alternate function of pin related to I2C, I didn't notice any problem. Indeed by default it's port H which is assigned but you can force to use other pin eg PZ5 using alternate function of the pin view.

Maybe I didn't catch correctly your point ?

You are right for the procedure to follow for manual integration of peripheral.

I will have a further look to PERIPH_LOCK/UNLOCK issue you report

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.
debugging
Lead

Hi Olivier,

My, perhaps too opportunistic, expectation was that when trying to add I2C2 (or any other peripheral), MX would give a list of (still free) options. It just gave one. That resulted in assuming there were no other options, which isn't the case. Such suggestion list would be handy instead of having to going back to the datasheet or trying each GPIO one by one in MX (or perhaps there is a smarter way ?). Sorry, I am a kind of new to MX and all of this or too lazy :)

Got all compiled now except how to get lock_resource.h and lock_resource.c included in the build. Files are there but where to add them ? Which make files ? BTW, now I am planning to move over from AC6 to IDE ASAP.

debugging
Lead

cleaning up old issues

Cube MX does not have a function to highlight alternative pins for a pin in the list CubeMX selects at default. . Now that we are 4 years later this feature will probably will never happen. 

Have no looked at the M4 issues anymore since being too busy  bringing up a custom board design on STM32MP15 and CubeMX configuration went fine (Except for the keyboard lock issues, see another post)