cancel
Showing results for 
Search instead for 
Did you mean: 

Need HELP :( A proven procedure (not trial and error) to add drivers to a core project created by MXCube.

Shaun.t
Associate III

I am designing a sensor board from scratch. It will be similar to evaluation board ..\STM32Cube\Repository\STM32Cube_FW_L4_V1.16.0\Projects\B-L475E-IOT01A.

I have tried example projects, they work great. Since ST do not have .ioc files for the this board, I do not know what IDE was used and how the codes were generated with correct configuration and correct driver files in the correct directory structure.

I tried recreating a project with this board (using CubeMX ) and adding one component only from

0693W000007EXaIQAW.jpgIt created the project with this structure

0693W000007EXtyQAG.jpgIt builds without any errors. So far so good.

Now I want to copy just one function from the example such as

 while (1)

 {

    Temperature_Test();

 }

This code will look for the associated driver files, API and other supporting configuration codes.

Can someone guide me or show me a procedure to identify the files with their locations and copy them to relevant directory and also paste the codes (with any changes if necessary) so that it will be compatible and will build without errors.

I have tried doing this, but encountered too many errors. I do not want to start debugging as the codes are from a working example for the same board. My understanding is it is more of configuration issue and adding missing driver files. Copying drivers files similar to the example project did not work, I think there is more to that than just copy.

Regards

Shaun

1 ACCEPTED SOLUTION

Accepted Solutions
Amel NASRI
ST Employee

Hi @Shaun.t​ ,

A step by step tutorial is provided in STM32 MCUs Wiki at this page.

It describes how to build your own example to collect measurements using the sensors available on B-L475E-IOT01A board.

You will find there a precision about the files that are required and where to copy then use them.

-Amel

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.

View solution in original post

3 REPLIES 3

Not my circus..

Make sure all the modules you want are pulled via stm32l4xx_hal_conf.h, and selectively enabled.

If the project directory, or sub-directory contains a copy/subset of the library files, pull them from the repository tree

..\Repository\STM32Cube_FW_L4_V1.14.0\Drivers\STM32L4xx_HAL_Driver\Src

..\Repository\STM32Cube_FW_L4_V1.14.0\Drivers\STM32L4xx_HAL_Driver\Inc

Most top level CubeMX code is boiler-plate, a lot of the meat is in stm32L4xx_hal_msp.c deals with peripheral and pin level configuration.

Use merge tools (ie AxMerge, WinMerge) to understand how different projects initialize things, and where the details are buried.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Amel NASRI
ST Employee

Hi @Shaun.t​ ,

A step by step tutorial is provided in STM32 MCUs Wiki at this page.

It describes how to build your own example to collect measurements using the sensors available on B-L475E-IOT01A board.

You will find there a precision about the files that are required and where to copy then use them.

-Amel

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.

Shaun.t
Associate III

Hi Amel,

That's a great news! I will try it out.

thank you

Regards

Shaun