Author Topic: Fresh from Raw C on AVR  (Read 168 times)

0 Members and 1 Guest are viewing this topic.

Offline Hatsune_electronicTopic starter

  • Newbie
  • Posts: 1
  • Country: td
Fresh from Raw C on AVR
« on: July 05, 2024, 06:29:15 pm »
Hello
I was recently gifted a STM32401ccu6 dev board(black pill to be acc.)
And i know how to program AVR chips in C(mostly) :)
How do i begin using the STM32
These are kinda hard   |O
i have the IDE
Any advices are welcom
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4249
  • Country: nl
Re: Fresh from Raw C on AVR
« Reply #1 on: July 05, 2024, 06:39:27 pm »
Hi, and welcome on the forum.

Moving from "raw" C on AVR to STM32 ARM is not that difficult, if your "raw" means bare metal.

When familiar with register programming on peripherals in the AVR you most likely also know how to interpret the reference manual.

So get yourself the reference manual and data sheet of the STM32F401, and start reading.

First thing to get right on the STM32 is the clock setup and the enabling of the peripherals. This is different to the AVR setup. Once you did this once using the chip is not hard to learn.

See my github repositories for how it is done on some of the other STM32 chips, like for instance the F303. The principle is basically the same on the F401.

Another option is to use the Arduino environment that most likely has support for the F401 boards.

Edit: I forgot to mention that you can use any IDE that allows compiling with the GNU arm compiler. No need for the STM Cube IDE. Even a simple text editor with command line instructions to run a makefile can get you up and running.

Also very easy is to use the ST-link V2 (clones) to upload the code and even debug it. Lots of examples on how to do this are to be found on the net.
« Last Edit: July 05, 2024, 06:43:52 pm by pcprogrammer »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf