Need to use HAL libraries with Particle OS running

Hi everyone,

I am looking into a solution, which needs STM32 hal libraries/drivers into my project. Can someone help me please?

Thanks!!

Which STM32 function do you need? Many can just be called from user firmware directly. For example, this library, example 3, uses the STM32 ADC peripheral from user firmware. You don’t even need to add extra libraries or header files to your project; it just works.

The only thing that is a little tricky is interrupts. By default the interrupt handlers are attached to the system code. You need to use attachSystemInterrupt() to connect it to the STM32 SDK in user firmware instead.

Hi rickkas, Thanks for responding. I am looking for using peripherals like hardware timers and interrupts linked with the peripherals. So, I need to use the hal libraries and STM32 drivers. So, it would be great if I can have access to the drivers.

Thanks!

Hardware timers can be used from user code. Look at the source to the SparkIntervalTimer library. It also shows how to attach the interrupt to user code.

1 Like

Thanks Rick,

I will have a look at it. Can you please let me know if there is a document which lists the resources Particle OS uses?
I am interested to see any kind of hardware and software resources from STM32F205 is being used in Particle OS.

We are working on semi-automatic mode of OS in a single threaded application.

Thanks for your all help.

Happy Friday!!

The SparkIntervalTimer library lists the timers that are used by Device OS.

2 Likes

I got to read the page you sent me the link for. May be I have missed telling you that we are working on Particle Electron.
And by asking about the resources, I meant to ask every resource Particle OS is using.

The Electron is the same as the Photon. You should be able to use TIMER3, TIMER4, TIMER5, TIMER6, TIMER7. The others are used by Device OS itself.

There isn’t a list of every hardware resource used by Device OS, but the source is open source, so it’s not hard to figure out if the specific resource you need is used.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.