Showing results for 
Search instead for 
Did you mean: 

How to build and upload the binary? (b-g431b-esc1 board)

Associate II

I'm trying to get a working motor controller out of this toolchain. I apologize that I know very little about C and embedded development, although I have used arduino, I usually use Micropython. I'm sure the answer to this is painfully obvious to some people here.

I have tried many, many different driver options including SimpleFOC and some others, and I'm turning to this option out of sheer desparation, I need to drive a gimbal motor quietly at a max of about 3000 rpm. It's for an ultra quiet high pressure fan that reverses direction periodically, the openerv project. I've tried two different chips that are supposed to be no-code options, and they are unable to drive gimbal motors.

Ok, so I downloaded the three tools, stm32cubeIDE, the motor control workbench, stm32cubeMX.

I can configure my motor etc, I know my motor characteristics, so no need to run the parameter extraction tools.

Overcame some serious errors with the process of generating the code. It appears to generate code now, but there were errors about not being able to find files so I'm not clear if it worked properly.

I am now stuck at importing the project into the STM32cubeIDE. I've been trying to poke around, read help files and google for about half a day and have run aground. I the little hammer symbol is greyed out. It appears I did not import the project properly, or select or enable it or it was malformed by the previous tool, or something.

Can someone tell me the proceedure so I know how it's *supposed* to go at least? In the manual for the board, it just has a one sentence "build and upload the board using the IDE tool provided". Makes it sound so easy.

In arduino, you have your main file, you select your board, might take some configuring, and then you press upload. It compiles and uploads the program. I can't determine how to accomplish the equivalent of this in STM32cubeIDE.

Can anyone help me out?

Principal III

Here is a 5' video: which may help. With MC workbench 6.1 you find B-G431B-ESC1 under inverters.

In contrast to Arduino, you have many project files in source code visible here.

[Edit] The STM32CubeIDE project file is .project in the STM32CubeIDE subfolder of the generated code. Try opening/importing that one.



Associate II

Can you tell me the correct procedure for importing and activating a project, so that the build icon is no longer greyed out?

I already watched that video, it doesn't tell me what I need to do, unfortunately.

They seem to be assuming everything will work perfectly. In the real world, I have to know how things are supposed to go so I can troubleshoot and compensate for errors etc.

It's not clear that the motor workbench is creating the project files correctly, I think that may be why the importing process isn't working, but I can't know that without knowing how it's *supposed* to go.

In the video, the build icon is active, not greyed out, as soon as the ide opens after clicking the .project file. For me, it's all greyed out.

update: I deleted the folder and deleted the project in the IDE, regenerated the code, there were no errors this time.

I right clicked on the project and selected create run configuration, there was an option to select the c/c++ application, and I was able to make a run configuration. After that the build and run buttons work ok. I plugged my board in and it indicates that it built and uploaded the code.

However I don't see how this code is going to lead to a usable motor controller. The main.c file has a while (1) loop in it, but there is no code in it. It's all just setup code as far as I can tell.

I tried disconnecting the board from usb and connecting the power supply and turning on 12 volts with no motor. It makes a beeping noise, emanating from the motor, beeped for maybe 20 seconds, then started drawing 420 mA for no apparent reason, and gave up. Lights went off. Turning it off and back on again does nothing, it appears to be dead and continues drawing that current.

Will try to rebuild and see if it uploads again, I think it may have bricked itsself.

update: I don't know what was wrong with it, but after a short period it has started working again.

Now there is a new problem, I will post on the forum with a new thread.