# How to use SimpleFOC official library on keil

**URL:** https://community.simplefoc.com/t/how-to-use-simplefoc-official-library-on-keil/4807
**Category:** developement
**Tags:** stm32
**Created:** [April 17, 2024, 3:50am UTC](https://community.simplefoc.com/t/how-to-use-simplefoc-official-library-on-keil/4807 "2024-04-17T03:50:20Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![HANG\_ZHOU](https://community.simplefoc.com/user_avatar/community.simplefoc.com/hang_zhou/32/6514_2.png) [@HANG\_ZHOU](https://community.simplefoc.com/u/HANG_ZHOU)
#### Post date: [April 17, 2024, 3:50am UTC](https://community.simplefoc.com/t/how-to-use-simplefoc-official-library-on-keil/4807/1 "2024-04-17T03:50:20Z")

</div>

I want to use SimpleFOC official library on keil to develop STM32f103rb board to control BLDC.Because SimpleFOC is based on Arduino,i try a plan on github declared in that structure the STM32 series MCU is compatible with Arduino syntax and is compiled and debugged on Keil( [FASTSHIFT/Arduino-For-Keil: A lightweight Arduino framework for Keil projects. (github.com)](https://github.com/FASTSHIFT/Arduino-For-Keil)).But i failed and left many errors.  
I wonder if there is a suitable plan which can use SimpleFOC official library on keil.Or else i have to use Arduino IDE to use SimpleFOC official library or use others SimpleFOC library edited.  
Thanks!

---

<div class="post-metadata">

### Author: ![JorgeMaker](https://community.simplefoc.com/user_avatar/community.simplefoc.com/jorgemaker/32/546_2.png) [@JorgeMaker](https://community.simplefoc.com/u/JorgeMaker)
#### Post date: [April 17, 2024, 9:22pm UTC](https://community.simplefoc.com/t/how-to-use-simplefoc-official-library-on-keil/4807/2 "2024-04-17T21:22:11Z")

</div>

Long, long time ago there was a Topic about someone that was able to use SimpleFOC from a CubeIDE project. Another option that you have is to use PlatformIO and from there you have access to any resource available al STM32 HAL level.

---

<div class="post-metadata">

### Author: ![VIPQualityPost](https://community.simplefoc.com/user_avatar/community.simplefoc.com/vipqualitypost/32/4420_2.png) [@VIPQualityPost](https://community.simplefoc.com/u/VIPQualityPost)
#### Post date: [April 18, 2024, 4:05am UTC](https://community.simplefoc.com/t/how-to-use-simplefoc-official-library-on-keil/4807/3 "2024-04-18T04:05:20Z")

</div>

I use SimpleFOC with PlatformIO , you can use any HAL functions just using regular STM32duino framework, it gives you plenty of control. I am not sure what additional benefit Keil has unless you are trying to roll motor control into an existing project, but for starting from the ground up, I recommend PlatformIO too 😃

---

<div class="post-metadata">

### Author: ![HANG\_ZHOU](https://community.simplefoc.com/user_avatar/community.simplefoc.com/hang_zhou/32/6514_2.png) [@HANG\_ZHOU](https://community.simplefoc.com/u/HANG_ZHOU)
#### Post date: [April 19, 2024, 12:24pm UTC](https://community.simplefoc.com/t/how-to-use-simplefoc-official-library-on-keil/4807/4 "2024-04-19T12:24:01Z")

</div>

Thanks for your advice,i am going to try to use PlatformIO.

---

<div class="post-metadata">

### Author: ![HANG\_ZHOU](https://community.simplefoc.com/user_avatar/community.simplefoc.com/hang_zhou/32/6514_2.png) [@HANG\_ZHOU](https://community.simplefoc.com/u/HANG_ZHOU)
#### Post date: [April 19, 2024, 12:28pm UTC](https://community.simplefoc.com/t/how-to-use-simplefoc-official-library-on-keil/4807/5 "2024-04-19T12:28:26Z")

</div>

lol,because i use Keil for along time.I hope i can start a project from something i konw well.But after hearing your description PlatformIO may be a good way.

---

<div class="post-metadata">

### Author: ![JorgeMaker](https://community.simplefoc.com/user_avatar/community.simplefoc.com/jorgemaker/32/546_2.png) [@JorgeMaker](https://community.simplefoc.com/u/JorgeMaker)
#### Post date: [April 19, 2024, 12:47pm UTC](https://community.simplefoc.com/t/how-to-use-simplefoc-official-library-on-keil/4807/6 "2024-04-19T12:47:30Z")

</div>

Please let us know if you are successful. I am try to integrate a CANOpen library with SimpleFoc and I’m very interested in this this topic.

---

<div class="post-metadata">

### Author: ![rom](https://community.simplefoc.com/letter_avatar_proxy/v4/letter/r/3e96dc/32.png) [@rom](https://community.simplefoc.com/u/rom)
#### Post date: [December 3, 2024, 11:21am UTC](https://community.simplefoc.com/t/how-to-use-simplefoc-official-library-on-keil/4807/7 "2024-12-03T11:21:42Z")

</div>

Hey, did you finally make it work with Canopen and PlatformIO ?

---

<div class="post-metadata">

### Author: ![JorgeMaker](https://community.simplefoc.com/user_avatar/community.simplefoc.com/jorgemaker/32/546_2.png) [@JorgeMaker](https://community.simplefoc.com/u/JorgeMaker)
#### Post date: [December 3, 2024, 8:38pm UTC](https://community.simplefoc.com/t/how-to-use-simplefoc-official-library-on-keil/4807/8 "2024-12-03T20:38:57Z")

</div>

Hi @rom … not yet ☹ May be this Christmas I have free time to try it 🙂

---

<div class="post-metadata">

### Author: ![rom](https://community.simplefoc.com/letter_avatar_proxy/v4/letter/r/3e96dc/32.png) [@rom](https://community.simplefoc.com/u/rom)
#### Post date: [December 6, 2024, 3:36pm UTC](https://community.simplefoc.com/t/how-to-use-simplefoc-official-library-on-keil/4807/9 "2024-12-06T15:36:41Z")

</div>

Oh yes, could be very helpfull. I will try by my side, keep you updated if I get this working

---

<div class="post-metadata">

### Author: ![Peter\_den\_Toom](https://community.simplefoc.com/user_avatar/community.simplefoc.com/peter_den_toom/32/8012_2.png) [@Peter\_den\_Toom](https://community.simplefoc.com/u/Peter_den_Toom)
#### Post date: [December 15, 2024, 7:46pm UTC](https://community.simplefoc.com/t/how-to-use-simplefoc-official-library-on-keil/4807/10 "2024-12-15T19:46:26Z")

</div>

I would be very interested in the implementation of a fast and reliable communication protocol working with simpleFOC. Maybe we could also make something work related to the simulink questions.

---

<div class="post-metadata">

### Author: ![runger](https://community.simplefoc.com/user_avatar/community.simplefoc.com/runger/32/395_2.png) [@runger](https://community.simplefoc.com/u/runger)
#### Post date: [December 16, 2024, 1:19pm UTC](https://community.simplefoc.com/t/how-to-use-simplefoc-official-library-on-keil/4807/11 "2024-12-16T13:19:22Z")

</div>

What are the requirements you are thinking about?

It’s a complex topic because use cases are quite different and so everyone has slightly different requirements…

We have code for Serial and I2C communication based on registers in the SimpleFOC Drivers repository and there are examples for CAN based communication for some MCU types done by the community…

However, I feel we have digressed a lot from the original topic of this thread and should really start a new one for your comms related discussion…

---

<div class="post-metadata">

### Author: ![rom](https://community.simplefoc.com/letter_avatar_proxy/v4/letter/r/3e96dc/32.png) [@rom](https://community.simplefoc.com/u/rom)
#### Post date: [January 2, 2025, 3:38pm UTC](https://community.simplefoc.com/t/how-to-use-simplefoc-official-library-on-keil/4807/12 "2025-01-02T15:38:40Z")

</div>

Hi @JorgeMaker , did you have time to work a bit on CanOpen finally ? Having troubles to make it work with my B-G431… 😃

---

<div class="post-metadata">

### Author: ![Peter\_den\_Toom](https://community.simplefoc.com/user_avatar/community.simplefoc.com/peter_den_toom/32/8012_2.png) [@Peter\_den\_Toom](https://community.simplefoc.com/u/Peter_den_Toom)
#### Post date: [January 3, 2025, 9:46am UTC](https://community.simplefoc.com/t/how-to-use-simplefoc-official-library-on-keil/4807/13 "2025-01-03T09:46:16Z")

</div>

Hey @runger,

I don’t have fixed requirements on bandwidth for example. My comment was related to @JorgeMaker and @rom that it has my interest. I think serial would be too slow for the things I would like to do. The I2C communication and CAN based communication examples I have not investigated yet. Maybe I will do so in the near future.

The simulink part of my answer is related to the desire to do some decent controller tuning by making an (Frequency Response Function) FRF for example. In Simulink this would be much easyer and would give a good approach on how to tune PID parameters. The architecture for this I am currently thinking of is having two STM boards side by side where one would run Simulink in real time by employing I2C blocks for example: [https://nl.mathworks.com/help/ecoder/stmicroelectronicsstm32f4discovery/ref/i2ccontrollerwrite.html](https://nl.mathworks.com/help/ecoder/stmicroelectronicsstm32f4discovery/ref/i2ccontrollerwrite.html).

I also feel we have moved to far from the topic. This comment was intended to clarify my answer from 15-12-24.

Best wishes for 2025.
