Programming with STM32Cube

Thread Starter

John99407

Joined Jul 12, 2019
67
I need your attention @MrChips Perhaps you can help. I have looked your old threads on forum

I work with PIC microcontroller. I don't use MCC code generator because it generate many source and header files, which is just pain for me to manage. I read the datasheet and set hardware. This is my way of writing program for PIC microcontroller

There is no doubt, STM32Cube code generator is very useful but I don't want to use STM32Cube code generator. I want to follow same technique as I do with PIC. I don't have any idea how to start writing program from scratch for STM32 discovery board
 

MrChips

Joined Oct 2, 2009
23,528
You don't have to use any code generator or any library.
Just start writing as you would any main program.

C:
void main(void)
{
   initialize();
   while (1)
      {
         getEvent();
         doEvent();
      }
}
Be forewarned, initializing STM32 hardware modules on your own is not an easy task. That's where automatic code generation comes in handy.
 

Thread Starter

John99407

Joined Jul 12, 2019
67
You don't have to use any code generator or any library.
Just start writing as you would any main program.
Thank you MrChip for quick reply. In PIC I use #include <xc.h> at above of main function

Which header file need to include for STM32F407 discovery board above main function ?

I can't seem to find anything in documentations to point me at Which header file need to include for STM32F407 discovery board above main function ?
 

MrChips

Joined Oct 2, 2009
23,528
Why do you need a header file if you have no intention of using any library?
The simplest way to get started is to look at an example.
What IDE are you using?

Edit: Sorry, I presume you are using STM32CubeIDE?
 

MrChips

Joined Oct 2, 2009
23,528
Have you tried using STM32CubeIDE?
Simply follow the instructions and your program template will be created automatically.
At this point you need not worry about library or header file. They will be installed automatically.
 
Top