cancel
Showing results for 
Search instead for 
Did you mean: 

STMC Lib - TurnOnLowSides

alexrowe6
Associate
Posted on November 19, 2014 at 23:58

Having some trouble getting my motor to start.. The code is getting stuck in the R3_4_F30X_TurnOnLowSides function. It enters the timer GetFlagStatus where it should be returning bitStatus = SET but instead is returning RESET. Any ideas on what I'm doing wrong?

Screenshots from debug:

0690X00000605EqQAI.png

0690X000006053VQAQ.png

#foc-library-stm32 #foc-lib-4.0
1 ACCEPTED SOLUTION

Accepted Solutions
mikemike9141
Associate III
Posted on March 13, 2015 at 10:09

Hi Alex,

try to disable all optimizations for the C compiler when debugging. The standard setting for the supplied projects includes full optimizations, which makes debugging almost impossible because infomration is stored in CPU registers instead of a variable, and code is reordered. Disabling optimizations may cause other problems, because the code becomes much slower. But problems here are a good indication that you run out of resources anyhow.

Regards

Frank

View solution in original post

2 REPLIES 2
Gigi
Senior
Posted on December 12, 2014 at 12:20

Ciao Alex

Trying to debug in this way is not easy.

Did you make some modifications in the code respect to the released version? If not please share the WB file you are using to configure the FW library and I'll try to replicate the issue. If you made also some code modification I suggest you to test with the original version to verify if the issue is still present.

Ciao

Gigi

mikemike9141
Associate III
Posted on March 13, 2015 at 10:09

Hi Alex,

try to disable all optimizations for the C compiler when debugging. The standard setting for the supplied projects includes full optimizations, which makes debugging almost impossible because infomration is stored in CPU registers instead of a variable, and code is reordered. Disabling optimizations may cause other problems, because the code becomes much slower. But problems here are a good indication that you run out of resources anyhow.

Regards

Frank