cancel
Showing results for 
Search instead for 
Did you mean: 

BUGs in STM32F0xx_StdPeriph_Lib_V1.5.0

MArgi
Associate II

I have been implementing firmware for STM32F042 and used the Std Peripheral library (v.1.5.0). I found the following bug(s):

Bug: DMA1_Channel4_5_IRQn() was never called

In file Libraries/CMSIS/Device/ST/STM32F0xx/Include/stm32f0xx.h

Line 5558:

#define DMA1_Channel4_5_IRQn       DMA1_Channel4_5_6_7_IRQn
  • DMA1_Channel4_5_6_7_IRQn is not defined for STM32F042
  • This line redefines (thus overwrite) an already correctly defined DMA1_Channel4_5_IRQn (line 344).

Line 5569:

 #define DMA1_Channel4_5_IRQHandler    DMA1_Channel4_5_6_7_IRQHandler
  • DMA1_Channel4_5_6_7_IRQHandler is NOT listed in STM32F042x6.vec.
  • DMA1_Channel4_5_IRQHandler is actually the one in the vector table.

Possible fix: remove lines 5558 and 5569.

Minor issue: unused CANx generates warning

In file: Libraries/STM32F0xx_StdPeriph_Driver/src/stm32f0xx_can.c

Add following code to line 157:

 /* Unused CANx */

 (void)(CANx);

Resetting register in a confusing way

In file: Libraries/STM32F0xx_StdPeriph_Driver/src/stm32f0xx_can.c

Line 585: CANx->sTxMailBox[transmit_mailbox].TIR &= TMIDxR_TXRQ; 

Why don't simply assigning "TIR=0x00"? It's a bit confusing the usage of TMIDxR_TXRQ (=0x01) in this line. Of course, at that point TXRQ bit is set to 0, thus the result is TIR=0x00.

Marco

3 REPLIES 3

Ok, and was that because it wasn't in the vector table, or that nothing enabled triggered it?

You're going to have to provide a worked example if you want people to review or fix things.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

I had accidentally posted the post while still editing it.

Hi @Community member​ ,

Do you reckon my description is not enough? Should I add code?