The goals for the assignment this week:
- Practice the use of the Cortex Microcontroller Software Interface Standard (CMSIS).
- Gain more practice with the Cortex-M4 assembly language.
- Become familiar with the linker Map file and use it to determine the resource usage.
Problems:
- Use the CMSIS to implement code that blinks the user LED on the STM32 board.
- Create a new project.
- Create a main.c file and add it to the project.
- Add the files h & system_stm32f4xx.h to the folder where main.c is saved. You should be able to get these files thru STM32CubeMX. You could also get them by downloading the zip file CMSIS_STM32_Device_Specific_Files.zip from canvas site under the link AssignmentA06 folder
- Enable use of CMSIS in project options settings.
- Implement toggling of the LED using the CMSIS data structures.
- Convert the blinking led program into assembly code.
- Go to the link AssignmentA06 folder and download the zip file
Module07_Assignment06_Starter_Code.zip. Use the skeleton files (main.c, user_led.s, and delay.s) inside that zip file.
- Create a new project and add the skeleton files to that project.
- Make sure to setup the project to connect to your board (follow instructions form Module_02 if you forgot how to do that).
- Implement the function control_user_led in assembly.
- The function takes as input the led requested state (0 == OFF, 1 == ON) and the duration for holding the state.
- The function returns void.
- Implement the function delay in assembly
- The function takes as input an integer value.
- The function will decrement the value until it reaches 0
- Then returns void.
- Call the control_user_led function from a while loop in main.
- For any C code, use only data types defined in the stdint.h file
Hints:
- Implement delay in assembly first. Once it works, implement control_user_led function.
- Use your simple LED code that made use of the peripheral registers (not the bit-banding registers).
- It is ok to use a hard code value of the ODR (Output Data Register) address for GPIOA and store it into one of the CPU scratch registers.
- Generate the map file for your program and provide details on:
- How much total ROM your program is occupying?
- How much total RAM your program is using?
- What part of your program is using the most ROM?
- What part of your program is using the most RAM?
- Bonus: Anything that can be done to optimize the usage of ROM or RAM resources? Explain any options.
- Bonus: Re-implement the control_user_led to use the bit-band region for accessing the Output Data Register (ODR) for GPIOA in order to toggle the LED ON/OFF. Hint: It is ok to use a hard code value of the ODR bit-band address for GPIOA and store it into one of the CPU scratch registers.

![[Solved] EMBSYS100 Module 7-Cortex Microcontroller Software Interface Standard](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip.jpg)

![[Solved] EMBSYS100 Module 5- bit-banding region](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip-1200x1200.jpg)
Reviews
There are no reviews yet.