Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In code Composer Studio, I am having some issues building the program. I am using a ARM Cortex M4F based TIVA C Series Launchpad (TM4C123GXL)

In code Composer Studio, I am having some issues building the program. I am using a ARM Cortex M4F based TIVA C Series Launchpad (TM4C123GXL) and version 7.4 of Code Composer Studio. In part 1 and 2 labs, I followed the steps and go to compile the programs, but it gives me errors. I could use some help figuring out what is going on.

Lab 3 part 1

image text in transcribed

Lab 3 part 2

image text in transcribed

The errors I'm getting

Part 1

image text in transcribed

Part 2

image text in transcribed

ENT387 Lab-3 Introduction to ARM assembly programming spring 2020 In this exercise, you will gain some access of assembly language programming in TI CCS environment. TI CCS v6 allow mixed mode programming. Programmer can write some section of code in standard C language while the other section in assembly language. In this programming exercises, you will be given exposure of how to write small assembly function in TI CCS environment. C language provides a great portability while considering moving from one target to another. Therefore, now a day's most often code is written in C language while performance critical sections are commonly written in Assembly language for better power / speed optimization. Target: Tixa TM4C123GH6PM, Project Templates and examples: Empty Assembly only project Project name: Lab3Part1 Hit finish to create project in project explorer (view project explorer). 3. Right click on bold letter project name new > file. 4. In file name field type Lab3Part1.asm and hit finish button This will create above named empty file in your project. 5. Copy following code into this file. .global main ; makes main accessible outside to this file . thumb ; execute more optimized thumb instructions .data .align 2 data section in SRAM area ; align to 16 bit boundry .word Ox100 ; global variable x It is often overwhelming information to process while you are addressing assembly language programming of a typical microcontroller or microprocessor. Specifically, high end application processor such as ARM processor and DSP processor, it is really hard to remember and deal with assembly syntax of hundreds of instruction from instruction set. Also, from processor to processor even from same vendor there could be significant change in assembly language instruction set. Therefore, in this lab exercises, you are provided some of the basic functionalities with ARM assembly operation and TI CCS environment configuration. It is recommended to go through provided reference material to get better in depth knowledge of assembly language programming. However, in this course mainly you are focusing on utilizing highly optimized library functions to build application programs which is more standard approach of given embedded environment in a typical industry. .text code section .align 2 ; align to 16 bit boundry .field x, 32; 32-bit pointer pointing to x otr main: asmfuns ; start of asm function code LDR R1, ptr ; load address of x into register R1 LDR RO, [R1] ; copy value of x into RO ADD RO, RO, #0x10; RO = RO + Ox10 STR RO, [R1] ; store content of RO at x endasnunc ; end of asm code .end ; end of file To alleviate a pain from programmer's shoulder, it is a typical industrial practice now a days to offer optimized C library for various sections of controller programming. These library typically consisting C calling assembly function to handle routine tasks such as initializing clock, inputs/outputs, configuring built-in ADC/DAC, timers, and many more. Typical libraries provided by Texas Instrument Inc., are Chip Support Library (CSL or drivers), Board Support Library (BSL), graphics library, and USB library. Follow these steps to write and initialize TI CCS environment for assembly language programing for ARM Cortex M4F based TIVA C Series Launchpad. Part-1: In RAM area store 0x100 value and add value 0x10 to it. 6. Now, expand the project explorer. Right click on "tm4c123gh6pm_startup_ccs.d" file and from pop-up menu select exclude from build. This will remove standard c startup file from build process. 7. Select project properties. Expand Build Expand ARM linker Advanced Options Symbol Management. Select "Specify entry point for output module" Type main. Hit OK. 8. Save and build project. (Project Build project) 9. Run this project. (Run Debug (F11)) 10. From View Registers, expand Core Registers. 11. Hit Step into (F5) button, this will execute your code line by line. Observe the contents of registers those are changing with your program statements. Go to view memory browser, in search field type ptr. This will show pointer location and content of pointer. This pointer is pointing to x into SRAM area. You can observe this SRAM location by simply typing hex address of pointer in memory search bar pointing to address of x. First of all, you have to initialize TI CCS environment by creating empty project. Here, you can create empty project and add assembly language file to it. 1. Open TI CCS v7 or any recent version. 2. Create new project. Goto File New project. This will open project wizard. Make sure following parameters. connection: Stellaris in Circuit Debug Interface, ENT387 Lab-3 Introduction to ARM assembly programming spring 2020 Vess: word w Stack; initial stack pointer .word _c_intoo ; the reset handler In this part-2 of assembly language programming exercises, you are focusing on creating assembly only projects using TI CCS v6 ARM compiler tools. ; User program area .thumb Follow these steps to write and initialize TI CCS environment for assembly language programing for ARM Cortex M4F based TIVA C Series Launchpad. .text .align 2 uyStart: ; Your code start here MOV RO, #0X11 LSL R1, RO, #1 LSL R2, R1, #1 Part-2: Creating assembly only project in TI CCS First of all, you have to initialize TI CCS environment by creating assembly only empty project. Here are the steps to create assembly only single project in your environment. ; Your code finished here Infloor: B Infloor end 8. Save and build project. (Project Build project) 9. Run this project. (Run Debug (F11)) 10. From View Registers, expand Core Registers. 11. Hit Step into (F5) button, this will execute your code line by line. Observe the contents of registers those are changing with your program statements. Go to view memory browser if you feel necessary to see SRAM/Peripheral location. 1. Open TI CCS. 2. Create new project. Goto File New project. This will open project wizard. Make sure following parameters. connection: Stellaris in Circuit Debug Interface, Target: Tiva TM4C123GH6PM, Project Templates and examples: Empty Assembly-only Project Project name: Lab3Part2 Hit finish to create project in project explorer (view project explorer). 3. Now, exclude from build tm4c123ghpm_startup_ccs.c from your project. (Do not delete tm4c123gh6pm.cmd file) 4. Now, from Project menu properties expand Build expand ARM linker file search path. From upper box "include library file or command file as input" delete "libs.a". You can delete it by hitting radio button just above the box. This library is a runtime support library for C file. We are building our own assembly only project including reset vector. Therefore, this library file, we are omitting for build process. 5. Right click on bold letter project name new file. 6. In file name field type Lab3Part2.asm and hit finish button This will create above named empty assembly file in your project. 7. Copy following code into this file. Part-3: Calculate factorial of a number using assembly loop In this part of exercise you will write simple program to calculate factorial value of a number. Factorial value of a positive integer n is given by n! = n x(n-1) (n-2) X.......2 x 1 Although, you can create a new project and work here. It is just nice option to modify above file and update it with new code. All you need to do is delete three lines of earlier code between your code start here" and "your code finished here" and replace this area by adding following subsection of the program. ; this is assembly only project global mStart, mystack, ResetISR, _c_intoo, Vess. ; This is the Reset Handler _c_int00: BwStart ; Your code start here MOV R6, #5 MOV R7, #1 CMP R6, #1 MUL R7, R6, R7 SUB R6, R6, #1 BGT L1 ; Your code start here ; Here we define the stack myStack .usest ".stack", 0x400 retain ". intress" .sect ".intvecs." TIL LUIL VIL W Tuviyull TIUJCCL TULJCUPLU VITLOV TICI :20 --> Quick Access: # 3 Getting Started C main.c S Lab3part1.asm X 1.global main ; makes main accessible outside to this file .thumb ; execute more optimized thumb instructions .data .align 2 ; data section in SRAM area ; align to 16 bit boundry 8x: .word Ox100 ; global variable x 10 11 12 ptr .text ; code section .align 2 ; align to 16 bit boundry .field x, 32; 32-bit pointer pointing to x 14 main: .asmfunc ; start of asm function code LDR R1, ptr ; load address of x into register R1 LDR RO, [R1] ; copy value of x into RO ADD RO, RO, #0x10; RO = RO + 0x10 STR RO, [R1] ; store content of RO at x .endasmfunc; end of asm code .end ; end of file - 0 Console X - Lab3Part_1 CORTEX_M4_0: GEL Output: Memory Map Initialization Complete CORTEX_M4_0: GEL: Encountered a problem loading file: C:\Users\Mach9\workspace_v7\Lab3Part_1\Debug\Lab3Part_1.out Could not of Resource Path Location Problems x Advice 3 errors, O warnings, 0 others Description v Errors (3 items) [E0002] Illegal mnemonic specified gmake: *** [Lab3part1.obj] Error 1 @gmake: Target 'all' not remade because of errors. /Lab3Part_1 line 1 Lab3part1.asm Lab3Part_1 Lab3Part_1 - Kun Scripts Window Help 2 * >> Quick Access : E a Getting Started main.c Lab3part1.asm LabPart3.asm X 1; this is assembly only project global myStart, myStack, ResetISR, _c_intoo, _Vecs 5; This is the Reset Handler 6_c_int00: B myStart 13 8; Here we define the stack 9 myStack .usect ".stack", Ox400 10 retain ".intvecs" 11 sect ".intvecs" 12 Vecs: word myStack; initial stack pointer .word_c_intoo, the reset handler 14 15; User program area 16 .thumb 17 18 .text 19 .align 2 20 myStart: 21 Your code start here 22 MOV RO, #0X11 LSL R1, RO, #1 LSL R2, R1, #1 23 26 ; Your code finished here 27 InfLoop: B InfLoop 28 T.end 29 Console X CDT Build Console (Lab3Part2] "../tm4c123gh6pm.cmd", line 45: error #10104: undefined symbol "_stack" used in expression error #10010: errors encountered during linking; "Lab3Part2.out" not built Problems x Advice - A 4 errors, 0 warnings, O others Description Res. v Errors (4 items) #10010 null: errors encountered during linking; "Lab3Part2.out" not built Lab #10104 undefined symbol "_stack" used in expression tm4 @gmake: *** [all] Error 2 Lab. gmake[1]: *** [Lab3Part2.out] Error 1 >> Compilation failure makefile:140: recipe for target 'Lab3Part2.out' failed gmake[1]: *** [Lab3Part2.out] Error 1 makefile: 136: recipe for target 'all' failed gmake: *** [all] Error 2 Lab **** Build Finished **** ENT387 Lab-3 Introduction to ARM assembly programming spring 2020 In this exercise, you will gain some access of assembly language programming in TI CCS environment. TI CCS v6 allow mixed mode programming. Programmer can write some section of code in standard C language while the other section in assembly language. In this programming exercises, you will be given exposure of how to write small assembly function in TI CCS environment. C language provides a great portability while considering moving from one target to another. Therefore, now a day's most often code is written in C language while performance critical sections are commonly written in Assembly language for better power / speed optimization. Target: Tixa TM4C123GH6PM, Project Templates and examples: Empty Assembly only project Project name: Lab3Part1 Hit finish to create project in project explorer (view project explorer). 3. Right click on bold letter project name new > file. 4. In file name field type Lab3Part1.asm and hit finish button This will create above named empty file in your project. 5. Copy following code into this file. .global main ; makes main accessible outside to this file . thumb ; execute more optimized thumb instructions .data .align 2 data section in SRAM area ; align to 16 bit boundry .word Ox100 ; global variable x It is often overwhelming information to process while you are addressing assembly language programming of a typical microcontroller or microprocessor. Specifically, high end application processor such as ARM processor and DSP processor, it is really hard to remember and deal with assembly syntax of hundreds of instruction from instruction set. Also, from processor to processor even from same vendor there could be significant change in assembly language instruction set. Therefore, in this lab exercises, you are provided some of the basic functionalities with ARM assembly operation and TI CCS environment configuration. It is recommended to go through provided reference material to get better in depth knowledge of assembly language programming. However, in this course mainly you are focusing on utilizing highly optimized library functions to build application programs which is more standard approach of given embedded environment in a typical industry. .text code section .align 2 ; align to 16 bit boundry .field x, 32; 32-bit pointer pointing to x otr main: asmfuns ; start of asm function code LDR R1, ptr ; load address of x into register R1 LDR RO, [R1] ; copy value of x into RO ADD RO, RO, #0x10; RO = RO + Ox10 STR RO, [R1] ; store content of RO at x endasnunc ; end of asm code .end ; end of file To alleviate a pain from programmer's shoulder, it is a typical industrial practice now a days to offer optimized C library for various sections of controller programming. These library typically consisting C calling assembly function to handle routine tasks such as initializing clock, inputs/outputs, configuring built-in ADC/DAC, timers, and many more. Typical libraries provided by Texas Instrument Inc., are Chip Support Library (CSL or drivers), Board Support Library (BSL), graphics library, and USB library. Follow these steps to write and initialize TI CCS environment for assembly language programing for ARM Cortex M4F based TIVA C Series Launchpad. Part-1: In RAM area store 0x100 value and add value 0x10 to it. 6. Now, expand the project explorer. Right click on "tm4c123gh6pm_startup_ccs.d" file and from pop-up menu select exclude from build. This will remove standard c startup file from build process. 7. Select project properties. Expand Build Expand ARM linker Advanced Options Symbol Management. Select "Specify entry point for output module" Type main. Hit OK. 8. Save and build project. (Project Build project) 9. Run this project. (Run Debug (F11)) 10. From View Registers, expand Core Registers. 11. Hit Step into (F5) button, this will execute your code line by line. Observe the contents of registers those are changing with your program statements. Go to view memory browser, in search field type ptr. This will show pointer location and content of pointer. This pointer is pointing to x into SRAM area. You can observe this SRAM location by simply typing hex address of pointer in memory search bar pointing to address of x. First of all, you have to initialize TI CCS environment by creating empty project. Here, you can create empty project and add assembly language file to it. 1. Open TI CCS v7 or any recent version. 2. Create new project. Goto File New project. This will open project wizard. Make sure following parameters. connection: Stellaris in Circuit Debug Interface, ENT387 Lab-3 Introduction to ARM assembly programming spring 2020 Vess: word w Stack; initial stack pointer .word _c_intoo ; the reset handler In this part-2 of assembly language programming exercises, you are focusing on creating assembly only projects using TI CCS v6 ARM compiler tools. ; User program area .thumb Follow these steps to write and initialize TI CCS environment for assembly language programing for ARM Cortex M4F based TIVA C Series Launchpad. .text .align 2 uyStart: ; Your code start here MOV RO, #0X11 LSL R1, RO, #1 LSL R2, R1, #1 Part-2: Creating assembly only project in TI CCS First of all, you have to initialize TI CCS environment by creating assembly only empty project. Here are the steps to create assembly only single project in your environment. ; Your code finished here Infloor: B Infloor end 8. Save and build project. (Project Build project) 9. Run this project. (Run Debug (F11)) 10. From View Registers, expand Core Registers. 11. Hit Step into (F5) button, this will execute your code line by line. Observe the contents of registers those are changing with your program statements. Go to view memory browser if you feel necessary to see SRAM/Peripheral location. 1. Open TI CCS. 2. Create new project. Goto File New project. This will open project wizard. Make sure following parameters. connection: Stellaris in Circuit Debug Interface, Target: Tiva TM4C123GH6PM, Project Templates and examples: Empty Assembly-only Project Project name: Lab3Part2 Hit finish to create project in project explorer (view project explorer). 3. Now, exclude from build tm4c123ghpm_startup_ccs.c from your project. (Do not delete tm4c123gh6pm.cmd file) 4. Now, from Project menu properties expand Build expand ARM linker file search path. From upper box "include library file or command file as input" delete "libs.a". You can delete it by hitting radio button just above the box. This library is a runtime support library for C file. We are building our own assembly only project including reset vector. Therefore, this library file, we are omitting for build process. 5. Right click on bold letter project name new file. 6. In file name field type Lab3Part2.asm and hit finish button This will create above named empty assembly file in your project. 7. Copy following code into this file. Part-3: Calculate factorial of a number using assembly loop In this part of exercise you will write simple program to calculate factorial value of a number. Factorial value of a positive integer n is given by n! = n x(n-1) (n-2) X.......2 x 1 Although, you can create a new project and work here. It is just nice option to modify above file and update it with new code. All you need to do is delete three lines of earlier code between your code start here" and "your code finished here" and replace this area by adding following subsection of the program. ; this is assembly only project global mStart, mystack, ResetISR, _c_intoo, Vess. ; This is the Reset Handler _c_int00: BwStart ; Your code start here MOV R6, #5 MOV R7, #1 CMP R6, #1 MUL R7, R6, R7 SUB R6, R6, #1 BGT L1 ; Your code start here ; Here we define the stack myStack .usest ".stack", 0x400 retain ". intress" .sect ".intvecs." TIL LUIL VIL W Tuviyull TIUJCCL TULJCUPLU VITLOV TICI :20 --> Quick Access: # 3 Getting Started C main.c S Lab3part1.asm X 1.global main ; makes main accessible outside to this file .thumb ; execute more optimized thumb instructions .data .align 2 ; data section in SRAM area ; align to 16 bit boundry 8x: .word Ox100 ; global variable x 10 11 12 ptr .text ; code section .align 2 ; align to 16 bit boundry .field x, 32; 32-bit pointer pointing to x 14 main: .asmfunc ; start of asm function code LDR R1, ptr ; load address of x into register R1 LDR RO, [R1] ; copy value of x into RO ADD RO, RO, #0x10; RO = RO + 0x10 STR RO, [R1] ; store content of RO at x .endasmfunc; end of asm code .end ; end of file - 0 Console X - Lab3Part_1 CORTEX_M4_0: GEL Output: Memory Map Initialization Complete CORTEX_M4_0: GEL: Encountered a problem loading file: C:\Users\Mach9\workspace_v7\Lab3Part_1\Debug\Lab3Part_1.out Could not of Resource Path Location Problems x Advice 3 errors, O warnings, 0 others Description v Errors (3 items) [E0002] Illegal mnemonic specified gmake: *** [Lab3part1.obj] Error 1 @gmake: Target 'all' not remade because of errors. /Lab3Part_1 line 1 Lab3part1.asm Lab3Part_1 Lab3Part_1 - Kun Scripts Window Help 2 * >> Quick Access : E a Getting Started main.c Lab3part1.asm LabPart3.asm X 1; this is assembly only project global myStart, myStack, ResetISR, _c_intoo, _Vecs 5; This is the Reset Handler 6_c_int00: B myStart 13 8; Here we define the stack 9 myStack .usect ".stack", Ox400 10 retain ".intvecs" 11 sect ".intvecs" 12 Vecs: word myStack; initial stack pointer .word_c_intoo, the reset handler 14 15; User program area 16 .thumb 17 18 .text 19 .align 2 20 myStart: 21 Your code start here 22 MOV RO, #0X11 LSL R1, RO, #1 LSL R2, R1, #1 23 26 ; Your code finished here 27 InfLoop: B InfLoop 28 T.end 29 Console X CDT Build Console (Lab3Part2] "../tm4c123gh6pm.cmd", line 45: error #10104: undefined symbol "_stack" used in expression error #10010: errors encountered during linking; "Lab3Part2.out" not built Problems x Advice - A 4 errors, 0 warnings, O others Description Res. v Errors (4 items) #10010 null: errors encountered during linking; "Lab3Part2.out" not built Lab #10104 undefined symbol "_stack" used in expression tm4 @gmake: *** [all] Error 2 Lab. gmake[1]: *** [Lab3Part2.out] Error 1 >> Compilation failure makefile:140: recipe for target 'Lab3Part2.out' failed gmake[1]: *** [Lab3Part2.out] Error 1 makefile: 136: recipe for target 'all' failed gmake: *** [all] Error 2 Lab **** Build Finished ****

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions