cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate LL code use STMCubeIDE? like I2C example

Ping1
Associate II

Dear All

I am new to STM32CubeIDE and imported an example project I2C_OneBoard_AdcCommunication_DMAAndIT_Init, it work well, but when I try to do same with my own project, the generated code like MX_I2C2_Init(void) is totally different with the example, it seem use all LL drivers, and my project generate HAL code, my question are:

1. How can I let my STM32CubeIDE to generate same LL driver? is use LL encouraged instead of HAL? 

2. If I use example code function like Handle_I2C_Master_TransmitReceive() to interface with generated HAL code, will it work?

3. When they generate different code, it is confusing and I cannot compare them and found which code is added by user later or generated by MX. 

 

I am using Nucleo-H563Zi board and my STM32CubeIDE version is v1.19.  

Thank you in advance.

Ping

1 ACCEPTED SOLUTION

Accepted Solutions
ELABI.1
ST Employee

Hi @Ping1,

 1. Here is an example screenshot for generating the LL driver:

ELABI1_0-1762340720878.png

 2. Yes, it will work 

ELABI1_1-1762340951860.png

You can take a look at this example in  STM32CubeH5. If you encounter any problems, please attach your IOC file.

 

3. A specific area is already reserved for USER CODE. Otherwise, you can keep a complete copy of your project and regenerate it later. Your code will be deleted, leaving only what was generated by MX. You will then be able to compare the two versions of the code

Thanks.

ELABI.1

 

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

1 REPLY 1
ELABI.1
ST Employee

Hi @Ping1,

 1. Here is an example screenshot for generating the LL driver:

ELABI1_0-1762340720878.png

 2. Yes, it will work 

ELABI1_1-1762340951860.png

You can take a look at this example in  STM32CubeH5. If you encounter any problems, please attach your IOC file.

 

3. A specific area is already reserved for USER CODE. Otherwise, you can keep a complete copy of your project and regenerate it later. Your code will be deleted, leaving only what was generated by MX. You will then be able to compare the two versions of the code

Thanks.

ELABI.1

 

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.