Skip to main content
Rup
Visitor II
January 11, 2021
Question

X-Nucleo-IHM08M1 with SPI-2 on Nucleo-F303RE - how to enable peripheral pins properly?

  • January 11, 2021
  • 2 replies
  • 1147 views

Hi,

I'm using a Nucleo -F303RE with X-08 inverter board, and need to enable the SPI peripheral.

Code is built directly from the ST MC-SDK 5.4.4, (FOC mode) then examined in Cube-MX 6.0.1. Built in Keil uV5 - no change to project options given by MC-SDK.

I use the combined HAL and LL code (where offered) as this produces 5kB smaller code than pure HAL code.

Then I enabled CANbus on PB8+9 in CubeMX; "updated" and works perfectly. Full duplex command-control-reporting sub-system OK. Rx interrupts enabled (low priority).

Motor runs perfectly, and can be controlled either over my CAN or ST's MCWB console.

Then I enabled SPI2 on PB12~15 in CubeMX - and removed R74 and R86 (ZOLs) from the X-Nucleo to de-couple the SPI port pins.

Refs: Doc ID028716 UM1996; fig 10 page 15 (schematic) and table 4 page 11 (pinout list)

Does not work!

Scope attached to free GPIO pins drop from 3v3 to ca. 1V, LED2 on Nucleo dims.

However, the +5v and +3v3 rails are still fine (powered though JP9 on X-Nucleo with JP5 on Nucleo set to E5V; 12v 2A PSU on X-Nucleo).

Motor now behaves like it's running on 1 phase with noisy position feedback, about to self destruct!

I presume I have electrically cross-connected ports somewhere, or the SPI code has over-written clock or other control registers.

Q: What is the proper way to use spare microcontroller ports (e.g. SPI2) attached to multiple zero Ohm links on the X-Nucleo ?

Background; CANbus and SPI code fully developed and working (interrupts, DMA, blocking etc. etc.) on separate F303RE Nucleo board - same ecosystem. I copy developed portions into the ST motor project as I develop these modules, according to AN5166 - at least I think I have....

many thanks.

This topic has been closed for replies.

2 replies

Laurent Ca...
Senior III
March 1, 2021

Dear @Rup​ 

Many thanks for your well detailed question.

I forward internally your question.

Best regards

==

Laurent Ca...

Laurent Ca...
Senior III
May 28, 2021

The question has been moved to the "STM32 Motor Control" section only (the question is about the STM32 SDK). 

Best regards

Laurent Ca...