cancel
Showing results for 
Search instead for 
Did you mean: 

Cubemx pinout rename and trouble

Md Mubdiul Hasan
Associate III
Posted on November 30, 2016 at 05:24

Hi, 

Do  you think the cubemx  chip pin renaming could make trouble ?

We have a custom board with centered MCU STM32F070RBTx.

This is not an example code, my company made it before, I need to mordarate it.

This code was build in Coo-cox environment, I have modified some of its part after changing its main MCU pinout in cubemx.

I am using mxcontants.h from co-coox to mdk-keil.

Seems like all errors coming from HAL driver that is automatically generate in MDK keil or those typical errors are coming from mismatching of cubemx code and mxcontants.h. I was trying to look up the settings in stm32f0xx_hal_conf.h, activate and inactivated some HAL_MODULE, seems like these are conflicting with other constant exists elsewhere.

 

Help me please. Take a look on attachments. Make correction please. 

Suggested me how the best way I could generate mxconstants.h.

4 REPLIES 4
Walid FTITI_O
Senior II
Posted on December 07, 2016 at 16:46

Hi

Hasan.Md_Mubdiul

,

The

Coo-cox is not supported by the CubeMx tool. Anyway, I submit your feedback.question to our cubeMx team.

-Walid F-

Posted on December 07, 2016 at 19:21

Your CubeMX config file (.ioc) is fine but it doesn't tell me much. I made a change in the clock configuration page so that the CPU is running at its specified frequency of 48MHz rather than the 8MHz you had it running at. Not sure if you are trying to save power or if you just left a default setting. If the latter, do you have an external crystal conected to the clock pins on your board? If so you probably want to use that rather than the on-chip default clock source.

I also changed the toolchain to SW4STM32 since that is what I use for most of my projects.

CubeMX generates the project just fine, and it imports into SW4STM32 and builds with no problem. Of course this just provides a framework that just initializes the pins for you and needs additional source files and/or modifications to the main.c file to have something happen. In my project I just added some code which will cause two of the pins that you assigned as outputs, PB0 and PB1 and have them generating square waves running at 5Hz, with PB1 the inverse of PB0. I'm not sure what you have these outputs connected to so this may not be safe, but I just wanted to put in some code that would do something.

If you want to try SW4STM32, to use the project attached to this message, you need to import the project into your workspace. The steps to do this are:

  1. Click the File menu at the top left
  2. About 2/3 down the list select 'Import...'
  3. In the window that opens expand the 'General' folder and select 'Existing projects into workspace' and click Next
  4. Click the 'Browse' button and navigate to the directory that contains your project (Experiment_rc in this case)
  5. Click Finish and you should see your project folder structure in the Project Explorer on the left.

You can look at the various files that CubeMX has added, and the Mods I have made to the main.c program. You should be able to build the project by highlighting the main project folder in Project Explorer and clicking the hammer Icon on the top ribbon. You can also build the project from a bunch of other menu selection paths,

I'm not sure what you want to do next, but this just provides a working project framework. Now you need to add whatever other source .c and .h files into the directory structure and rebuild the project.

  1. I think you want to avoid trying to migrate any of the project build or script files from your original CoIDE environment. You will just spend the next two months chasing ghosts and not get anything working.

________________

Attachments :

Experiment_rc.7z.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hysk&d=%2Fa%2F0X0000000bFs%2FkDxQ63Hnu4IS2vZb1Lv6RrKAF2xp1.gHyyNi3lCAjNM&asPdf=false
Posted on December 08, 2016 at 01:29

Dear Sir Aaron,

Thank you once again to help me in my project.

I made a change in the clock configuration page so that the CPU is running at its specified frequency of 48MHz rather than the 8MHz you had it running at

Yes I wanted to ask wheather my application goes in 48MHz or not.

  Not sure if you are trying to save power or if you just left a default setting.

Yes, I saw my company algorithom and previous code where power saving is absent.

If the latter, do you have an external crystal conected to the clock pins on your board?  If so you probably want to use that rather than the on-chip default clock source.

We did not include any oscillator crystal as tried to active internal clock system.

CubeMX generates the project just fine, and it imports into SW4STM32 and builds with no problem. 

I also get positive outcomes from building project in  

SW4STM32 with cubemx.

I'm not sure what you have these outputs connected to so this may not be  safe, but I just wanted to put in some code that would do something.

Some time these are LED outputs or press key input in GPIO.

use the project attached to this message, you need to import the project into your workspace.

I have done it so far, some of your instruction might be skipped. 

I'm not sure what you want to do next, but this just provides a working project framework.

  Well, my company gave me  3rd party code to develop things in their won way, we did some correction on circuit ( SPI instead of I2C).

So, cubemx GPIO pin and name has been changed. This effect fall on my coo-cox or 

SW4STM32 base  project, I was also confused about clock setting and using LSI ( went through document).

Initially, I did not have any code. So I was trying to apply our algorithm on my way. It is difficult indeed, because many application performed at the same time.

Not only cubemx, th also  need state and utilities and slandered file  what  I saw in old project.

SW4STM32 and mdk-keil both support cubemx, if you just select a IDE while importing cubemx file.

Could you kindly, attached that file you corrected here?

Regards

Hasan

Posted on December 08, 2016 at 01:52

The file I attached to my previous reply contains my complete project.  I put it in a 7Zip compressed file, and apparently the file attache process on this forum places any file uploaded in a zip file by default.  So, after downloading the file above (Experiment_rc.7z.zip) you first have to extract it from the standard Zip, which will give you Experiment_rc.7z, which you then need to extract with 7Zip (a free compression tool you can find online).  You should then have a directory of my complete project that will look the same as yours except that it has some code to blink your LEDs.