EMBSYS100 Module 5- bit-banding region 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 bit-banding region.
  2. Examine the assembly code generated for a function with multiple parameters.
  3. Go thru a design problem exercising key concepts we viewed so far (pointers, arrays, functions, design, API, testing…etc.)
  4. Bonus: Apply usage of pointers and the understanding of Endianness.


  1. Using bit-band region for peripherals:
    1. Convert the Blinking Led demo to use the corresponding bit-band address instead of the register address used in the peripheral region.
    2. What instructions does the compiler produce in assembly for the “writing” to the GPIO bit when using bit-band address?
    3. What were the instructions produced when writing to the GPIOx_ODR bit[5] directly?


  1. Create a function with multiple arguments (5 arguments for example) and call that function from within another function. Trace thru the assembler and note:
    1. How does the calling function pass the values to the called function?
    2. What extra code did the compiler generate before calling the function with the multiple arguments?
    3. What extra code did the compiler generate inside the called function with the multiple list of arguments?
    4. Any other observations?
  1. Following the queue data structure approach, design, implement and test a stack data structure:
    1. The following is the list of requirements:
      1. The stack should have a predefined size
      2. The stack supports “int” data types.
  • Provide a function to initialize the stack internals. iv. Provide a function to push an element onto the stack
  1. Provide a function to pop an element off the stack. vi. Provide a function that returns 1 if stack is empty. vii. Provide a function that returns 1 if stack is full.
  2. Provide a list of the test cases and their implementation inside of main.c
  3. Separate the stack code from the rest of the test code (create stack.h & stack.c)
  4. Bonus: Using the power of pointers and type casting, create a function that can determine if a computer is big-endian or little-endian. Test your function in the simulator and modify the Project Options (as shown in the figure below) against:
    1. Device STM32F401RE
    2. Cortex M4 (Little endian option)
    3. Cortex M4 (Big Endian option)
  • module05-0qccen.zip