Skip to main content
Nimesh Khopade
Associate
February 19, 2017
Question

How should I start programming stm32f4-discovery using register level programming( NO CMSIS,HAL or SPL)?

  • February 19, 2017
  • 2 replies
  • 1675 views

Posted on February 19, 2017 at 20:31

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
February 20, 2017
Posted on February 20, 2017 at 02:08

Read the RM0090 Reference Manual and understand the bit level functionality of the peripheral registers.

For the Cortex-M4 ARM has a TRM, and Joseph Yiu has a series of books that provide alternate perspective.

Have you any other experience programming micro-controllers at this level? Can you leverage that knowledge?

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Nimesh Khopade
Associate
February 20, 2017
Posted on February 20, 2017 at 17:37

I have programmed 8051 series, pic16f series using registers, I have also used Tiva c(Tm4c123 & Tm4c1294 Launchpads) but for that I used spl in code composer studio so I have no basic Idea of programming ARM using registers.

Also,How to set Keil run time environment for register level programming?

Thank You.

Tesla DeLorean
Guru
February 20, 2017
Posted on February 20, 2017 at 18:14

Can you pull in the stm32f4xx.h, or equivalent, file and use peripheral register structures?

ie

VTOR->SCB = 0x08000000;

or

if (USART1->SR & 0x80) // TXE

  USART1->DR = 0x55;

You could create pointers at specific addresses if that is the way you want to do it.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Max
ST Employee
February 21, 2017
Posted on February 21, 2017 at 04:19

I also recommend treating the libraries provided by ST (SPL or HAL) as coding examples. 

This may save you some debugging time when accessing the hardware when a specific register access mode is required ( like for example 16-bit access or when read-modify-write operation should be avoided )

Max