12
votes
Accepted
Memory To Memory DMA on STM32
After one day really hard challenging with the problem! i finally figured out some important points that i think will be worthy for other people out there so i decided to represent them:
The STM32's ...
11
votes
I want to learn a real microcontroller with STM32F4. Which library should I use (HAL, SPL, or CMSIS)?
If you really want to learn a specific microcontroller, ditch the vendor provided libraries (which are often bug ridden anyway), and work from the datasheet to set registers up yourself.
You're best ...
10
votes
Accepted
Aren't pull-up / pull-down options documented for STM32F103?
The information you are looking for is in the manual, but not as obvious as it could be. The table you mentioned on page 160 contains more info:
As you can see, assuming the pin is configured as an ...
9
votes
Accepted
STM32F0 SPI--what am I missing?
Enable SPI_CR1_SSM.
The output now remains high-z since chip select is low.
Aside from clock setup and gpio, this is minimal init for SPI:
...
9
votes
I want to learn a real microcontroller with STM32F4. Which library should I use (HAL, SPL, or CMSIS)?
If your goal is to understand in detail how the microcontroller works, then just use the register declaration file (stm32fxxx.h) and work directly with the hardware. It is not that difficult, and for ...
7
votes
Memory To Memory DMA on STM32
You can select any stream you want (of course, DMA2 only). Channel selection is also irrelevant, because channels are related with requests. Notice the title of the Table 43, which is "DMA2 ...
6
votes
Accepted
STM32 HAL drivers
If you do not want to use the STM32CubeMX code generator tool but still need simple example projects then you should use the STM32Cubexx firmware examples that are available for all STM32 series.
...
6
votes
Accepted
How to prevent a function from overwriting memory?
You don't tell it to overwrite memory.
Read the documentation carefully. The function takes in N real-valued data points, and returns N/2 complex-valued data points. Each complex-valued data point ...
5
votes
CMSIS without HAL
I've found it.
In the properties of the project, you need to go to C/C++ build -> Settings -> Tool Settings -> Includes. In the Include paths (-l), remove the HAL-related directories and add a ...
5
votes
CMSIS vs HAL vs Standard Peripherals Library
Until now I have used CMSIS definitions and enjoyed using registers directly. Meanwhile, I used HAL libraries in few projects. It had a considerable influence on code running time so I quit it. ...
5
votes
Accepted
ARM Cortex cores with peripherals, basic requirements
This is a nice question. I was also confused when I first started working with ARM-based microcontrollers. You can certainly write code directly using the reference documentation. I do, and in my case,...
5
votes
Accepted
CMSIS - API or library
A library is a piece of code and the way you call the library code is the API.
CMSIS is basically a standard for abstraction layer for different microcontrollers - it defines the API, or the way you ...
4
votes
Accepted
CMSIS GPIO_DeInit function enable followed by disable
Those two lines reset the GPIOx peripheral. Firstly it sets the reset bit in the register to initialize the reset. Then it has to reset the reset bit to take the peripheral back to power reset state....
4
votes
Accepted
STM32F4 - RCC reset register
The Peripheral Reset Registers should cause the peripheral's entire register set and internal state to be reset to power-on defaults. This means not just the registers that are exposed to the user, ...
3
votes
FreeRTOS on STM32 - What API should be used: CMSIS-RTOS API (v1 or v2) or FreeRTOS API?
This is almost 100% opinion based answer. I personally do not like CMSIS wrappers. There is to much silly (IMO) macros and hidden objects created by them. I actually prefere freeRTOS API if I use ...
3
votes
Accepted
Difference between __I and __IO and __O in CMSIS core
"I" means: Input
"O" means: Output
"IO" means: Input and Output
As Long Pham notes, it is a naming convention, but also it is normal to use meanings to a type. Like an ...
3
votes
STM32 HAL drivers
Visit STM32 discovery .net
The guy who runs this has developed several standard and HAL libraries with examples and tutorials for each library. Also you can discuss your questions in the comment ...
3
votes
Why this Unions are required in between Structure while developing USB peripheral driver?
This struct is meant to be used to access the registers of a peripheral.
If your hardware has these registers mapped starting at memory address 0x12340000, you could declare a pointer like this:
<...
3
votes
Accepted
Which libs to use with a STM32F103C6 microcontroller?
Im going to bring you down to pretty bare baremetal, and then you can complicate this from there, but should have a much higher chance of success.
This code blinks the led on port pin PC13.
This uses ...
3
votes
STM32 on Registers Setting Up PLL, WWDG fault, Parameter/Setup Issue
I think you are assuming the register reset value is 0, but it's 0x24003010.
You can't just go ORing the bits with new N/M values and expect the values to be correct.
2
votes
CMSIS vs HAL vs Standard Peripherals Library
Comming from the 8bit world I was always used to programming peripherals via registers. Microcontroller data sheets (i.e STM32 reference manuals) describe the peripherals exclusively in register ...
2
votes
CMSIS vs HAL vs Standard Peripherals Library
I have used both, just bare metal register access and the std peripheral library. I find it easier just to deal with the registers. Also if you are using a debugger you can view the registers and ...
2
votes
I want to learn a real microcontroller with STM32F4. Which library should I use (HAL, SPL, or CMSIS)?
I agree with most of the others; you should just get the documentation from ST and start using it. It is as easy to program the peripherals directly as it is to use a vendor-provided library. There is ...
2
votes
Accepted
What is the procedure for going from discovery board to a deployable solution?
You first make a list of the components that you have used on the discovery board and how they are attached to the microcontroller - i.e. power supply, LCD, buttons, LEDs, I/O ports. Then you design a ...
2
votes
CMSIS - Peripheral Definitions - Structs With Unions Syntax?
this is what they are trying to do.
...
2
votes
Accepted
CMSIS - Peripheral Definitions - Structs With Unions Syntax?
They use unions so that you can either access the register through a 32 bit access or through individual bits. This is unfortunately a very common way to declare register maps. Unfortunate because it ...
2
votes
Accepted
Garbage in SPI RX Buffer with DMA (STM32)
Just noticed this question is still open.
Long time ago(I think in 2020) I figured what caused problem: SRAMEN bit was reset in ...
2
votes
Accepted
STM32CubeMX HAL vs CMSIS
CMSIS files are in their own folder, and HAL files are in their own folder. Regardless of which toolchain is selected.
2
votes
Difference between __I and __IO and __O in CMSIS core
Since this is for the definition of a hardware register map:
I think the reason is that C, unlike C++, allows the declaration of const qualified variables without ...
2
votes
Accepted
Does SysTick_Handler() have to be in main file?
You can put it anywhere, as long as it has the right linkage spec the linker will take care of it for you.
You don't need any header included, just ...
Only top scored, non community-wiki answers of a minimum length are eligible