Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A week ago I started messing with LoRa. I got my STM32L151 IM880A kit.

Company that provided SX1272 LoRa modem chip (used in kit), provided some libraries, but lots of functionalities are still not implemented and is still not suitable for use in multi P2P aplications.

After googling I came across Libelium company which used SX1272 chip in their products design and they provided useful set of libraries that provides lots of functionalities and also implements some sort of LoRa frame protocol stack ideal for use in P2P applications.

The problem is that I'm using STM32 in my project and Libelium libraries are written for Arduino. So I was wondering if there is a smart way to port Arduino libraries so I could use them in my STM32 Keil projects, since the libraries seems huge.

Tips, hints, links would be appreciated (I don't have experience in using Arduino and I'm not familiar with Arduino library structure).

share|improve this question

migrated from electronics.stackexchange.com Jul 20 at 19:59

This question came from our site for electronics and electrical engineering professionals, students, and enthusiasts.

    
Are you familiar with stm32/ARM cortex programming instead? – Marcus Müller Jul 19 at 9:28
    
Hey, thanks for reply. Yes I am. – Ivan47 Jul 19 at 9:47
    
You can use Arduino software on an STM32: jeelabs.org/book/1545d – JimmyB Jul 19 at 9:51
    
I don't want to use Arduino, I just want to know if it is possible to port libraries and in what measure is it convenient. – Ivan47 Jul 19 at 10:20
2  
@Ivan47 well "is it possible to port if it runs natively?": yes. "Is it easy to port": depends. Since you say you feel confident enough in doing Cortex programming: the library really isn't that big. Just port over these C++ methods you need. It'll be mainly a replacement of C++ with C (assuming you're not doing C++ on a cortex-m deliberately), and usage of CMSIS/STM32lib instead of things like arduino's "SPI" class. – Marcus Müller Jul 19 at 10:27

Every time I work on a project I use arduino libraries and port them to my micro controller. I used sublime text editor with multiple selection and editing(ctrl-d). Then I copy the arduino code to both sublime and my uC IDE then compile it in the IDE, scroll up to the first undefined function and add its definition to the code or modify it using sublime multiple editing and selecting (like digital read and write was in my opinion useless). After that update the file in your IDE and compile again.

You would do that till you have finished and it would take some time.

share|improve this answer
    
Okay, thanks for reply – Ivan47 Jul 19 at 11:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.