cancel
Showing results for 
Search instead for 
Did you mean: 

AN1905 code example

andy4
Associate II
Posted on March 31, 2006 at 14:15

AN1905 code example

11 REPLIES 11
andy4
Associate II
Posted on May 17, 2011 at 10:19

Hi,

I have a ST7FMC BLDC starter kit. For starters, I would like to implement the code example in AN1905, but I'm new to Codewarrior and STVD7. I have the source code in an1905_3ph_sl.zip and I generated (with the GUI) the header files, MTC_Settings_Sensorless.h and Version.h.

Here's where I'm clueless... How do I create an s19 file to programm the MCU?

Here's what I've tried....

I opened an empty project in Codewarrior and added the source and include files to their respective folders. I hit F5 to debug and received a number of error messages. For example, a couple of source files (It_ST7MC.c and ports.c) were flagged for having too many procedures for the demo version. (>10). I only have the version of Codewarrior that came with the kit.

I'm sure I've skipped a step. What am I doing wrong?

Thanks, AJ

gaetano
Associate II
Posted on May 17, 2011 at 10:19

Hello,

please, be sure that you have installed the latest version of ST7MC tool package from Softec. You can find the latest version at the following link:

http://www.softecmicro.com/download.html?type=browse&title=Software

After that, you can find very detailed instructions on chapter 7 (particularly, see paragraph 7.2.3 for BLDC motors) of the User's manual.

In this way you should succeed in building up your application. If you experience still some problems, please, don't hesitate to post again in this thread.

For your information, the ST7MC motor control libraries provided with the package cannot be compiled with Metrowerks ver. 2.0 (just 1.1 is supported).

Regards,

Tanio

andy4
Associate II
Posted on May 17, 2011 at 10:19

Hi,

Thanks for the quick reply! I installed the latest verions of AK-ST7FMC and STVD for indart.

I'm stepping thru Section 7.2.3 of the User Manual. At step 13 (p. 64 of ak-st7fmc_manual.pdf), I hit a problem. When I hit ''Build'', I got a warning that the executable could not be found. It said I needed to edit my tool settings.

The workspace is located in

c:\temp\bldc_3ph_sl_2.0.

Metrowerks v.1.1 is located in

c:\Metrowerks\CodeWarrior_STM_V1.1.

STVD is in this folder

c:\program files\SofTec Microsystems

Under the General tab of Project Settings, I checked the ''Project specific toolset path'' box and entered

''C:\Metrowerks\CodeWarrior_STM_V1.1''

as the root path. Selecting Build again, I received 2 errors and 4 warnings. The error list is attached. Any suggestions?

Thanks, AJ

gaetano
Associate II
Posted on May 17, 2011 at 10:19

Hi,

from the list of errors shown in the attached document, it seems that you are working with a limited version of Metrowerks compiler... So, try to retrieve a full version.

Another point: normally when you install STVD7 toolset you are asked fro entering the Metrowerks compiler path name. You did this as mentioned by yourself, but be sure that the other settings are correct. Please, consider the attached file for your checks.

Best regards,

Tanio

andy4
Associate II
Posted on May 17, 2011 at 10:19

Thanks.

The version of Metrowerks that came with the starter kit appears to be a limited form of version 1.1.

I've scouted the Metrowerks website. Does anyone know where to download the full version of 1.1?

AJ

gaetano
Associate II
Posted on May 17, 2011 at 10:19

Hello AJ,

I warmly advise you to use the instructions provided in the Softec Starter kit User Manual you already using. In fact the provided workspaces are for STVD7 toolset and not for IDEA Cosmic IDE.

The version of used Cosmic compiler was 4.5, but successive one should not be an issue.

In this way, it is simpler for me to help us in the building process as we work on the same environments.

Regards,

Gaetano

andy4
Associate II
Posted on May 17, 2011 at 10:19

I quit looking for a full version of Metrowerks V1.1.

I downloaded and installed the latest Cosmic software. The web address is below.

http://www.cosmic-software.com/st7.php

The starter kit disk included Cosmic IdeaST7 V2.9p (Jan. 2002). I'm now using IdeaST7 V4.4.12 (Dec. 2005).

I adjusted the Build Configurations and Project Settings and hit F7 (Build). The linker found 2 errors. I've attached the error log.

Can you generate an S19 file as described in Section 7.2.3 of the AK-ST7FMC manual? If so, what software versions are you using and how did you configure your STVD7 Project Settings?

AJ

andy4
Associate II
Posted on May 17, 2011 at 10:19

Thank you for your help!

I think I originally had a problem due to out-of-date software. I now have all the above mentioned software installed on my computer.

The AK-ST7FMC user manual is very useful but it does not tell a beginner how to set the project settings. I searched the PDF for the phrases ''project settings'' and ''toolset''. They received 0 hits.

When I open STVD7, the project settings box lists either Metrowerks or Cosmic as the toolset. However, the path for the toolset is not set. This is an important step that is not mentioned in the user manual.

Once again, I tried to follow the steps in Section 7.2.3. After step 12, I opened Project Settings and selected ''ST7 Assembler Linker'' as the toolset. When I did that, the program automatically set the path. I closed the settings box and selected ''Build''. This time, it compiled without errors.

In the Release Folder, an S19 was created. (It's only 1KB in size which raises a red flag.) Following the rest of the instructions in Section 7.2.3, I can successfully program the microcontroller.

The program does not start the motor, so I'm under the impression that it did not compile correctly.

gaetano
Associate II
Posted on May 17, 2011 at 10:19

Hello AJ,

thanks for suggestions on the User Manual: I will take care to provide the modifications you are proposing.

In the meanwhile, I come again to you with some advises on how you can progress with your job.

Being given that now you have a working version of Cosmic (the 16K version is dowloadable for free from Cosmic site), set the toolset path for the compiler as described in the attached file #1.bmp. You can access this window by running STVD7 tool and then select in the main menu ''Tools->Option->Toolset''.

Then, in project settings, DO NOT select, ''ST7 Assembler linker'', but in this case, ''ST7 Cosmic'' (the path should be set by the above described step). Your window should appear as shown in the attached file #2.bmp.

I hope that, now, you are able to succeed in building-up your application.

Regards,

Tanio