Author Topic: STM32 projects not created with Cube  (Read 2718 times)

0 Members and 1 Guest are viewing this topic.

Offline luiHSTopic starter

  • Frequent Contributor
  • **
  • Posts: 612
  • Country: es
STM32 projects not created with Cube
« on: March 10, 2021, 10:37:49 pm »
 
Hi
I am loading and working with sample sources that come in the STM32Cubeide for the STM32H747.

The problem I see is that all these sources are not created with Cube, so if I want to modify anything in the configuration, for example the clock instead of with an external oscillator that is with crystal, add a serial port, interrupts, DMA, etc, I have to do it by modifying the sources manually.

Is there a way to make changes using Cube on a project that was not created with Cube?

It surprises me, because I work with the NXP Kinetis MK66 and i.MX RT and always in any project you can use the config tools from MCUXpresso to configure anything. Things like setting the GPIOs, assigning interrupts to them, setting the clock, a serial port, everything can always be done in graphical mode without the need to manually create source code.

How is it that in the STM32 if you don't create a Cube project, nothing can be configured graphically? My question is if somehow I can reverse that situation, and make a project not created with Cube become a Cube project.

Regards
« Last Edit: March 10, 2021, 10:39:46 pm by luiHS »
 

Offline thm_w

  • Super Contributor
  • ***
  • Posts: 9865
  • Country: ca
  • Non-expert
Re: STM32 projects not created with Cube
« Reply #1 on: March 10, 2021, 10:50:14 pm »
Easiest would be to make another dummy project and copy over the generated code for whatever initialization you wanted to add on.

I assume the project is already HAL based? Does it look like it was originally generated with cubemx or not?
Profile -> Modify profile -> Look and Layout ->  Don't show users' signatures
 
The following users thanked this post: luiHS

Offline luiHSTopic starter

  • Frequent Contributor
  • **
  • Posts: 612
  • Country: es
Re: STM32 projects not created with Cube
« Reply #2 on: March 11, 2021, 01:00:21 am »
Easiest would be to make another dummy project and copy over the generated code for whatever initialization you wanted to add on.

I assume the project is already HAL based? Does it look like it was originally generated with cubemx or not?


Yes, I also thought the same thing, create a Cube project, configure the clock with crystal there and then copy and replace the source part generated with Cube over the original. I also need to add a serial port, I will have to do something similar.

The original project is one of the ones that ST gives as an example with the STM32Cubeide for the H7s, but at least the ones I'm looking at are not created as a Cube project. The project has a folder with the HAL drivers.

I have also thought that if I don't see it too complicated, I would create a Cube project and there I would paste the original source code, so in the end I would have a much more comfortable project to configure and modify.

 

Offline thm_w

  • Super Contributor
  • ***
  • Posts: 9865
  • Country: ca
  • Non-expert
Re: STM32 projects not created with Cube
« Reply #3 on: March 11, 2021, 01:11:36 am »
Yeah if you plan on using it often and making many changes, pasting it into a cube project would be the way to go. Save headaches later on.

Profile -> Modify profile -> Look and Layout ->  Don't show users' signatures
 

Offline ali_asadzadeh

  • Super Contributor
  • ***
  • Posts: 2139
  • Country: ca
Re: STM32 projects not created with Cube
« Reply #4 on: March 11, 2021, 05:14:56 am »
luiHS, Do you have any good video tutorial link for NXP parts, specially the i.mX parts, how you can generate peripheral code like cube.
ASiDesigner, Stands for Application specific intelligent devices
I'm a Digital Expert from 8-bits to 64-bits
 

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1917
  • Country: se
Re: STM32 projects not created with Cube
« Reply #5 on: March 11, 2021, 09:39:52 am »
I have also thought that if I don't see it too complicated, I would create a Cube project and there I would paste the original source code, so in the end I would have a much more comfortable project to configure and modify.
This is probably the easiest way, if you want to change things later.
I personally just use CubeMX at the beginning, to set up clocks and some basic peripheral, the go on my own (with or without HAL - it depends...)-

luiHS, Do you have any good video tutorial link for NXP parts, specially the i.mX parts, how you can generate peripheral code like cube.
If CubeMX is not the best thing in this world, Config Tool from NXP is a real pain in the neck (at least for me).
Badly dimensioned dialogues, inconsistent behaviour, redundant panels, visualization bugs (Linux and Windows), and the general Eclipse unfriendliness.
In any case, you need to select and fill the fields in the "Peripherals" section of Config Tools, and it will generate initialization code.
Here is the user manual.

Nandemo wa shiranai wa yo, shitteru koto dake.
 

Offline mac.6

  • Regular Contributor
  • *
  • Posts: 226
  • Country: fr
Re: STM32 projects not created with Cube
« Reply #6 on: March 11, 2021, 10:04:25 am »
If Eclipse is not your thing (and I wonder who can be), you can at least use NXP config tool in standalone mode. There is no such option for CubeMX unless generating a full project...
 

Offline ali_asadzadeh

  • Super Contributor
  • ***
  • Posts: 2139
  • Country: ca
Re: STM32 projects not created with Cube
« Reply #7 on: March 11, 2021, 12:30:51 pm »
I hate eclipse too :'(, But the i.MXRT1170 seems very good, is there a way to generate peripheral code only and use keil to do the rest? what's your way of coding for i.mx series?
ASiDesigner, Stands for Application specific intelligent devices
I'm a Digital Expert from 8-bits to 64-bits
 

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1917
  • Country: se
Re: STM32 projects not created with Cube
« Reply #8 on: March 11, 2021, 04:18:19 pm »
My way?
Used MCUxpresso for some initial project setup (clocks mostly) and pin assignment. No peripheral code.
Then used VS Code for everything.
Debug/flash through pyocd, compile using the MCUxpresso generated makefile, clean/rebuild by launching, still from VS Code, MCUxpresso in batchmode.

I haven't touched that monster IDE in months.

EtA: I cooperate with a friend, I'm on Windows, he's on a Mac.
Apart that he doesn't grok git and C11 complex numbers, we never had any problems.
« Last Edit: March 11, 2021, 04:24:52 pm by newbrain »
Nandemo wa shiranai wa yo, shitteru koto dake.
 

Offline luiHSTopic starter

  • Frequent Contributor
  • **
  • Posts: 612
  • Country: es
Re: STM32 projects not created with Cube
« Reply #9 on: March 12, 2021, 07:02:51 am »
luiHS, Do you have any good video tutorial link for NXP parts, specially the i.mX parts, how you can generate peripheral code like cube.


I have learned through testing, it does not seem complicated, everything is quite simple. The only thing that I see something complex is the configuration of the clock, which values ​​to choose for the dividers and multipliers of the PLL. You can look at the MCUXpresso manual, when you download the software that manual comes that you can consult.

To me, Eclipse does not seem like a complex IDE, it is very complete and with many parameters, but as soon as you have used it a few times you already know where everything is, also always using IDEs based on Eclipse gives you the advantage that it is easy to use when using microcontrollers from various manufacturers.

Another thing is the plugin that each manufacturer creates for their microcontrollers, personally I think the NXP one is much better, it integrates very well to manage all the configuration graphically without having to write code. NXP also integrates into MCUxpresso the direct import of sample sources from the SDK.

I am very satisfied with the use of MCUXpresso, and Eclipse in general. I do not like having to use different products for each manufacturer, I prefer that everything is centered on a single IDE for all the microcontrollers that I use which are STM32, Kinetis and i.MX RT.

I only sometimes use Segger's Jflash program when I simply want to write the compiled program on a microcontroller, already in the production phase because it is more comfortable.

 
The following users thanked this post: ali_asadzadeh


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->