The goals for the assignment this week:
- Practice the use of bit-banding region.
- Examine the assembly code generated for a function with multiple parameters.
- Go thru a design problem exercising key concepts we viewed so far (pointers, arrays, functions, design, API, testingetc.)
- Bonus: Apply usage of pointers and the understanding of Endianness.
Problems:
- Using bit-band region for peripherals:
- Convert the Blinking Led demo to use the corresponding bit-band address instead of the register address used in the peripheral region.
- What instructions does the compiler produce in assembly for the writing to the GPIO bit when using bit-band address?
- What were the instructions produced when writing to the GPIOx_ODR bit[5] directly?
- Create a function with multiple arguments (5 arguments for example) and call that function from within another function. Trace thru the assembler and note:
- How does the calling function pass the values to the called function?
- What extra code did the compiler generate before calling the function with the multiple arguments?
- What extra code did the compiler generate inside the called function with the multiple list of arguments?
- Any other observations?
- Following the queue data structure approach, design, implement and test a stack data structure:
- The following is the list of requirements:
- The stack should have a predefined size
- The stack supports int data types.
- The following is the list of requirements:
- Provide a function to initialize the stack internals. iv. Provide a function to push an element onto the stack
- 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.
- Provide a list of the test cases and their implementation inside of main.c
- Separate the stack code from the rest of the test code (create stack.h & stack.c)
- 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:
- Device STM32F401RE
- Cortex M4 (Little endian option)
- Cortex M4 (Big Endian option)

![[Solved] EMBSYS100 Module 5- bit-banding region](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip.jpg)

![[Solved] EMBSYS100 Module 3- pre-processor, volatile directive, and GPIOs](https://assignmentchef.com/wp-content/uploads/2022/08/downloadzip-1200x1200.jpg)
Reviews
There are no reviews yet.