cancel
Showing results for 
Search instead for 
Did you mean: 

''Connection Failed!'' to STEVAL-SPIN3201

peter watt
Associate II
Posted on October 24, 2017 at 09:32

Hi Community,

I'm trying to talk to to STEVAL-SPIN3201 within the Monitor of ST Motor Control Workbench (v.4.3), running on a Microsoft Surface Pro 2 Windows 8, connected by USB (COM3 at 9600 baud), but I keep getting the error message:

�Connection Failed! No response, check the communication cable, the power on the board or the baudrate (set to 9600 bps).'

Using Keil uVision v.5 MDK-Lite (debug option set to ST-Link Debugger with SW Port in Target COM) I have compiled (by batch build) and downloaded the executable to the board (shown by led LD2 blinking green/red). I actually did manage to get Workbench to connect once, by first running STM32 ST-LINK Utility v.4, connecting that to the board (which showed the address contents) and then exiting ST-LINK. Then Workbench did connect. The motor even started turning, sensorless operation, though there was an immediate Fault over Speed feedback. But repeating the same procedure after recompiling with different start-up parameters, I cannot now get Workbench to connect (for all sorts of combinations of Keil and ST-LINK connected and disconnected, on or off, unplugging and replugging USB and 32 V to board, starting and stopping Workbench and the laptop, a different USB cable). In Device Manager, it looks like the COM3 Port has a working device driver, for 'STMicroelectronics STLink Virtual COM Port (COM3)'.

To sum up, even though ST-LINK and Keil are talking to the board through the USB cable, all I can get when hitting the Connect icon (the plug) within Workbench is the red message 'Connection Failed!....'.

Any suggestions gratefully received! I've asked Technical Support too, and will post any suggestions they make.

Cheers, Peter

#st-workbench-�connection-failed�-to-steval-spin3201
7 REPLIES 7
Enrico Poli
ST Employee
Posted on October 27, 2017 at 14:31

This kind of problem is usually dueto a mismatch between the UART speed you set in the FOC library and the one you are setting on the workbench.

Please, check if the communication is ok using the atteched bin (UART speed 115200bps).

No need to connect the motor, only communication test.

________________

Attachments :

EWARM_STEVAL_SPIN3201_BullRunning_MCWorkbench.bin.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyHx&d=%2Fa%2F0X0000000b6O%2F2_zCQUKgxwwa1h77WL9BRGPdxAH32e6z1tUFa5P9E6Q&asPdf=false
Posted on November 01, 2017 at 14:05

Dear Enrico,

Thank you very much for that suggestion! Yes – it did connect! Using STM32 ST-Link Utility, I flashed the binary you sent, then in ST Motor Control Workbench Monitor, still open on the project I have been using for my motor, but with the Port setting 115200, it connected - bringing up the green 'Firmware STM32 FOC SDK Ver. 4.3.0' (which I saw in one session before, but ever since have only seen 'Device not connected' in red). I didn't have that Bullrunning motor so had no motor connected. Encouraged, I went into Control Stage Parameters, changed the Baudrate to 115200, hit Generation, built all in Keil, flashed the new code for my motor to the board, and tried to connect again at 115200 from Workbench Monitor. Alas, the same old “Communication Failed!� error.

I’m wondering if it could be because Keil does not have the STEVAL-SPIN3201 board amongst its Boards directory in Pack Installer. I have only installed the pack for the STM32F031C6 device, which

http://www.st.com/en/motor-drivers/stspin32f0.html

tells me is in

STSPIN32F0

. Might I have to select some other ST board similar to STEVAL-SPIN3201? But I may well be doing something wrong somewhere.

If you can suggest any next step from the above, I’d be very grateful again!

Cheers, Peter.

Posted on November 07, 2017 at 08:42

Hi Peter,

I'm running out of ideas.

In my opinion the best solution is to clean-up the project and restart using the 

http://www.st.com/content/st_com/en/products/embedded-software/motor-control-ic-software/stsw-spin3201.html

 software example.

It is a pre-configured setup of the MC SDK 4.3 fitting the STEVAL-SPIN3201. It is the same project I used to generate the binary I sent you.

Into the package you also find the folder 'Web\Utilities\WB_Projects\SDK43x' containing a MC Workbench project.

Open it and insert the parameters for your application for generating the new '.h' configuration files.

IMPORTANT! Before compiling, in the main.c, comment the ' ♯ define EXAMPLE_POTENTIOMETER' line.

It is not recommended to have the potentiometer feature and the uart communication enabled at the same time.

Ciao

Enrico

Posted on November 09, 2017 at 23:07

Thank you again for this follow-up suggestion. It has worked! I have been able to connect to the board by getting the supplied BullRunning motor workbench project (

SDK43x-STEVAL-SPIN3201-BullRunning.stmcx from directory STSW-SPIN3201\Web\Utilities\WB_Projects\SDK43x) working, then changing the motor parameters from within that project.  

A major first step needed, though, was to get the correct directories for the STEVAL-SPIN3201 board. I had initially followed the instructions given in UM2168 (DocID030267 Rev 2) on p. 16 which says to start the STM32F0xx_Workspace.eww (IAR's file type) and choose the Project STM32SPIN. For Keil, the equivalent multi-projects workspace is STM32F0xx_Workspace.uvmpw which I got from C:\Program Files (x86)\STMicroelectronics\FOC SDK\v4.3\STM32 PMSM FOC LIB. So I had built my project from the three directories (Common, Docs and Web) in the STM32 PMSM FOC LIB, as advised in the  STM32 PMSM FOC SDK FAQ (from the stsw-stm32100.html home page). But I think this makes projects for STM32, not specifically for the STEVAL-SPIN3201 board, and except for one time (?!), I could not get it to connect.

Instead of using that instruction in UM2168 (to use STM32F0xx_Workspace...), I think one needs to use the instruction given in the earlier user manual UM2152 (DocID030110 Rev 1) which says to use the directories (Common, Docs and Web) from STSW-SPIN3201 and to open the multi-projects workspace via the file \Web\Project\MDK-ARM\ STSPIN32F0_MC Library.uvmpw. This does create a STEVAL-STSPIN32F0 project. Another key requirement (mentioned p. 10 of UM2152 but not in UM2168) is to hit the reset button on the board after loading the binary. This can be avoided in Keil by going to Configure target options, Debug tab, St-Link Debugger Settings, Flash Download, and selecting 'Reset and Run' (as suggested in 

http://www.emcu.eu/how-to-use-the-steval-spin3201-based-on-stspin32f0/

).

In short, I think to use the STEVAL-SPIN3201 board one has to follow UM2152 not Sec 3 of UM2168 in establishing the project.

Thanks again,

Peter

Posted on November 10, 2017 at 10:34

Thanks for the feedback on our documentation. I'll forward it to the doc team in order to improve the UM2168 accordingly.

Alexander Reiss
Associate
Posted on April 14, 2018 at 10:47

Hello,

I have the same problem with System Workbench for STM32 IDE.

If I use the precompiled bullrunning binary (EWARM_STEVAL_SPIN3201_BullRunning_MCWorkbench.bin) as decribed in UM2152 the connection between the STEVAL-SPIN3201 within the Monitor of ST Motor Control Workbench (v.4.3) works fine.

Then I use the example FOC project STSPIN32F0 (User Project and MC Library) and build all with ST IDE.

If I flash the new SW, via the IDE or using the *.bin file just generated, I can not get any connection to STEVAL-SPIN3201 with the ST Motor Control Workbench (v.4.3) .

I've checked the baude rate 'USART_SPEED'  in the header file and it is the same than the one set in the workbench.

I Also set up the project completly again as mensioned before.

What can be the problem remaining?

Best regards,

Alex

Laurent Ca...
Lead II

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

Best regards