Cortex-ARM Learning is a VSCode Debugger extension intended to be used with ARM Assembly Language programs.
The debugger is built off of the existing extension Cortex Debug.
Cortex-ARM Learning is equipt with additional UI features that will aid early-stage programmers with the learning of Assembly Langugage and the concepts that are involved.
Build button can be found on the bottom left of the Status Bar of your VSCode Window.
Note: the button will only appear once the debugger is activated but will remain when debugger is exited.
Builds your ARM Project. Any errors in your ARM code, found in your main.s file, will appear here. Once the project has built the project is ready to be debugged.
The register window appears once you are debugging. It shows the values of all registers avaliable to ARM.
Shows the values of the register in:
The performance counter can be found in the left-side window along with the register view. It shows the current cost of the program,in main.s, in instruction cycles.
The stack interface window appears once you are debugging. Once initialised, the current Stack Pointer {SP} is shown at the top of the stack.
Following the live stack pointer, any values that are pushed onto or popped off of the stack, their memory values are shown. While the current stack pointer is pointed to.
Note: The stack window physically grows upwards when pushed onto, but note that the stack pointer value is decreasing in value.
Ctrl + Shift + P to open commands.
Selecting Cortex-ARM Array command
Enter the hexidecimal start address of the array. Example:
Enter the element size of the elements of your array.
Example:
Enter the dimensions of your array. Like a standard high-level language array where; array[i,j]. Enter your array ny number of rows followed by a comma, followed by the number of columns.
Note: If your are working with a 1-D array just input one number: the length of the array.
Example where array = [5,4]
Enter how you would like the values of the array to be displayed. For decimal numbers, you can view in decimal. For a word, you can view in ascii.
Example:
Result:
This opens a text document that holds:
These features are all in addition to the already existing features of the debugger which include the following:
Install this extension.
Ctrl + Shift + P to open commands.
"cortex-debug.armToolchainPath": "${env:VSARM}\\armcc\\bin\\",
"cortex-debug.JLinkGDBServerPath": "${env:VSARM}\\JLink\\JLinkGDBServer.exe"
Use CortexARM Project File when creating your project file to debug. Edit only the main.s file.
To setup your VSCode to be able to run Assembly Code through a board. Further documentation can be found at this tutorial.
Create a folder in your C drive: 'C:', named VSARM to hold all downloads in the same directory.
This is our compiler to use to compile ARM Assembly Code.
Download file indicated gcc-arm-none-eabi-9-2019-q4-major-win32.exe
Note: Download file to C:\VSARM.
Rename download foler, in C:\VSARM, to: armcc.
Then you must add the following path:
C:\VSARM\armcc\bin
to your PATH variable located in the System Variables in your system's Enviornment Variables. To see how to do this follow the tutorial.
Note: The command is run while the current dierctory is C:
STLink and JLink are links used to communicate between your board and your computer. If your board is configured with STLink, change it to JLink.
Flash board to be used with JLink rather than STLink using STLink Reflash. Using option (1)Upgrade to JLink.
Download J-Link Software and Documentation Pack
Note: Download file to C:\VSARM.
Currently Setup for STM32F411 Cortex M-4 core.
If have a different version of the board, find .svd file and add to .ignore file and in vscode folder, change launch file for project, according to your board.
Pull requests are welcome.
This extension is built upon Marcus's (marcus25) Cortex Debug extension (https://marketplace.visualstudio.com/items?itemName=marus25.cortex-debug). His project provided an excellent debugger.