0
\$\begingroup\$

I'm beginning ARM projects with bare metal STM32F051R8 development by CMSIS core in KEIL. Used the following sequence to blink LED:

  1. Enable Reset and clock register bit (RCC) for the AHB bus controlling the LED port.
  2. Set the mode register (MODER) for the LED pin as General purpose output mode.
  3. Set output type register (OTYPER) for LED pin as Output push-pull.
  4. Set output speed register (OSPEEDR) to normal speed for the LED pin.
  5. Set the pull up down register as no pull up/ down for LED pin.
  6. In an infinite loop, set the pin bit to high/ low in the output register (ODR) to blink the LED with a delay in between.

Is the sequence above a standard for ARM Cortex M LED blink regardless of manufacturer? Or each manufacturer has its own sequence?

If it is a standard, it will make switching between manufacturers (ST, NXP, TI, etc) a less daunting task with more complicated projects where you don't have to dig through a gigantic manual.

For example, a protocol like I2C will have the same execution sequence for data transmission regardless of manufacturer, so I thought if ARM is a similar standard for MCU's. Hope I made the question clear.

Waiting to be enlightened!

\$\endgroup\$
  • \$\begingroup\$ within a manufacturer you might see the same peripherals in different chips, this uart that gpio. with st they have a couple flavors of each (uart, gpio, timers, etc) and mix and match, and the base addresses change so a good percentage of the stm32 parts have this moder/otyper gpio control in two registers, ones like the stm32f103 have the other type. since most of the code in an arm based microcontroller is not from arm there is no reason to expect across families nor brands that there is any compatibility \$\endgroup\$ – old_timer Feb 19 at 19:51
  • \$\begingroup\$ likewise the same core say a cortex-m4 can be configured differently by each vendor on each product so no reason to expect any two of those to behave the same. the big controls are documented in the technical reference manual from arm, but there are some that are not or are not obvious \$\endgroup\$ – old_timer Feb 19 at 19:52
3
\$\begingroup\$

It is not standard. The peripherals are different between manufacturers. However, within a manufacturer, the peripherals tend to be very similar (to encourage you to stick with their products since once you use one it is much faster to move between their products than someone else's). For example, I use the STM32F303 on Segger IDE and the steps and register names are identical (due to CMSIS) to yours.

Only the ARM core is the identical, which mostly doesn't matter to you as an high-level language programmer).

Since writing libraries is a lot of work...choose the manufacturer you want to learn with carefully. You're probably going to be together for a while.

Regarding your I2C comment, sure the data transmission on the OUTSIDE of the microcontroller might be the same, but that in no way shape or form means that it has to be organized and configured the same way inside the microcontroller. That's like saying because two people can talk to each other, they must both think and act alike.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.