cancel
Showing results for 
Search instead for 
Did you mean: 

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

Rup
Associate

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.

2 REPLIES 2
Laurent Ca...
Lead II

Dear @Rup​ 

Many thanks for your well detailed question.

I forward internally your question.

Best regards

==

Laurent Ca...

Laurent Ca...
Lead II

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

Best regards

Laurent Ca...