ST意法半导体
直播中

庞琳

7年用户 210经验值
私信 关注
[问答]

错误的霍尔传感器交替功能

嗨,


我正在使用带有STM32F303RB和霍尔传感器的ST PMSM FOC 4.0。霍尔传感器位于PORTC引脚6,7和8上。用作tiM3通道1-3输入。代码从MC工作台生成。

症状是 - MCU将霍尔传感器信号拉低。所以我用调试器挖掘外设寄存器,发现PC6,PC7和PC7具有EVENTOUT的备用功能1。他们应该使用AF2,它是TIM3_CHx。

在名为SystemNDriveParams.h的库头文件中,有一个用霍尔传感器备用函数初始化的结构。还有一个默认的AF分配:


由于工作台不生成H1 / H2 / H3_GPIO_AF,因此它们获得默认值(AF1)。也许Workbench可以更新,因此它也可以生成正确的备用功能?

#霍尔复用功能

以上来自于谷歌翻译


以下为原文




Hi,


I'm using ST PMSM FOC 4.0 with STM32F303RB and Hall sensor. Hall sensors are on PORTC pins 6, 7 and 8. Used as TIM3 channel 1-3 inputs. Code is generated from the MC workbench.

Symptom is - hall sensor signals are pulled low by the MCU. So i digged into peripheral registers with debugger and found that PC6, PC7 and PC7 have alternate function 1 which is EVENTOUT. They should use AF2 which is TIM3_CHx.

In library header file called SystemNDriveParams.h there's a struct which is initialized with Hall sensor alternate functions. There's also a default AF assignment:



  • /* TBR after final test with WB */


  • &sharpif !defined(H1_GPIO_AF)




  • &sharpdefine H1_GPIO_AF GPIO_AF_1


  • &sharpendif


  • &sharpif !defined(H2_GPIO_AF)




  • &sharpdefine H2_GPIO_AF GPIO_AF_1


  • &sharpendif


  • &sharpif !defined(H3_GPIO_AF)




  • &sharpdefine H3_GPIO_AF GPIO_AF_1


  • &sharpendif


As the H1/H2/H3_GPIO_AF are not generated by workbench then they get the default values (AF1). Maybe the Workbench can be updated so it also generates correct alternate functions?
  
#hall-alternate-function

回帖(1)

张秀兰

2018-11-30 14:36:05
是的,这是我们已经发现的东西
/ 38f0550c
线。我们将在下一个版本中修复。 Ciao Gigi

以上来自于谷歌翻译


以下为原文





Yes, it is someting that we already discovered in
/38f0550c
thread.
We will fix in next version.

Ciao
Gigi
举报

更多回帖

发帖
×
20
完善资料,
赚取积分