cancel
Showing results for 
Search instead for 
Did you mean: 

LT6810 Library import in stm32H753 code

hvs_learn
Associate II

I am writing the code stm32H7ZIT6 based master to control slaves based on LTC6810 ic. Although, I am getting errors while importing the specific LTC libraries needed for making this setup work. I am trying to import specifically these libraries 
1. LT6810.h

2. LT681x.h

3. LT_SPI.h 

4. Linduino.h

but all these are dependent on arduino-based libraries. I have limited experience with stm32, can you help me with what I am doing wrong.img.png

1 ACCEPTED SOLUTION

Accepted Solutions
Andrew Neil
Evangelist III

It's not going to be a simple matter of just importing straight into STM32CubeIDE - you're going to have to "unpick" the Arduino/Linduino dependencies.

Note that there is an Arduino core available for STM32:

https://github.com/stm32duino

Might be easier to start by getting this Arduino code into that.

Or just start by getting it working in the standard Arduino IDE on a standard Arduino?

Maybe AD can provide some guidance on that?

https://www.analog.com/en/resources/evaluation-hardware-and-software/evaluation-development-platforms/linduino.html

 

 

View solution in original post

4 REPLIES 4
Andrew Neil
Evangelist III

It's not going to be a simple matter of just importing straight into STM32CubeIDE - you're going to have to "unpick" the Arduino/Linduino dependencies.

Note that there is an Arduino core available for STM32:

https://github.com/stm32duino

Might be easier to start by getting this Arduino code into that.

Or just start by getting it working in the standard Arduino IDE on a standard Arduino?

Maybe AD can provide some guidance on that?

https://www.analog.com/en/resources/evaluation-hardware-and-software/evaluation-development-platforms/linduino.html

 

 

Andrew Neil
Evangelist III

On adapting Arduino code to STM32CubeIDE (second part of post):

https://community.st.com/t5/stm32cubeide-mcus/how-to-covert-the-code-according-to-stm32cubeide/m-p/720546/highlight/true#M30694

 

The whole point of the Arduino framework is that it "hides" the underlying hardware details from you, providing platform-independent interface like "wire" for I2C and the SPI library for SPI:

https://docs.arduino.cc/language-reference/en/functions/communication/SPI/

 

So one way to take Arduino code into other ecosystems (eg, STM32CubeIDE) is to just implement those interfaces...

hvs_learn
Associate II

Hi everyone,

I’ve recently transitioned from an Arduino environment to using STM for my project. In my previous setup, I was utilizing the LTC81x and LTC6811 libraries, which relied on Arduino.h, SPI, and Linduino. Now that I’ve switched to STM, I’m trying to port the logic of these libraries to work with STM.

I would appreciate any guidance on the following:

  1. Considerations: What should I be mindful of when adapting these Arduino-based libraries to STM? Are there any key differences or specific STM functionalities I should consider?

  2. Challenges: What potential issues might arise during the process, especially with communication protocols or hardware-level differences?

  3. Library Structure: Should I aim to implement the logic of the different libraries (Arduino.h, SPI.h, Linduino.h) into one unified STM library, or would keeping them separate be more effective?

rather than start a whole new thread on the same issue, lets keep this in one.

You could un-mark the solution:

https://community.st.com/t5/community-guidelines/help-others-to-solve-their-issues/ta-p/575256#:~:text=If%20you%20accidentally%20chose%20the%20wrong%20post%20as%20solution%2C%20you%20can%20always%20revert%20this%20action%20by%20clicking%20%22Not%20the%20Solution%22

 


@hvs_learn wrote:

In my previous setup, I was utilizing the LTC81x and LTC6811 libraries, which relied on Arduino.h... 


So you already have this working on Arduino/Linduino?

Is there a particular reason to switch?

Again, there are Arduino cores for STM32...

 


@hvs_learn wrote:
  1. Considerations: What should I be mindful of when adapting these Arduino-based libraries to STM? Are there any key differences or specific STM functionalities I should consider?


One thing is to decide whether you want to keep using C++, or switch back to C.

 


@hvs_learn wrote:

 

 

Library Structure: Should I aim to implement the logic of the different libraries (Arduino.h, SPI.h, Linduino.h)

Note that these are just Header files - not Libraries.

You can structure your code in whatever way you prefer.