To follow the instructions in this Learning Path, clone or download the
Blinky example project repo
on the same machine where you have installed Arm Keil MDK and the Corstone-300 Ecosystem FVP. Double-click the Blinky.Debug+AVH.uvprojx file to open it in µVision.
To use hardware breakpoints in µVision follow the steps outlined below:
Build (F7) the example Blinky project you opened.
Start a Debug Session (Ctrl+F5) to enter the µVision debugger.
Run (F5) the application.Blinky.c in focus by clicking on its tab. If it is not visible, double-click on it in the Project window.Blinky.c, scroll down to the while (1) loop in the main function near line 42 as shown here:

while loop (for example at line 47) and a red circle will be created. This is a hardware breakpoint. The simulated Arm Cortex-M55 has eight hardware breakpoints. μVision will warn you if you exceed this limit.
while (1) (for example at line 50).
Run (F5), the program will cycle to the next breakpoint.-O0 will usually help (this is set in this example project already).
Run (F5) for the next exercise.For breakpoint expression examples, refer to the Breakpoints Window documentation.
The
Call Stack + Locals
window displays call stack contents as well as any local variables belonging to the active function. If possible, the values of the local variables will be displayed. If this is not possible, a message such as <not in scope> will be displayed. The Call Stack + Locals window visibility can be toggled by selecting View - Call Stack window.
When the program is stopped, the list of stacked functions is displayed. This is when you need to know which functions have been called and are stored on the stack. This is useful to find program flow problems such as crashes. Normal functions are displayed only when they are on the stack. They are removed and added as appropriate.
Stop icon. The program will probably stop in the Delay function.
while (1) loop at line 50 on the g_ledSet = 1;.
Run (F5) the application.
Step (F11) with Blinky.c in focus (its name in its tab is underlined).
Step (F11) a few more times.
Step Out (Ctrl+F11) to exit a function immediately.
) to continue.
Step (F11): If you click inside a source window to bring it into focus, the program will step one source line at a time. If you click inside the Disassembly window to bring it into focus, it will then step one instruction at a time.The
Watch
and
Memory
windows display variable values in real-time using Arm CoreSight technology. It is also possible to put or insert values into these memory locations in real-time using the Memory window while the program is running. You can change memory in a Watch window if data is not changing fast.
There is a global variable g_msTicks located in Blinky.c near line 11 that you can use in the Watch and Memory windows.
Run (F5) the application.g_msTicks in Blinky.c near line 11 and select Add ‘g_msTicks’ to… and select Watch 1.
g_msTicks will be displayed in Watch 1:
g_msTicks are updated in real-time if Periodic Window Update is enabled.<Enter expression> twice and enter: SystemCoreClockValue and deselect Hexadecimal Display. 32 MHz will be displayed:
You do not need to stop the program execution to enter variables, raw addresses or structures in a Watch or Memory window.
g_msTicks and select Add ‘g_msTicks ’ to… and select Memory 1.g_msTicks is displaying its address in Memory 1 as if it is a pointer. This is useful to see what address a pointer is pointing to. But this not what you want to see at this time.& in front of the variable name g_msTicks and press Enter. Now the physical address is shown (0x2000_0008) in this case. This physical address could change with different compilation optimizations.g_msTicks is displayed as shown:
g_msTicks. Since g_msTicks is updated often, you will only see the new value displayed for a very short time.
Stop the application.μVision uses Arm CoreSight technology to read or write memory locations without using CPU cycles. Most of the time, this is non-intrusive and does not impact the program execution timings. The Armv7-M/Armv8-M are Harvard architectures. This means they have separate instruction and data buses. While the CPU is fetching instructions at full speed, there is plenty of time for the CoreSight debug module to read or write to memory without stealing any CPU cycles. This can be slightly intrusive in the unlikely event the CPU and μVision reads or writes to the same memory location at exactly the same time. Then the CPU will be stalled for one clock cycle. In practice, this use of additional CPU cycles never happens.
The System Viewer provides the ability to view certain registers of peripherals and the CPU core. In many cases, these windows are updated in real-time while your program is running. They are available only in debug mode. Go to Peripherals - System Viewer to open the peripheral windows. Select CPU core registers by going to Peripherals - Core Peripherals.
The example application uses the Arm Cortex-M system tick timer.
Go to Peripherals - Core Peripherals and then select System Tick Timer S (SysTick).
Run (F5) the application.0x10000 in the SysTick -> LOAD register and click in another register or press Enter.
Stop and
Reset will also accomplish this.
Stop the application and close the SysTick Tick Timer (SysTick) window.SysTick -> LOAD register contains the reload register value. This value is set in core_cm55.h at line 4687:
SysTick->LOAD = (uint32_t)(ticks - 1UL);
The value is set to 0x007CFF = dec 31,999. This is created by (32 MHz/1000)-1 = 31,999. 1000 is specified as the timer tick value. A SysTick S interrupt 15 will occur every 1 msec. Changing the reload value changes how often the SysTick interrupt 15 occurs.Watchpoints can be thought of as conditional (access) breakpoints. Most Armv7-M and Armv8-M based processors have four data comparators. Since each watchpoint uses two comparators, you can configure two of them. The Logic Analyzer uses the same comparators in its operations. This means in μVision you must have two variables free in the Logic Analyzer to use watchpoints. μVision supports only one watchpoint.
The following does not work with the FVP used in this example. Switch to a real hardware target to use watchpoints.

Run (F5) the application.g_msTicks equals 0x44, the program will halt.g_msTicks displayed with a value of 0x44 in the Watch window:
Kill all Breakpoints in Current Target.If you put a RAM address as the expression with no value, the next read and/or write (as you selected) will cause the program to halt. This can be particularly useful in the Stack. Set an address at some limit and if the program reads or writes this address, the program stops.
0x2000_0008.
*((unsigned long *)0x20000000). Or simply enter the address as shown above.