cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE and C-API - not HAL

chriskuku
Senior II

I'm searching a starting point to program for a blue pill or other STM32 M3 or M4 architecture under STM32CubeIDE, but not using HAL, just plain C. Where do I find the appropriate libraries, headers and documentation?

5 REPLIES 5
Javier1
Principal

HAL is written in C, C is a languaje, HAL stands for hardware abstraction layer and its just a bunch of libraries provided by ST.

They are not perfect, not everyone uses them, if you do use them,handle with care and schepticism, i do use them.

>> but not using HAL, just plain C

Why you dont want to use it?, i get from the question youre just getting started with stm32.

Your options(from lowerest level to highest):

  1. code at register level (baremetal?), lots of the older and more knoledgeable people here do it this way. It requires a deep knowledge of how the hardware works.
  2. LL library, closer to the hardware than HAL.
  3. mBed, operative system in case you want to go higher than HAL instead of lower in the code layer stack.

>>Where do I find the appropriate libraries, headers and documentation?

Of which one

we dont need to firmware by ourselves, lets talk
chriskuku
Senior II

You might have misunderstood my level of knowledge. First off, I know C for decades. I know that HAL is a layer, not a language. I already programmed the devices in assembler. So I already dealt quite a lot with the registers etc. I just don't like HAL.

My question only aims at where I can find the documentation for the C-API, be it LL. And how do I switch off HAL when creating a C/C++ Project under STM32CubeIDE?

OTOH, even if I would be using HAL, where do I find the documentation, the #defines and available functions etc.?

>>First off

alright alright, sorry

>>I just don't like HAL.

ok

>>where I can find the documentation for the C-API, be it LL

>>OTOH, even if I would be using HAL, where do I find the documentation, the #defines and available functions etc.?

you didnt clicked in any of the links i sent didnt you XD.

basically you go to your specific chip reference manual

0693W00000WHZvnQAH.png 

>>And how do I switch off HAL

as they are just libraries, delete the corresponding ....hal.....h include0693W00000WHZxPQAX.png, or if they are still giving you trouble remove the folder from the project path.

Are you using CubeMX? to generate your code? or starting from a blank template?

we dont need to firmware by ourselves, lets talk

The thread title is misleading, it should probably be "CubeIDE and ...". CubeProgrammer is a different software, intended only to "burn" binaries into target chips.

What you may be looking for are the CMSIS-mandated device headers, which are distrubuted as part of Cube, e.g. for STM32F4xx here. You are also likely to need the processor-core-specific CMSIS headers.

Normally, build systems which come with IDEs are set up so, that after chosing the target STM32 model, all the needed headers are automagically included with a single #include, e.g. #include "stm32f4xx.h" if target is from the 'F4xx family.

If the I'm not sure how does this translate to "under CubeIDE" as I don't use CubeIDE.

JW

chriskuku
Senior II

Oh, thanks. D*mn, I dealt with so many of these recently so I intermixed. It should be STM32CubeIDE of course, how could I :)

I changed the topic accordingly.

@Javier Muñoz​ : sorry, didn't recognize there were embedded links. Did you edit your message? Since I didn't see the links in the first place. And thanks. Found the link to the HAL and LL driver manual.