cancel
Showing results for 
Search instead for 
Did you mean: 

MC-SDK 5.Y.4 code generation error

PCama.1
Associate III

Board: Custom STSPIN32G4

Debug port: external STLINK V3

MC-SDK 5.Y.4

CubeMX 6.4

Firmware: STM32 FW V1.5.0

Drive Type: HAL

Target Toolchain: ST STM32CubeIDE 1.8.0

I designed a custom inverter using an STSPIN32G4, with the same topology of EVSPIN32G4, and so that is how I initiate the project in Motor Control Workbench.

I set it up for speed control and hall effect sensors feedback as the primary and only speed sensor. I have used this setup many times before in earlier versions with no issues.

During code generation, I get the following error:

“The ST intranet updater server is unknown: mcucrosselector.codex.cro.st.com�?

0693W00000JO2gcQAD.png 

and also,

“Completed with errors�?

0693W00000JO2ewQAD.pngIn the main log, I get:

“Generation failed�?

0693W00000JO2ghQAD.png 

The code seems to compile fine in CubeIDE 1.8.0 with no errors.

I run the program on the board using ST-LINK, Connect under different modes: reset, hardware reset, software reset and often I get a tab in CubeIDE saying:

“Break at address "0x1fff4bc4" with no debug information available, or outside of program code.�?

In the console, I get the normal “Download verified successfully�?

The board does connect with Motor Pilot about 50% of the times I try, but immediately I get the following errors.

0693W00000JO2h1QAD.pngFinally, from the main dashboard I get an over current fault, but if I click on Acknowledge Fault, nothing happens.

I then run the same process with CubeMX 6.3, I don’t get any error message during code generation, but I get the same error message in Motor Pilot.

Going over the MC-SDK 5.Y.4 release notes, I go in CubeMX, MotorControl Middleware, and set DBG_MCU_LOAD_MEAS, but code will not compile with that option set.

Any suggestions, please?

16 REPLIES 16

Here is what I measured, with my power source set at 24V and spinning motor freely with no load:

At start with motor still:

0.08A -> 1.92W

Motor spinning at 570 rpm:

0.12A -> 2.88W

Motor spinning at 1002 rpm

0.15A -> 3.60W

After motor stop:

initial conditions are met

0.08A -> 1.92W

The MCU always feels very hot though, as mentioned above, around 60 or 70 Celsius. Yes, I am putting my finger on it, sorry for the ESD transgression...

I see that STSPIN32G4 work in a range of temperature up to 125 Celsius, so I is it safe to assume that I am experiencing an expected temperature for this MCU?

I played enough with the UART and concluded that mine is running reliably at 1843200. Thanks for the explanation though about why it is setup up that way.

What was really throwing me off all this time, was that one of the HALL sensors which is connected to the BOOT0 PB8 pin, and depending on the position of the motor, the hall sensor would drive that pin high, and the system would not boot at all. This became clear when I was running the motor from the power source, and then I noticed that the MCU was not running the user code, even though it was pulling a bit of current, it was also not getting hot.

So I put two and two together, which was hard since this has been an intermittent problem, but measuring the signal on the Hall sensor low, the system would run. So I wrote code to bypass BOOT0 on pin PB8 and to use nBOOT0 instead, by clearing up bit nSWBOOT0 of FLASH_OPTR register, based on RM0440 Rev 6 2.6.1 and 3.4.2 and it works like a charm.

This is something that maybe you want to add to the MC Workbench, if PB8 is being used by a Hall sensor, to change system to boot from nBOOT0 in the flash memory.

SE D.1
Associate II

@PCama.1​ 

Hi,

I'm also getting same error. But my board is EVSPIN32G4NH and Cube IDE v1.9.0.

Board: EVSTSPIN32G4NH

Debug port: Internal ST link

MC-SDK 5.Y.4

CubeMX 6.4

Firmware: STM32 FW V1.5.0

Drive Type: HAL

Target Toolchain: ST STM32CubeIDE 1.9.0

I've gone through the all answers for your question. But I don't get it.

So what need to done to remove this error?

Kindly help with this.

Hi SE D.1

If you are getting the same "Generation Failed" error when generating the code, that I refer to in my original post, what Cedric said is that that error could be disregarded, at least in my case given the screenshot I provided. I recommend you reading again his answer to my post.

He also mentioned that ST will probably fix it, but the code generated should work just fine. Once I realized that I could just ignore this error, I ran it and it worked for me.

Assuming that is the error you are referring to, try to run the generated code in CubeIDE and it should work for you too.

Best,

Paulo

Thank you PCama.1 for your reply, this'll help me to proceed further. I'll upload the code & test and then I'll let you know.

I've some more question, asked below:

  1. Are you using STSPIN32G4 Controller for BLDC motor or PMSM motor?
  2. What algorithm are you using FOC or 6 step trapezoidal control?
  3. For current sensing what topology are you using 1 shunt or 3 shunt?
  4. For speed sensing what topology are you using hall sensor or quadrature encoder or sensor less algorithm?
  5. Is the firmware developed by ST Motor Control workbench for your project is working perfectly without any error or malfunction during running?

Kindly, answer these questions that'll be great help for me.

Thanks and regards

  1. my motor is a brushless DC of the SM-PMSM type
  2. I am using FOC
  3. I am using a 3 shunt configuration
  4. I use hall encoders which gives me better low speed commutation. I find it that using sensorless makes it for a very brittle control in low speed. Having said that ST sensorless algorithm works great and for many applications that will suffice. If you are just trying to make your board work for now and see your motor spinning, I would suggest you to try that first.
  5. Again, if you configure Motor Control Workbench to run sensorless, generate code, save it to your board, the code will be running, and then you should be able to run your motor using Motor Pilot with no problems.

Good luck!

Thank you so much, @PCama.1​ .