EMBSYS100 Module 7-Cortex Microcontroller Software Interface Standard Solved

30.00 $ 15.00 $

Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: . zip solution files instantly, after Payment


Rate this product

The goals for the assignment this week:

  1. Practice the use of the Cortex Microcontroller Software Interface Standard (CMSIS).
  2. Gain more practice with the Cortex-M4 assembly language.
  3. Become familiar with the linker Map file and use it to determine the resource usage.


  1. Use the CMSIS to implement code that blinks the user LED on the STM32 board.
    1. Create a new project.
    2. Create a main.c file and add it to the project.
    3. 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 Assignment\A06 folder
    4. Enable use of CMSIS in project options settings.
    5. Implement toggling of the LED using the CMSIS data structures.
  1. Convert the blinking led program into assembly code.
    1. Go to the link Assignment\A06 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.

  1. Create a new project and add the skeleton files to that project.
  2. Make sure to setup the project to connect to your board (follow instructions form Module_02 if you forgot how to do that).
  3. Implement the function control_user_led in assembly.
    1. The function takes as input the led requested state (0 == OFF, 1 == ON) and the duration for holding the state.
    2. The function returns void.
  4. Implement the function delay in assembly
    1. The function takes as input an integer value.
    2. The function will decrement the value until it reaches 0
  • Then returns void.
  1. Call the “control_user_led” function from a while loop in main.
  2. For any C code, use only data types defined in the “stdint.h” file



  1. Implement delay in assembly first. Once it works, implement control_user_led function.
  2. Use your simple LED code that made use of the peripheral registers (not the bit-banding registers).
  3. 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.
  4. Generate the map file for your program and provide details on:
    1. How much total ROM your program is occupying?
    2. How much total RAM your program is using?
    3. What part of your program is using the most ROM?
    4. What part of your program is using the most RAM?
  5. Bonus: Anything that can be done to optimize the usage of ROM or RAM resources? Explain any options.
  6. 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.
  • module07-ceuvbf.zip