Follow+Star Public Account Number, don’t miss wonderful content
Author | strongerHuang
WeChat Official Account | strongerHuang
Cortex-M is an ARM core designed for MCU, launched about 20 years ago, and the most classic is the Cortex-M3 core, which is one of the most widely used cores on the market today.
Currently (2024-09), the latest and most powerful microcontroller core is Cortex-M85.
https://www.arm.com/zh-TW/product-filter?families=cortex-m

Cortex-M85 has upgraded many functions compared to the Cortex-M3 core, making it more powerful.
So, as an ordinary user (developer), what are the differences in usingCortex-M85 andCortex-M3 core microcontrollers?
Microcontroller developers are most familiar with the core_cm3.h (core_cm85.h) files, which define most of the content related to the core, and we often call interfaces from here.
Let’s compare these two source files:

By comparing the source code, you will intuitively find that cm85 has significantly more lines than cm3, with 1943 lines and 4672 lines respectively. Of course, with so many more lines, the left side red (differences) part is also relatively large.
Although there are more left-side “red” parts, most of them are additional lines and macro definitions. Upon careful comparison, many are actually the same, such as the commonly used system reset function:

For example, the system Tick configuration function:

In fact, you will find that the function interfaces commonly used on the Cortex-M3 microcontroller are basically the same as those on the CM85, which also indicates that most interfaces of CM85 are backward compatible with CM3.
Cortex-M85 Microcontroller SysTick
A timer is a commonly used module in microcontrollers, whether for delays or RTOS heartbeat (system clock), a timer will be used. Therefore, Arm considers this situation, integrating a SysTick module into every Cortex-M core.
Here, I will explain the usage of SysTick with the Renesas RA8D1 (Cortex-M85 core) microcontroller.
Using e2 studio and fsp software package
The software package that comes with the tool is actually the most practical. Here, I will take IO flipping and SysTick delay as examples, teaching you step by step how to create a project and demonstrate the effect.
1. Open e2 studio to create a microcontroller project
We named the project: RA8D1_SysTick

Select the corresponding chip model: R7FA8D1BEC




Basically, you only need to click a few buttons, and a complete project is created.
Here, we configure some basic information, using an IO (PA01) to test the SysTick delay time.

Configure the clock tree:

Configure the output Hex file:


This is just a simple demonstration demo, we add an IO flip to test SysTick delay time.

This is a 1ms toggle, and the SysTick delay error is relatively small, the error can be ignored compared to 1ms.

The sampling frequency is 100MHz, and you can still see some error. Of course, this error is influenced by various factors such as the crystal oscillator and software. Also, the us-level error can be ignored relative to ms.

If changed to 1us toggle, testing through IO flip, the error becomes relatively noticeable.
4. Source Code Description
Experienced engineers should be able to understand this, but here is a simple explanation for beginners.
To reduce the error caused by software, here we directly manipulate the register for IO flipping.
R_BSP_SoftwareDelay: a blocking delay function, is a function interface provided by the FSP software package.
BSP_DELAY_UNITS_MILLISECONDS: macro definition, delay unit (milliseconds).
The system defines three macros:
R_BSP_SoftwareDelay: actually utilizes SysTick for delay.
Further analyzing the code, you can see that the lower-level calls to SysTick are the same for CM0, CM23, etc. Therefore, you will find that there is not much difference in the usage of SysTick between Cortex-M3 and M85 microcontrollers.
●Renesas RA8 Series Tutorial | Introduction to Renesas RA8 Series Microcontrollers
●Renesas RA8 Series Tutorial | Setting up the Renesas RA8 Development Environment
●Renesas RA8 Series Tutorial | Developing RA8 Microcontroller Based on Keil
●Renesas RA8 Series Tutorial | Implementing RA8 Serial Output Configuration Based on e2s
Follow the public accountReply “Join Group” to join the technical exchange group according to the rules, reply “1024” to see more content.
Click “Read the Original” to see more shares.