mein code in task2

This commit is contained in:
Tobias Kachel 2026-03-24 14:20:19 +01:00
parent 7e0e37a578
commit b19c7f6b51
87 changed files with 10976 additions and 3537 deletions

View File

@ -9259,3 +9259,72 @@ Command-line arguments: -os linux -ws gtk -arch x86_64
!ENTRY com.st.stm32cube.ide.mcu.ide 1 1 2026-03-20 18:06:39.545 !ENTRY com.st.stm32cube.ide.mcu.ide 1 1 2026-03-20 18:06:39.545
!MESSAGE Started RMI Server, listening on port 41337 !MESSAGE Started RMI Server, listening on port 41337
!SESSION 2026-03-21 13:54:00.770 -----------------------------------------------
eclipse.buildId=Version 1.16.0
java.version=17.0.11
java.vendor=Eclipse Adoptium
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=de_DE
Command-line arguments: -os linux -ws gtk -arch x86_64
!ENTRY org.eclipse.core.resources 2 10035 2026-03-21 13:54:03.586
!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.
!ENTRY com.st.stm32cube.ide.mcu.informationcenter 4 4 2026-03-21 13:54:07.401
!MESSAGE CubeMX plugin appears to be active, Log4j initialization might be too late.
!ENTRY com.st.stm32cube.ide.mcu.informationcenter 1 1 2026-03-21 13:54:07.402
!MESSAGE Log4j2 initialized with config file /home/tobii/02_Uni/09_Mikrocomputertechnik/praktikum/mct_bei_workspace_25w/.metadata/.log4j2.xml
!ENTRY com.st.stm32cube.ide.mcu.ide 1 1 2026-03-21 13:54:12.808
!MESSAGE Started RMI Server, listening on port 41337
!SESSION 2026-03-24 14:01:44.656 -----------------------------------------------
eclipse.buildId=Version 1.16.0
java.version=17.0.11
java.vendor=Eclipse Adoptium
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=de_DE
Command-line arguments: -os linux -ws gtk -arch x86_64
!ENTRY org.eclipse.core.resources 2 10035 2026-03-24 14:01:47.209
!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.
!ENTRY com.st.stm32cube.ide.mcu.informationcenter 4 4 2026-03-24 14:01:50.655
!MESSAGE CubeMX plugin appears to be active, Log4j initialization might be too late.
!ENTRY com.st.stm32cube.ide.mcu.informationcenter 1 1 2026-03-24 14:01:50.656
!MESSAGE Log4j2 initialized with config file /home/tobii/02_Uni/09_Mikrocomputertechnik/praktikum/mct_bei_workspace_25w/.metadata/.log4j2.xml
!ENTRY com.st.stm32cube.ide.mcu.ide 1 1 2026-03-24 14:01:55.388
!MESSAGE Started RMI Server, listening on port 41337
!SESSION 2026-03-24 14:11:26.431 -----------------------------------------------
eclipse.buildId=Version 1.16.0
java.version=17.0.11
java.vendor=Eclipse Adoptium
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=de_DE
Command-line arguments: -os linux -ws gtk -arch x86_64
!ENTRY com.st.stm32cube.ide.mcu.informationcenter 4 4 2026-03-24 14:11:31.118
!MESSAGE CubeMX plugin appears to be active, Log4j initialization might be too late.
!ENTRY com.st.stm32cube.ide.mcu.informationcenter 1 1 2026-03-24 14:11:31.119
!MESSAGE Log4j2 initialized with config file /home/tobii/02_Uni/09_Mikrocomputertechnik/praktikum/mct_bei_workspace_25w/.metadata/.log4j2.xml
!ENTRY com.st.stm32cube.ide.mcu.ide 1 1 2026-03-24 14:11:45.929
!MESSAGE Started RMI Server, listening on port 41337
!ENTRY com.st.stm32cube.ide.mcu.debug 4 0 2026-03-24 14:15:22.829
!MESSAGE Error - No active DSF-Session. tmpSessionId = 3 (contextManager row 121)
!ENTRY com.st.stm32cube.ide.mcu.debug 4 0 2026-03-24 14:15:22.830
!MESSAGE Existing sessions are:
!ENTRY com.st.stm32cube.ide.mcu.debug 4 0 2026-03-24 14:17:18.477
!MESSAGE Error - No active DSF-Session. tmpSessionId = 6 (contextManager row 121)
!ENTRY com.st.stm32cube.ide.mcu.debug 4 0 2026-03-24 14:17:18.477
!MESSAGE Existing sessions are:
!ENTRY com.st.stm32cube.ide.mcu.debug 4 0 2026-03-24 14:18:01.013
!MESSAGE Error - No active DSF-Session. tmpSessionId = 7 (contextManager row 121)
!ENTRY com.st.stm32cube.ide.mcu.debug 4 0 2026-03-24 14:18:01.013
!MESSAGE Existing sessions are:

View File

@ -51,3 +51,4 @@
*** SESSION März 01, 2026 11:55:48.249 ----------------------------------------- *** SESSION März 01, 2026 11:55:48.249 -----------------------------------------
*** SESSION März 13, 2026 10:49:11.272 ----------------------------------------- *** SESSION März 13, 2026 10:49:11.272 -----------------------------------------
*** SESSION März 16, 2026 12:55:55.445 ----------------------------------------- *** SESSION März 16, 2026 12:55:55.445 -----------------------------------------
*** SESSION März 24, 2026 14:01:49.132 -----------------------------------------

View File

@ -323,3 +323,233 @@ Finished building: default.size.stdout
Finished building: task1.list Finished building: task1.list
16:09:45 **** Build of configuration Debug for project task2 ****
make -j12 all
arm-none-eabi-as -o task2.o task2.s -march=armv7-m -mcpu=cortex-m4 -adglns -g -mthumb --warn > task2.als
arm-none-eabi-ld -o task2.elf -T ldscript_rom.ld task2.o -g -Map task2.map --cref -static
arm-none-eabi-objdump -htdr -j .text -j .data -j .bss -j .vectortable -j .exhand task2.elf > task2.lst
arm-none-eabi-size task2.elf
text data bss dec hex filename
240 0 0 240 f0 task2.elf
Target all ready
18:20:32 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
arm-none-eabi-as -o task2.o task2.s -march=armv7-m -mcpu=cortex-m4 -adglns -g -mthumb --warn > task2.als
task2.s: Assembler messages:
task2.s:128: Error: ARM register expected -- `movs '
make: *** [makefile:74: task2.o] Error 1
"make -j12 all" terminated with exit code 2. Build might be incomplete.
18:20:48 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
arm-none-eabi-as -o task2.o task2.s -march=armv7-m -mcpu=cortex-m4 -adglns -g -mthumb --warn > task2.als
arm-none-eabi-ld -o task2.elf -T ldscript_rom.ld task2.o -g -Map task2.map --cref -static
arm-none-eabi-objdump -htdr -j .text -j .data -j .bss -j .vectortable -j .exhand task2.elf > task2.lst
arm-none-eabi-size task2.elf
text data bss dec hex filename
260 0 0 260 104 task2.elf
Target all ready
18:21:57 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
arm-none-eabi-as -o task2.o task2.s -march=armv7-m -mcpu=cortex-m4 -adglns -g -mthumb --warn > task2.als
arm-none-eabi-ld -o task2.elf -T ldscript_rom.ld task2.o -g -Map task2.map --cref -static
arm-none-eabi-objdump -htdr -j .text -j .data -j .bss -j .vectortable -j .exhand task2.elf > task2.lst
arm-none-eabi-size task2.elf
text data bss dec hex filename
260 0 0 260 104 task2.elf
Target all ready
18:22:48 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
arm-none-eabi-as -o task2.o task2.s -march=armv7-m -mcpu=cortex-m4 -adglns -g -mthumb --warn > task2.als
arm-none-eabi-ld -o task2.elf -T ldscript_rom.ld task2.o -g -Map task2.map --cref -static
arm-none-eabi-objdump -htdr -j .text -j .data -j .bss -j .vectortable -j .exhand task2.elf > task2.lst
arm-none-eabi-size task2.elf
text data bss dec hex filename
240 0 0 240 f0 task2.elf
Target all ready
18:23:22 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
arm-none-eabi-as -o task2.o task2.s -march=armv7-m -mcpu=cortex-m4 -adglns -g -mthumb --warn > task2.als
arm-none-eabi-ld -o task2.elf -T ldscript_rom.ld task2.o -g -Map task2.map --cref -static
arm-none-eabi-objdump -htdr -j .text -j .data -j .bss -j .vectortable -j .exhand task2.elf > task2.lst
arm-none-eabi-size task2.elf
text data bss dec hex filename
260 0 0 260 104 task2.elf
Target all ready
18:23:42 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
arm-none-eabi-as -o task2.o task2.s -march=armv7-m -mcpu=cortex-m4 -adglns -g -mthumb --warn > task2.als
arm-none-eabi-ld -o task2.elf -T ldscript_rom.ld task2.o -g -Map task2.map --cref -static
arm-none-eabi-objdump -htdr -j .text -j .data -j .bss -j .vectortable -j .exhand task2.elf > task2.lst
arm-none-eabi-size task2.elf
text data bss dec hex filename
260 0 0 260 104 task2.elf
Target all ready
18:23:54 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
arm-none-eabi-as -o task2.o task2.s -march=armv7-m -mcpu=cortex-m4 -adglns -g -mthumb --warn > task2.als
arm-none-eabi-ld -o task2.elf -T ldscript_rom.ld task2.o -g -Map task2.map --cref -static
arm-none-eabi-objdump -htdr -j .text -j .data -j .bss -j .vectortable -j .exhand task2.elf > task2.lst
arm-none-eabi-size task2.elf
text data bss dec hex filename
260 0 0 260 104 task2.elf
Target all ready
18:24:03 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
arm-none-eabi-as -o task2.o task2.s -march=armv7-m -mcpu=cortex-m4 -adglns -g -mthumb --warn > task2.als
arm-none-eabi-ld -o task2.elf -T ldscript_rom.ld task2.o -g -Map task2.map --cref -static
arm-none-eabi-objdump -htdr -j .text -j .data -j .bss -j .vectortable -j .exhand task2.elf > task2.lst
arm-none-eabi-size task2.elf
text data bss dec hex filename
260 0 0 260 104 task2.elf
Target all ready
18:24:24 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
arm-none-eabi-as -o task2.o task2.s -march=armv7-m -mcpu=cortex-m4 -adglns -g -mthumb --warn > task2.als
arm-none-eabi-ld -o task2.elf -T ldscript_rom.ld task2.o -g -Map task2.map --cref -static
arm-none-eabi-objdump -htdr -j .text -j .data -j .bss -j .vectortable -j .exhand task2.elf > task2.lst
arm-none-eabi-size task2.elf
text data bss dec hex filename
260 0 0 260 104 task2.elf
Target all ready
18:24:36 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
arm-none-eabi-as -o task2.o task2.s -march=armv7-m -mcpu=cortex-m4 -adglns -g -mthumb --warn > task2.als
arm-none-eabi-ld -o task2.elf -T ldscript_rom.ld task2.o -g -Map task2.map --cref -static
arm-none-eabi-objdump -htdr -j .text -j .data -j .bss -j .vectortable -j .exhand task2.elf > task2.lst
arm-none-eabi-size task2.elf
text data bss dec hex filename
260 0 0 260 104 task2.elf
Target all ready
18:25:04 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
arm-none-eabi-as -o task2.o task2.s -march=armv7-m -mcpu=cortex-m4 -adglns -g -mthumb --warn > task2.als
arm-none-eabi-ld -o task2.elf -T ldscript_rom.ld task2.o -g -Map task2.map --cref -static
arm-none-eabi-objdump -htdr -j .text -j .data -j .bss -j .vectortable -j .exhand task2.elf > task2.lst
arm-none-eabi-size task2.elf
text data bss dec hex filename
260 0 0 260 104 task2.elf
Target all ready
18:25:26 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
arm-none-eabi-as -o task2.o task2.s -march=armv7-m -mcpu=cortex-m4 -adglns -g -mthumb --warn > task2.als
arm-none-eabi-ld -o task2.elf -T ldscript_rom.ld task2.o -g -Map task2.map --cref -static
arm-none-eabi-objdump -htdr -j .text -j .data -j .bss -j .vectortable -j .exhand task2.elf > task2.lst
arm-none-eabi-size task2.elf
text data bss dec hex filename
260 0 0 260 104 task2.elf
Target all ready
18:25:42 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
arm-none-eabi-as -o task2.o task2.s -march=armv7-m -mcpu=cortex-m4 -adglns -g -mthumb --warn > task2.als
arm-none-eabi-ld -o task2.elf -T ldscript_rom.ld task2.o -g -Map task2.map --cref -static
arm-none-eabi-objdump -htdr -j .text -j .data -j .bss -j .vectortable -j .exhand task2.elf > task2.lst
arm-none-eabi-size task2.elf
text data bss dec hex filename
260 0 0 260 104 task2.elf
Target all ready
18:26:11 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
arm-none-eabi-as -o task2.o task2.s -march=armv7-m -mcpu=cortex-m4 -adglns -g -mthumb --warn > task2.als
arm-none-eabi-ld -o task2.elf -T ldscript_rom.ld task2.o -g -Map task2.map --cref -static
arm-none-eabi-objdump -htdr -j .text -j .data -j .bss -j .vectortable -j .exhand task2.elf > task2.lst
arm-none-eabi-size task2.elf
text data bss dec hex filename
260 0 0 260 104 task2.elf
Target all ready
18:26:34 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
arm-none-eabi-as -o task2.o task2.s -march=armv7-m -mcpu=cortex-m4 -adglns -g -mthumb --warn > task2.als
arm-none-eabi-ld -o task2.elf -T ldscript_rom.ld task2.o -g -Map task2.map --cref -static
arm-none-eabi-objdump -htdr -j .text -j .data -j .bss -j .vectortable -j .exhand task2.elf > task2.lst
arm-none-eabi-size task2.elf
text data bss dec hex filename
264 0 0 264 108 task2.elf
Target all ready
18:26:57 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
arm-none-eabi-as -o task2.o task2.s -march=armv7-m -mcpu=cortex-m4 -adglns -g -mthumb --warn > task2.als
arm-none-eabi-ld -o task2.elf -T ldscript_rom.ld task2.o -g -Map task2.map --cref -static
arm-none-eabi-objdump -htdr -j .text -j .data -j .bss -j .vectortable -j .exhand task2.elf > task2.lst
arm-none-eabi-size task2.elf
text data bss dec hex filename
248 0 0 248 f8 task2.elf
Target all ready
18:27:24 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
Target all ready
18:29:47 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
arm-none-eabi-as -o task2.o task2.s -march=armv7-m -mcpu=cortex-m4 -adglns -g -mthumb --warn > task2.als
arm-none-eabi-ld -o task2.elf -T ldscript_rom.ld task2.o -g -Map task2.map --cref -static
arm-none-eabi-objdump -htdr -j .text -j .data -j .bss -j .vectortable -j .exhand task2.elf > task2.lst
arm-none-eabi-size task2.elf
text data bss dec hex filename
240 0 0 240 f0 task2.elf
Target all ready
18:35:13 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
arm-none-eabi-as -o task2.o task2.s -march=armv7-m -mcpu=cortex-m4 -adglns -g -mthumb --warn > task2.als
arm-none-eabi-ld -o task2.elf -T ldscript_rom.ld task2.o -g -Map task2.map --cref -static
arm-none-eabi-objdump -htdr -j .text -j .data -j .bss -j .vectortable -j .exhand task2.elf > task2.lst
arm-none-eabi-size task2.elf
text data bss dec hex filename
240 0 0 240 f0 task2.elf
Target all ready
18:35:46 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
Target all ready
18:35:51 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
Target all ready
14:12:30 **** Build of configuration Debug for project task2 ****
make -j12 all
Target all ready
14:12:55 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
Target all ready
14:13:16 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
Target all ready
14:13:43 **** Clean-only build of configuration Debug for project task1 ****
make -j12 clean
rm -rf ./Startup/startup_stm32g431kbtx.d ./Startup/startup_stm32g431kbtx.o ./Startup/syscalls.cyclo ./Startup/syscalls.d ./Startup/syscalls.o ./Startup/syscalls.su ./Startup/sysmem.cyclo ./Startup/sysmem.d ./Startup/sysmem.o ./Startup/sysmem.su
rm -rf ./Src/task1.cyclo ./Src/task1.d ./Src/task1.o ./Src/task1.su ./Src/task1_it.cyclo ./Src/task1_it.d ./Src/task1_it.o ./Src/task1_it.su
rm -rf default.size.stdout task1.elf task1.list task1.map
14:13:44 **** Clean-only build of configuration Debug for project task2 ****
make -j12 clean
14:13:44 **** Clean-only build of configuration Debug for project task3 ****
make -j12 clean
makefile:62: *** multiple target patterns. Stop.
"make -j12 clean" terminated with exit code 2. Build might be incomplete.
14:13:44 **** Clean-only build of configuration Debug for project task4 ****
make -j12 clean
makefile:62: *** multiple target patterns. Stop.
"make -j12 clean" terminated with exit code 2. Build might be incomplete.
14:14:11 **** Build of configuration Debug for project task2 ****
make -j12 all
arm-none-eabi-as -o task2.o task2.s -march=armv7-m -mcpu=cortex-m4 -adglns -g -mthumb --warn > task2.als
arm-none-eabi-ld -o task2.elf -T ldscript_rom.ld task2.o -g -Map task2.map --cref -static
arm-none-eabi-objdump -htdr -j .text -j .data -j .bss -j .vectortable -j .exhand task2.elf > task2.lst
arm-none-eabi-size task2.elf
text data bss dec hex filename
240 0 0 240 f0 task2.elf
Target all ready
14:15:19 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
Target all ready
14:15:29 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
Target all ready
14:16:17 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
Target all ready
14:17:15 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
Target all ready
14:17:57 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
Target all ready
14:19:07 **** Incremental Build of configuration Debug for project task2 ****
make -j12 all
Target all ready

View File

@ -1,17 +1,9 @@
15:01:24 **** Incremental Build of configuration Debug for project task1 **** 14:13:43 **** Clean-only build of configuration Debug for project task1 ****
make -j12 all make -j12 clean
arm-none-eabi-gcc "../Src/task1.c" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DSTM32G431KBTx -DSTM32 -DSTM32G4 -DNUCLEO_G431KB -c -I../Inc -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Src/task1.d" -MT"Src/task1.o" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "Src/task1.o" rm -rf ./Startup/startup_stm32g431kbtx.d ./Startup/startup_stm32g431kbtx.o ./Startup/syscalls.cyclo ./Startup/syscalls.d ./Startup/syscalls.o ./Startup/syscalls.su ./Startup/sysmem.cyclo ./Startup/sysmem.d ./Startup/sysmem.o ./Startup/sysmem.su
arm-none-eabi-gcc -o "task1.elf" @"objects.list" -mcpu=cortex-m4 -T"/home/tobii/02_Uni/09_Mikrocomputertechnik/praktikum/mct_bei_workspace_25w/task1/STM32G431KBTX_FLASH.ld" --specs=nosys.specs -Wl,-Map="task1.map" -Wl,--gc-sections -static --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -Wl,--start-group -lc -lm -Wl,--end-group rm -rf ./Src/task1.cyclo ./Src/task1.d ./Src/task1.o ./Src/task1.su ./Src/task1_it.cyclo ./Src/task1_it.d ./Src/task1_it.o ./Src/task1_it.su
Finished building target: task1.elf rm -rf default.size.stdout task1.elf task1.list task1.map
arm-none-eabi-size task1.elf
arm-none-eabi-objdump -h -S task1.elf > "task1.list"
text data bss dec hex filename
1692 0 1568 3260 cbc task1.elf
Finished building: default.size.stdout
Finished building: task1.list
15:01:24 Build Finished. 0 errors, 0 warnings. (took 330ms) 14:13:44 Build Finished. 0 errors, 0 warnings. (took 187ms)

View File

@ -1,5 +1,6 @@
11:52:45 **** Clean-only build of configuration Debug for project task2 **** 14:19:07 **** Incremental Build of configuration Debug for project task2 ****
make -j12 clean make -j12 all
Target all ready
11:52:45 Build Finished. 0 errors, 0 warnings. (took 126ms) 14:19:07 Build Finished. 0 errors, 0 warnings. (took 182ms)

View File

@ -1,7 +1,7 @@
11:52:45 **** Clean-only build of configuration Debug for project task3 **** 14:13:44 **** Clean-only build of configuration Debug for project task3 ****
make -j12 clean make -j12 clean
makefile:62: *** multiple target patterns. Stop. makefile:62: *** multiple target patterns. Stop.
"make -j12 clean" terminated with exit code 2. Build might be incomplete. "make -j12 clean" terminated with exit code 2. Build might be incomplete.
11:52:45 Build Failed. 1 errors, 0 warnings. (took 126ms) 14:13:44 Build Failed. 1 errors, 0 warnings. (took 186ms)

View File

@ -1,7 +1,7 @@
11:52:46 **** Clean-only build of configuration Debug for project task4 **** 14:13:44 **** Clean-only build of configuration Debug for project task4 ****
make -j12 clean make -j12 clean
makefile:62: *** multiple target patterns. Stop. makefile:62: *** multiple target patterns. Stop.
"make -j12 clean" terminated with exit code 2. Build might be incomplete. "make -j12 clean" terminated with exit code 2. Build might be incomplete.
11:52:46 Build Failed. 1 errors, 0 warnings. (took 127ms) 14:13:44 Build Failed. 1 errors, 0 warnings. (took 186ms)

View File

@ -0,0 +1,325 @@
#****************************************************************************************#
# Project: task2 - ASM: Interrupts
# File: task2.s
#
# Language: ASM
#
# Hardware: STefi Light v1.1
# Processor: STM32G431KBT6U
#
# Author: Manuel Lederhofer
# Datum: 31.10.2014
#
# Version: 6.0
# History:
# 31.10.2014 ML create file
# 27.09.2018 ML edit comments, extend vector table
# 18.12.2018 ML port from MKL05Z32VLC4 to STM32L476RG
# 27.02.2019 ML move section of exception handlers to bottom of file
# 25.09.2019 ML minor changes for a better code and comment understanding
# 04.09.2020 HL port from STM32L476RG to STM32F411xE
# 21.09.2020 ML tidy up, comments and formatting
# 29.09.2021 ML port from STM32F411xE to STM32F042K6T6
# 09.03.2022 ML port from STM32F042K6T6 to STM32G431KBT6U
# 10.02.2025 TK remove ASM:Polling,move ASM:Interrupts to task2
# 24.06.2025 TK remove /* ... place your code here ... */
#
# Status: working
#
# Description:
# See the description and requirements of the requested application
# in the lab exercise guide.
#
# Notes:
# - MCU speed at startup is 16 MHz
#
# ToDo:
# - Change the example code to match the description and requirements
# of the requested application in the lab exercise guide.
#****************************************************************************************#
.include "G431_addr.s"
#----------------------------------------------------------------------------------------#
.section .vectortable,"a" // vector table at begin of ROM
#----------------------------------------------------------------------------------------#
.align 2
.word 0x20004000 // initial Stack Pointer: 0x20000000 (RAM base) + 0x4000 (16K SRAM1 length)
.word 0x08000401 // initial Program Counter
.word _ISR_NMI // non-masking interrupt
.word _ISR_HARDF // hard fault interrupt
/* N.B.
Look at the .space or the .org assembler directive to insert the address of the
ISRs at the right place in the vector table. Verify your settings by the help of
the list file. */
.word _ISR_S0
#----------------------------------------------------------------------------------------#
.text // section .text (default section for program code)
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global init
.type init, %function
init:
CPSID i // disable interrupts globally
MOVS r0, #0 // safely initialize the GPRs
MOVS r1, #0
MOVS r2, #0
MOVS r3, #0
MOVS r4, #0
MOVS r5, #0
MOVS r6, #0
MOVS r7, #0
MOV r8, r0
MOV r9, r0
MOV r10, r0
MOV r11, r0
MOV r12, r0
#--- enable port clocking
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask for adjusting port clock gating (A: LEDs)
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for ports
STR r0, [r1, #0] // apply settings
#--- port init
#- LEDs
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0x03 // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r2 // delete bits
MOVS r2, #0x01 // load configuration mask
ORRS r0, r0, r2 // apply mask
STR r0, [r1, #0] // apply result to port A mode register
LDR r1, =GPIOA_MODER
MOVS r3, #0x03
LDR r0, [r1, #1]
BICS r0, r3
MOVS r3, #0x01
ORRS r0, r0, r3
STR r0, [r1, #3]
#- switch LED off
LDR r1, =GPIOA_ODR // load port A output data register
MOVS r2, #0x01 // load mask for LED
LDR r0, [r1, #0] // get current value of GPIOA
ORRS r0, r0, r2 // configure pin state
STR r0, [r1, #0] // apply settings
#- buttons
/* ... place your code here ... */
#--- button interrupt config
#- enable clock for SYSCFG module
#- connect GPIO pins of the buttons to EXTended Interrupt controller lines (EXTI)
# in SYSCFG module (SYSCFG_* registers)
#- configure lines in EXTI module (EXTI_* registers)
#- NVIC: set interrupt priority, clear pending bits
# and enable interrupts for buttons (see: PM, ch. 4.3, NVIC)
CPSIE i // enable interrupts globally
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global main
.type main, %function
main:
LDR r1, =GPIOA_ODR
EORS r0, r0, r3
STR r0, [r1, #0]
BL delay
B main
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global delay
.type delay, %function
delay:
MOVS r6, #0 // ...
LDR r7, =2000000 // ...
.L1:
ADDS r6, r6, #1 // ...
CMP r6, r7 // ...
BNE .L1 // ...
BX lr // ...
#----------------------------------------------------------------------------------------#
.align 2
.global stop
stop:
NOP // do nothing (NOP is here to avoid a debugger crash, only)
B stop // if this line is reached, something went wrong
#----------------------------------------------------------------------------------------#
.lp1: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------------#
.section .exhand,"ax" // section for exception handlers
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_NMI, %function
_ISR_NMI:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x44 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x0A // load mask for blue and yellow LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_NMI
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_HARDF, %function
_ISR_HARDF:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x11 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x05 // load mask for red and green LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_HARDF
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S0, %function
_ISR_S0:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S1, %function
_ISR_S1:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.lp2: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
.end
#************************************** E O F *******************************************#

View File

@ -0,0 +1,325 @@
#****************************************************************************************#
# Project: task2 - ASM: Interrupts
# File: task2.s
#
# Language: ASM
#
# Hardware: STefi Light v1.1
# Processor: STM32G431KBT6U
#
# Author: Manuel Lederhofer
# Datum: 31.10.2014
#
# Version: 6.0
# History:
# 31.10.2014 ML create file
# 27.09.2018 ML edit comments, extend vector table
# 18.12.2018 ML port from MKL05Z32VLC4 to STM32L476RG
# 27.02.2019 ML move section of exception handlers to bottom of file
# 25.09.2019 ML minor changes for a better code and comment understanding
# 04.09.2020 HL port from STM32L476RG to STM32F411xE
# 21.09.2020 ML tidy up, comments and formatting
# 29.09.2021 ML port from STM32F411xE to STM32F042K6T6
# 09.03.2022 ML port from STM32F042K6T6 to STM32G431KBT6U
# 10.02.2025 TK remove ASM:Polling,move ASM:Interrupts to task2
# 24.06.2025 TK remove /* ... place your code here ... */
#
# Status: working
#
# Description:
# See the description and requirements of the requested application
# in the lab exercise guide.
#
# Notes:
# - MCU speed at startup is 16 MHz
#
# ToDo:
# - Change the example code to match the description and requirements
# of the requested application in the lab exercise guide.
#****************************************************************************************#
.include "G431_addr.s"
#----------------------------------------------------------------------------------------#
.section .vectortable,"a" // vector table at begin of ROM
#----------------------------------------------------------------------------------------#
.align 2
.word 0x20004000 // initial Stack Pointer: 0x20000000 (RAM base) + 0x4000 (16K SRAM1 length)
.word 0x08000401 // initial Program Counter
.word _ISR_NMI // non-masking interrupt
.word _ISR_HARDF // hard fault interrupt
/* N.B.
Look at the .space or the .org assembler directive to insert the address of the
ISRs at the right place in the vector table. Verify your settings by the help of
the list file. */
.word _ISR_S0
#----------------------------------------------------------------------------------------#
.text // section .text (default section for program code)
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global init
.type init, %function
init:
CPSID i // disable interrupts globally
MOVS r0, #0 // safely initialize the GPRs
MOVS r1, #0
MOVS r2, #0
MOVS r3, #0
MOVS r4, #0
MOVS r5, #0
MOVS r6, #0
MOVS r7, #0
MOV r8, r0
MOV r9, r0
MOV r10, r0
MOV r11, r0
MOV r12, r0
#--- enable port clocking
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask for adjusting port clock gating (A: LEDs)
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for ports
STR r0, [r1, #0] // apply settings
#--- port init
#- LEDs
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0x03 // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r2 // delete bits
MOVS r2, #0x01 // load configuration mask
ORRS r0, r0, r2 // apply mask
STR r0, [r1, #0] // apply result to port A mode register
LDR r1, =GPIOA_MODER
MOVS r3, #0x05
LDR r0, [r1, #1]
BICS r0, r3
MOVS r3, #0x01
ORRS r0, r0, r3
STR r0, [r1, #1]
#- switch LED off
LDR r1, =GPIOA_ODR // load port A output data register
MOVS r2, #0x01 // load mask for LED
LDR r0, [r1, #0] // get current value of GPIOA
ORRS r0, r0, r2 // configure pin state
STR r0, [r1, #0] // apply settings
#- buttons
/* ... place your code here ... */
#--- button interrupt config
#- enable clock for SYSCFG module
#- connect GPIO pins of the buttons to EXTended Interrupt controller lines (EXTI)
# in SYSCFG module (SYSCFG_* registers)
#- configure lines in EXTI module (EXTI_* registers)
#- NVIC: set interrupt priority, clear pending bits
# and enable interrupts for buttons (see: PM, ch. 4.3, NVIC)
CPSIE i // enable interrupts globally
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global main
.type main, %function
main:
LDR r1, =GPIOA_ODR
EORS r0, r0, r3
STR r0, [r1, #0]
BL delay
B main
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global delay
.type delay, %function
delay:
MOVS r6, #0 // ...
LDR r7, =2000000 // ...
.L1:
ADDS r6, r6, #1 // ...
CMP r6, r7 // ...
BNE .L1 // ...
BX lr // ...
#----------------------------------------------------------------------------------------#
.align 2
.global stop
stop:
NOP // do nothing (NOP is here to avoid a debugger crash, only)
B stop // if this line is reached, something went wrong
#----------------------------------------------------------------------------------------#
.lp1: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------------#
.section .exhand,"ax" // section for exception handlers
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_NMI, %function
_ISR_NMI:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x44 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x0A // load mask for blue and yellow LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_NMI
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_HARDF, %function
_ISR_HARDF:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x11 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x05 // load mask for red and green LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_HARDF
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S0, %function
_ISR_S0:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S1, %function
_ISR_S1:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.lp2: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
.end
#************************************** E O F *******************************************#

View File

@ -0,0 +1,325 @@
#****************************************************************************************#
# Project: task2 - ASM: Interrupts
# File: task2.s
#
# Language: ASM
#
# Hardware: STefi Light v1.1
# Processor: STM32G431KBT6U
#
# Author: Manuel Lederhofer
# Datum: 31.10.2014
#
# Version: 6.0
# History:
# 31.10.2014 ML create file
# 27.09.2018 ML edit comments, extend vector table
# 18.12.2018 ML port from MKL05Z32VLC4 to STM32L476RG
# 27.02.2019 ML move section of exception handlers to bottom of file
# 25.09.2019 ML minor changes for a better code and comment understanding
# 04.09.2020 HL port from STM32L476RG to STM32F411xE
# 21.09.2020 ML tidy up, comments and formatting
# 29.09.2021 ML port from STM32F411xE to STM32F042K6T6
# 09.03.2022 ML port from STM32F042K6T6 to STM32G431KBT6U
# 10.02.2025 TK remove ASM:Polling,move ASM:Interrupts to task2
# 24.06.2025 TK remove /* ... place your code here ... */
#
# Status: working
#
# Description:
# See the description and requirements of the requested application
# in the lab exercise guide.
#
# Notes:
# - MCU speed at startup is 16 MHz
#
# ToDo:
# - Change the example code to match the description and requirements
# of the requested application in the lab exercise guide.
#****************************************************************************************#
.include "G431_addr.s"
#----------------------------------------------------------------------------------------#
.section .vectortable,"a" // vector table at begin of ROM
#----------------------------------------------------------------------------------------#
.align 2
.word 0x20004000 // initial Stack Pointer: 0x20000000 (RAM base) + 0x4000 (16K SRAM1 length)
.word 0x08000401 // initial Program Counter
.word _ISR_NMI // non-masking interrupt
.word _ISR_HARDF // hard fault interrupt
/* N.B.
Look at the .space or the .org assembler directive to insert the address of the
ISRs at the right place in the vector table. Verify your settings by the help of
the list file. */
.word _ISR_S0
#----------------------------------------------------------------------------------------#
.text // section .text (default section for program code)
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global init
.type init, %function
init:
CPSID i // disable interrupts globally
MOVS r0, #0 // safely initialize the GPRs
MOVS r1, #0
MOVS r2, #0
MOVS r3, #0
MOVS r4, #0
MOVS r5, #0
MOVS r6, #0
MOVS r7, #0
MOV r8, r0
MOV r9, r0
MOV r10, r0
MOV r11, r0
MOV r12, r0
#--- enable port clocking
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask for adjusting port clock gating (A: LEDs)
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for ports
STR r0, [r1, #0] // apply settings
#--- port init
#- LEDs
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0x03 // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r2 // delete bits
MOVS r2, #0x01 // load configuration mask
ORRS r0, r0, r2 // apply mask
STR r0, [r1, #0] // apply result to port A mode register
LDR r1, =GPIOA_MODER
MOVS r3, #0x05
LDR r0, [r1, #1]
BICS r0, r3
MOVS r3, #0x04
ORRS r0, r0, r3
STR r0, [r1, #1]
#- switch LED off
LDR r1, =GPIOA_ODR // load port A output data register
MOVS r2, #0x01 // load mask for LED
LDR r0, [r1, #0] // get current value of GPIOA
ORRS r0, r0, r2 // configure pin state
STR r0, [r1, #0] // apply settings
#- buttons
/* ... place your code here ... */
#--- button interrupt config
#- enable clock for SYSCFG module
#- connect GPIO pins of the buttons to EXTended Interrupt controller lines (EXTI)
# in SYSCFG module (SYSCFG_* registers)
#- configure lines in EXTI module (EXTI_* registers)
#- NVIC: set interrupt priority, clear pending bits
# and enable interrupts for buttons (see: PM, ch. 4.3, NVIC)
CPSIE i // enable interrupts globally
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global main
.type main, %function
main:
LDR r1, =GPIOA_ODR
EORS r0, r0, r3
STR r0, [r1, #0]
BL delay
B main
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global delay
.type delay, %function
delay:
MOVS r6, #0 // ...
LDR r7, =2000000 // ...
.L1:
ADDS r6, r6, #1 // ...
CMP r6, r7 // ...
BNE .L1 // ...
BX lr // ...
#----------------------------------------------------------------------------------------#
.align 2
.global stop
stop:
NOP // do nothing (NOP is here to avoid a debugger crash, only)
B stop // if this line is reached, something went wrong
#----------------------------------------------------------------------------------------#
.lp1: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------------#
.section .exhand,"ax" // section for exception handlers
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_NMI, %function
_ISR_NMI:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x44 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x0A // load mask for blue and yellow LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_NMI
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_HARDF, %function
_ISR_HARDF:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x11 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x05 // load mask for red and green LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_HARDF
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S0, %function
_ISR_S0:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S1, %function
_ISR_S1:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.lp2: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
.end
#************************************** E O F *******************************************#

View File

@ -0,0 +1,325 @@
#****************************************************************************************#
# Project: task2 - ASM: Interrupts
# File: task2.s
#
# Language: ASM
#
# Hardware: STefi Light v1.1
# Processor: STM32G431KBT6U
#
# Author: Manuel Lederhofer
# Datum: 31.10.2014
#
# Version: 6.0
# History:
# 31.10.2014 ML create file
# 27.09.2018 ML edit comments, extend vector table
# 18.12.2018 ML port from MKL05Z32VLC4 to STM32L476RG
# 27.02.2019 ML move section of exception handlers to bottom of file
# 25.09.2019 ML minor changes for a better code and comment understanding
# 04.09.2020 HL port from STM32L476RG to STM32F411xE
# 21.09.2020 ML tidy up, comments and formatting
# 29.09.2021 ML port from STM32F411xE to STM32F042K6T6
# 09.03.2022 ML port from STM32F042K6T6 to STM32G431KBT6U
# 10.02.2025 TK remove ASM:Polling,move ASM:Interrupts to task2
# 24.06.2025 TK remove /* ... place your code here ... */
#
# Status: working
#
# Description:
# See the description and requirements of the requested application
# in the lab exercise guide.
#
# Notes:
# - MCU speed at startup is 16 MHz
#
# ToDo:
# - Change the example code to match the description and requirements
# of the requested application in the lab exercise guide.
#****************************************************************************************#
.include "G431_addr.s"
#----------------------------------------------------------------------------------------#
.section .vectortable,"a" // vector table at begin of ROM
#----------------------------------------------------------------------------------------#
.align 2
.word 0x20004000 // initial Stack Pointer: 0x20000000 (RAM base) + 0x4000 (16K SRAM1 length)
.word 0x08000401 // initial Program Counter
.word _ISR_NMI // non-masking interrupt
.word _ISR_HARDF // hard fault interrupt
/* N.B.
Look at the .space or the .org assembler directive to insert the address of the
ISRs at the right place in the vector table. Verify your settings by the help of
the list file. */
.word _ISR_S0
#----------------------------------------------------------------------------------------#
.text // section .text (default section for program code)
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global init
.type init, %function
init:
CPSID i // disable interrupts globally
MOVS r0, #0 // safely initialize the GPRs
MOVS r1, #0
MOVS r2, #0
MOVS r3, #0
MOVS r4, #0
MOVS r5, #0
MOVS r6, #0
MOVS r7, #0
MOV r8, r0
MOV r9, r0
MOV r10, r0
MOV r11, r0
MOV r12, r0
#--- enable port clocking
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask for adjusting port clock gating (A: LEDs)
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for ports
STR r0, [r1, #0] // apply settings
#--- port init
#- LEDs
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0x03 // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r2 // delete bits
MOVS r2, #0x01 // load configuration mask
ORRS r0, r0, r2 // apply mask
STR r0, [r1, #0] // apply result to port A mode register
LDR r1, =GPIOA_MODER
MOVS r3, #0x05
LDR r0, [r1, #1]
BICS r0, r3
MOVS r3, #0x01
ORRS r0, r0, r3
STR r0, [r1, #1]
#- switch LED off
LDR r1, =GPIOA_ODR // load port A output data register
MOVS r2, #0x01 // load mask for LED
LDR r0, [r1, #0] // get current value of GPIOA
ORRS r0, r0, r2 // configure pin state
STR r0, [r1, #0] // apply settings
#- buttons
/* ... place your code here ... */
#--- button interrupt config
#- enable clock for SYSCFG module
#- connect GPIO pins of the buttons to EXTended Interrupt controller lines (EXTI)
# in SYSCFG module (SYSCFG_* registers)
#- configure lines in EXTI module (EXTI_* registers)
#- NVIC: set interrupt priority, clear pending bits
# and enable interrupts for buttons (see: PM, ch. 4.3, NVIC)
CPSIE i // enable interrupts globally
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global main
.type main, %function
main:
LDR r1, =GPIOA_ODR
EORS r0, r0, r3
STR r0, [r1, #0]
BL delay
B main
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global delay
.type delay, %function
delay:
MOVS r6, #0 // ...
LDR r7, =2000000 // ...
.L1:
ADDS r6, r6, #1 // ...
CMP r6, r7 // ...
BNE .L1 // ...
BX lr // ...
#----------------------------------------------------------------------------------------#
.align 2
.global stop
stop:
NOP // do nothing (NOP is here to avoid a debugger crash, only)
B stop // if this line is reached, something went wrong
#----------------------------------------------------------------------------------------#
.lp1: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------------#
.section .exhand,"ax" // section for exception handlers
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_NMI, %function
_ISR_NMI:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x44 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x0A // load mask for blue and yellow LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_NMI
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_HARDF, %function
_ISR_HARDF:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x11 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x05 // load mask for red and green LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_HARDF
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S0, %function
_ISR_S0:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S1, %function
_ISR_S1:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.lp2: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
.end
#************************************** E O F *******************************************#

View File

@ -0,0 +1,325 @@
#****************************************************************************************#
# Project: task2 - ASM: Interrupts
# File: task2.s
#
# Language: ASM
#
# Hardware: STefi Light v1.1
# Processor: STM32G431KBT6U
#
# Author: Manuel Lederhofer
# Datum: 31.10.2014
#
# Version: 6.0
# History:
# 31.10.2014 ML create file
# 27.09.2018 ML edit comments, extend vector table
# 18.12.2018 ML port from MKL05Z32VLC4 to STM32L476RG
# 27.02.2019 ML move section of exception handlers to bottom of file
# 25.09.2019 ML minor changes for a better code and comment understanding
# 04.09.2020 HL port from STM32L476RG to STM32F411xE
# 21.09.2020 ML tidy up, comments and formatting
# 29.09.2021 ML port from STM32F411xE to STM32F042K6T6
# 09.03.2022 ML port from STM32F042K6T6 to STM32G431KBT6U
# 10.02.2025 TK remove ASM:Polling,move ASM:Interrupts to task2
# 24.06.2025 TK remove /* ... place your code here ... */
#
# Status: working
#
# Description:
# See the description and requirements of the requested application
# in the lab exercise guide.
#
# Notes:
# - MCU speed at startup is 16 MHz
#
# ToDo:
# - Change the example code to match the description and requirements
# of the requested application in the lab exercise guide.
#****************************************************************************************#
.include "G431_addr.s"
#----------------------------------------------------------------------------------------#
.section .vectortable,"a" // vector table at begin of ROM
#----------------------------------------------------------------------------------------#
.align 2
.word 0x20004000 // initial Stack Pointer: 0x20000000 (RAM base) + 0x4000 (16K SRAM1 length)
.word 0x08000401 // initial Program Counter
.word _ISR_NMI // non-masking interrupt
.word _ISR_HARDF // hard fault interrupt
/* N.B.
Look at the .space or the .org assembler directive to insert the address of the
ISRs at the right place in the vector table. Verify your settings by the help of
the list file. */
.word _ISR_S0
#----------------------------------------------------------------------------------------#
.text // section .text (default section for program code)
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global init
.type init, %function
init:
CPSID i // disable interrupts globally
MOVS r0, #0 // safely initialize the GPRs
MOVS r1, #0
MOVS r2, #0
MOVS r3, #0
MOVS r4, #0
MOVS r5, #0
MOVS r6, #0
MOVS r7, #0
MOV r8, r0
MOV r9, r0
MOV r10, r0
MOV r11, r0
MOV r12, r0
#--- enable port clocking
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask for adjusting port clock gating (A: LEDs)
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for ports
STR r0, [r1, #0] // apply settings
#--- port init
#- LEDs
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0x03 // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r2 // delete bits
MOVS r2, #0x01 // load configuration mask
ORRS r0, r0, r2 // apply mask
STR r0, [r1, #0] // apply result to port A mode register
LDR r1, =GPIOA_MODER
MOVS r3, #0x03
LDR r0, [r1, #1]
BICS r0, r3
MOVS r3, #0x01
ORRS r0, r0, r3
STR r0, [r1, #2]
#- switch LED off
LDR r1, =GPIOA_ODR // load port A output data register
MOVS r2, #0x01 // load mask for LED
LDR r0, [r1, #0] // get current value of GPIOA
ORRS r0, r0, r2 // configure pin state
STR r0, [r1, #0] // apply settings
#- buttons
/* ... place your code here ... */
#--- button interrupt config
#- enable clock for SYSCFG module
#- connect GPIO pins of the buttons to EXTended Interrupt controller lines (EXTI)
# in SYSCFG module (SYSCFG_* registers)
#- configure lines in EXTI module (EXTI_* registers)
#- NVIC: set interrupt priority, clear pending bits
# and enable interrupts for buttons (see: PM, ch. 4.3, NVIC)
CPSIE i // enable interrupts globally
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global main
.type main, %function
main:
LDR r1, =GPIOA_ODR
EORS r0, r0, r3
STR r0, [r1, #0]
BL delay
B main
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global delay
.type delay, %function
delay:
MOVS r6, #0 // ...
LDR r7, =2000000 // ...
.L1:
ADDS r6, r6, #1 // ...
CMP r6, r7 // ...
BNE .L1 // ...
BX lr // ...
#----------------------------------------------------------------------------------------#
.align 2
.global stop
stop:
NOP // do nothing (NOP is here to avoid a debugger crash, only)
B stop // if this line is reached, something went wrong
#----------------------------------------------------------------------------------------#
.lp1: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------------#
.section .exhand,"ax" // section for exception handlers
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_NMI, %function
_ISR_NMI:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x44 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x0A // load mask for blue and yellow LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_NMI
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_HARDF, %function
_ISR_HARDF:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x11 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x05 // load mask for red and green LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_HARDF
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S0, %function
_ISR_S0:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S1, %function
_ISR_S1:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.lp2: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
.end
#************************************** E O F *******************************************#

View File

@ -0,0 +1,325 @@
#****************************************************************************************#
# Project: task2 - ASM: Interrupts
# File: task2.s
#
# Language: ASM
#
# Hardware: STefi Light v1.1
# Processor: STM32G431KBT6U
#
# Author: Manuel Lederhofer
# Datum: 31.10.2014
#
# Version: 6.0
# History:
# 31.10.2014 ML create file
# 27.09.2018 ML edit comments, extend vector table
# 18.12.2018 ML port from MKL05Z32VLC4 to STM32L476RG
# 27.02.2019 ML move section of exception handlers to bottom of file
# 25.09.2019 ML minor changes for a better code and comment understanding
# 04.09.2020 HL port from STM32L476RG to STM32F411xE
# 21.09.2020 ML tidy up, comments and formatting
# 29.09.2021 ML port from STM32F411xE to STM32F042K6T6
# 09.03.2022 ML port from STM32F042K6T6 to STM32G431KBT6U
# 10.02.2025 TK remove ASM:Polling,move ASM:Interrupts to task2
# 24.06.2025 TK remove /* ... place your code here ... */
#
# Status: working
#
# Description:
# See the description and requirements of the requested application
# in the lab exercise guide.
#
# Notes:
# - MCU speed at startup is 16 MHz
#
# ToDo:
# - Change the example code to match the description and requirements
# of the requested application in the lab exercise guide.
#****************************************************************************************#
.include "G431_addr.s"
#----------------------------------------------------------------------------------------#
.section .vectortable,"a" // vector table at begin of ROM
#----------------------------------------------------------------------------------------#
.align 2
.word 0x20004000 // initial Stack Pointer: 0x20000000 (RAM base) + 0x4000 (16K SRAM1 length)
.word 0x08000401 // initial Program Counter
.word _ISR_NMI // non-masking interrupt
.word _ISR_HARDF // hard fault interrupt
/* N.B.
Look at the .space or the .org assembler directive to insert the address of the
ISRs at the right place in the vector table. Verify your settings by the help of
the list file. */
.word _ISR_S0
#----------------------------------------------------------------------------------------#
.text // section .text (default section for program code)
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global init
.type init, %function
init:
CPSID i // disable interrupts globally
MOVS r0, #0 // safely initialize the GPRs
MOVS r1, #0
MOVS r2, #0
MOVS r3, #0
MOVS r4, #0
MOVS r5, #0
MOVS r6, #0
MOVS r7, #0
MOV r8, r0
MOV r9, r0
MOV r10, r0
MOV r11, r0
MOV r12, r0
#--- enable port clocking
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask for adjusting port clock gating (A: LEDs)
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for ports
STR r0, [r1, #0] // apply settings
#--- port init
#- LEDs
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0x03 // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r2 // delete bits
MOVS r2, #0x01 // load configuration mask
ORRS r0, r0, r2 // apply mask
STR r0, [r1, #0] // apply result to port A mode register
LDR r1, =GPIOA_MODER
MOVS r3, #0x05
LDR r0, [r1, #1]
BICS r0, r3
MOVS r3, #0x05
ORRS r0, r0, r3
STR r0, [r1, #1]
#- switch LED off
LDR r1, =GPIOA_ODR // load port A output data register
MOVS r2, #0x01 // load mask for LED
LDR r0, [r1, #0] // get current value of GPIOA
ORRS r0, r0, r2 // configure pin state
STR r0, [r1, #0] // apply settings
#- buttons
/* ... place your code here ... */
#--- button interrupt config
#- enable clock for SYSCFG module
#- connect GPIO pins of the buttons to EXTended Interrupt controller lines (EXTI)
# in SYSCFG module (SYSCFG_* registers)
#- configure lines in EXTI module (EXTI_* registers)
#- NVIC: set interrupt priority, clear pending bits
# and enable interrupts for buttons (see: PM, ch. 4.3, NVIC)
CPSIE i // enable interrupts globally
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global main
.type main, %function
main:
LDR r1, =GPIOA_ODR
EORS r0, r0, r3
STR r0, [r1, #0]
BL delay
B main
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global delay
.type delay, %function
delay:
MOVS r6, #0 // ...
LDR r7, =2000000 // ...
.L1:
ADDS r6, r6, #1 // ...
CMP r6, r7 // ...
BNE .L1 // ...
BX lr // ...
#----------------------------------------------------------------------------------------#
.align 2
.global stop
stop:
NOP // do nothing (NOP is here to avoid a debugger crash, only)
B stop // if this line is reached, something went wrong
#----------------------------------------------------------------------------------------#
.lp1: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------------#
.section .exhand,"ax" // section for exception handlers
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_NMI, %function
_ISR_NMI:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x44 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x0A // load mask for blue and yellow LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_NMI
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_HARDF, %function
_ISR_HARDF:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x11 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x05 // load mask for red and green LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_HARDF
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S0, %function
_ISR_S0:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S1, %function
_ISR_S1:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.lp2: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
.end
#************************************** E O F *******************************************#

View File

@ -0,0 +1,325 @@
#****************************************************************************************#
# Project: task2 - ASM: Interrupts
# File: task2.s
#
# Language: ASM
#
# Hardware: STefi Light v1.1
# Processor: STM32G431KBT6U
#
# Author: Manuel Lederhofer
# Datum: 31.10.2014
#
# Version: 6.0
# History:
# 31.10.2014 ML create file
# 27.09.2018 ML edit comments, extend vector table
# 18.12.2018 ML port from MKL05Z32VLC4 to STM32L476RG
# 27.02.2019 ML move section of exception handlers to bottom of file
# 25.09.2019 ML minor changes for a better code and comment understanding
# 04.09.2020 HL port from STM32L476RG to STM32F411xE
# 21.09.2020 ML tidy up, comments and formatting
# 29.09.2021 ML port from STM32F411xE to STM32F042K6T6
# 09.03.2022 ML port from STM32F042K6T6 to STM32G431KBT6U
# 10.02.2025 TK remove ASM:Polling,move ASM:Interrupts to task2
# 24.06.2025 TK remove /* ... place your code here ... */
#
# Status: working
#
# Description:
# See the description and requirements of the requested application
# in the lab exercise guide.
#
# Notes:
# - MCU speed at startup is 16 MHz
#
# ToDo:
# - Change the example code to match the description and requirements
# of the requested application in the lab exercise guide.
#****************************************************************************************#
.include "G431_addr.s"
#----------------------------------------------------------------------------------------#
.section .vectortable,"a" // vector table at begin of ROM
#----------------------------------------------------------------------------------------#
.align 2
.word 0x20004000 // initial Stack Pointer: 0x20000000 (RAM base) + 0x4000 (16K SRAM1 length)
.word 0x08000401 // initial Program Counter
.word _ISR_NMI // non-masking interrupt
.word _ISR_HARDF // hard fault interrupt
/* N.B.
Look at the .space or the .org assembler directive to insert the address of the
ISRs at the right place in the vector table. Verify your settings by the help of
the list file. */
.word _ISR_S0
#----------------------------------------------------------------------------------------#
.text // section .text (default section for program code)
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global init
.type init, %function
init:
CPSID i // disable interrupts globally
MOVS r0, #0 // safely initialize the GPRs
MOVS r1, #0
MOVS r2, #0
MOVS r3, #0
MOVS r4, #0
MOVS r5, #0
MOVS r6, #0
MOVS r7, #0
MOV r8, r0
MOV r9, r0
MOV r10, r0
MOV r11, r0
MOV r12, r0
#--- enable port clocking
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask for adjusting port clock gating (A: LEDs)
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for ports
STR r0, [r1, #0] // apply settings
#--- port init
#- LEDs
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0x03 // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r2 // delete bits
MOVS r2, #0x01 // load configuration mask
ORRS r0, r0, r2 // apply mask
STR r0, [r1, #0] // apply result to port A mode register
# LDR r1, =GPIOB_MODER
# MOVS r3, #0x03
# LDR r0, [r1, #1]
# BICS r0, r3
# MOVS r3, #0x01
# ORRS r0, r0, r3
# STR r0, [r1, #1]
#- switch LED off
LDR r1, =GPIOA_ODR // load port A output data register
MOVS r2, #0x01 // load mask for LED
LDR r0, [r1, #0] // get current value of GPIOA
ORRS r0, r0, r2 // configure pin state
STR r0, [r1, #0] // apply settings
#- buttons
/* ... place your code here ... */
#--- button interrupt config
#- enable clock for SYSCFG module
#- connect GPIO pins of the buttons to EXTended Interrupt controller lines (EXTI)
# in SYSCFG module (SYSCFG_* registers)
#- configure lines in EXTI module (EXTI_* registers)
#- NVIC: set interrupt priority, clear pending bits
# and enable interrupts for buttons (see: PM, ch. 4.3, NVIC)
CPSIE i // enable interrupts globally
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global main
.type main, %function
main:
LDR r1, =GPIOA_ODR
EORS r0, r0, r3
STR r0, [r1, #0]
BL delay
B main
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global delay
.type delay, %function
delay:
MOVS r6, #0 // ...
LDR r7, =2000000 // ...
.L1:
ADDS r6, r6, #1 // ...
CMP r6, r7 // ...
BNE .L1 // ...
BX lr // ...
#----------------------------------------------------------------------------------------#
.align 2
.global stop
stop:
NOP // do nothing (NOP is here to avoid a debugger crash, only)
B stop // if this line is reached, something went wrong
#----------------------------------------------------------------------------------------#
.lp1: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------------#
.section .exhand,"ax" // section for exception handlers
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_NMI, %function
_ISR_NMI:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x44 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x0A // load mask for blue and yellow LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_NMI
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_HARDF, %function
_ISR_HARDF:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x11 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x05 // load mask for red and green LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_HARDF
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S0, %function
_ISR_S0:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S1, %function
_ISR_S1:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.lp2: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
.end
#************************************** E O F *******************************************#

View File

@ -0,0 +1,325 @@
#****************************************************************************************#
# Project: task2 - ASM: Interrupts
# File: task2.s
#
# Language: ASM
#
# Hardware: STefi Light v1.1
# Processor: STM32G431KBT6U
#
# Author: Manuel Lederhofer
# Datum: 31.10.2014
#
# Version: 6.0
# History:
# 31.10.2014 ML create file
# 27.09.2018 ML edit comments, extend vector table
# 18.12.2018 ML port from MKL05Z32VLC4 to STM32L476RG
# 27.02.2019 ML move section of exception handlers to bottom of file
# 25.09.2019 ML minor changes for a better code and comment understanding
# 04.09.2020 HL port from STM32L476RG to STM32F411xE
# 21.09.2020 ML tidy up, comments and formatting
# 29.09.2021 ML port from STM32F411xE to STM32F042K6T6
# 09.03.2022 ML port from STM32F042K6T6 to STM32G431KBT6U
# 10.02.2025 TK remove ASM:Polling,move ASM:Interrupts to task2
# 24.06.2025 TK remove /* ... place your code here ... */
#
# Status: working
#
# Description:
# See the description and requirements of the requested application
# in the lab exercise guide.
#
# Notes:
# - MCU speed at startup is 16 MHz
#
# ToDo:
# - Change the example code to match the description and requirements
# of the requested application in the lab exercise guide.
#****************************************************************************************#
.include "G431_addr.s"
#----------------------------------------------------------------------------------------#
.section .vectortable,"a" // vector table at begin of ROM
#----------------------------------------------------------------------------------------#
.align 2
.word 0x20004000 // initial Stack Pointer: 0x20000000 (RAM base) + 0x4000 (16K SRAM1 length)
.word 0x08000401 // initial Program Counter
.word _ISR_NMI // non-masking interrupt
.word _ISR_HARDF // hard fault interrupt
/* N.B.
Look at the .space or the .org assembler directive to insert the address of the
ISRs at the right place in the vector table. Verify your settings by the help of
the list file. */
.word _ISR_S0
#----------------------------------------------------------------------------------------#
.text // section .text (default section for program code)
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global init
.type init, %function
init:
CPSID i // disable interrupts globally
MOVS r0, #0 // safely initialize the GPRs
MOVS r1, #0
MOVS r2, #0
MOVS r3, #0
MOVS r4, #0
MOVS r5, #0
MOVS r6, #0
MOVS r7, #0
MOV r8, r0
MOV r9, r0
MOV r10, r0
MOV r11, r0
MOV r12, r0
#--- enable port clocking
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask for adjusting port clock gating (A: LEDs)
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for ports
STR r0, [r1, #0] // apply settings
#--- port init
#- LEDs
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0x03 // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r2 // delete bits
MOVS r2, #0x01 // load configuration mask
ORRS r0, r0, r2 // apply mask
STR r0, [r1, #0] // apply result to port A mode register
LDR r1, =GPIOA_MODER
MOVS r3, #0x05
LDR r0, [r1, #1]
BICS r0, r3
MOVS r3, #0x03
ORRS r0, r0, r3
STR r0, [r1, #1]
#- switch LED off
LDR r1, =GPIOA_ODR // load port A output data register
MOVS r2, #0x01 // load mask for LED
LDR r0, [r1, #0] // get current value of GPIOA
ORRS r0, r0, r2 // configure pin state
STR r0, [r1, #0] // apply settings
#- buttons
/* ... place your code here ... */
#--- button interrupt config
#- enable clock for SYSCFG module
#- connect GPIO pins of the buttons to EXTended Interrupt controller lines (EXTI)
# in SYSCFG module (SYSCFG_* registers)
#- configure lines in EXTI module (EXTI_* registers)
#- NVIC: set interrupt priority, clear pending bits
# and enable interrupts for buttons (see: PM, ch. 4.3, NVIC)
CPSIE i // enable interrupts globally
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global main
.type main, %function
main:
LDR r1, =GPIOA_ODR
EORS r0, r0, r3
STR r0, [r1, #0]
BL delay
B main
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global delay
.type delay, %function
delay:
MOVS r6, #0 // ...
LDR r7, =2000000 // ...
.L1:
ADDS r6, r6, #1 // ...
CMP r6, r7 // ...
BNE .L1 // ...
BX lr // ...
#----------------------------------------------------------------------------------------#
.align 2
.global stop
stop:
NOP // do nothing (NOP is here to avoid a debugger crash, only)
B stop // if this line is reached, something went wrong
#----------------------------------------------------------------------------------------#
.lp1: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------------#
.section .exhand,"ax" // section for exception handlers
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_NMI, %function
_ISR_NMI:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x44 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x0A // load mask for blue and yellow LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_NMI
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_HARDF, %function
_ISR_HARDF:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x11 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x05 // load mask for red and green LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_HARDF
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S0, %function
_ISR_S0:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S1, %function
_ISR_S1:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.lp2: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
.end
#************************************** E O F *******************************************#

View File

@ -0,0 +1,325 @@
#****************************************************************************************#
# Project: task2 - ASM: Interrupts
# File: task2.s
#
# Language: ASM
#
# Hardware: STefi Light v1.1
# Processor: STM32G431KBT6U
#
# Author: Manuel Lederhofer
# Datum: 31.10.2014
#
# Version: 6.0
# History:
# 31.10.2014 ML create file
# 27.09.2018 ML edit comments, extend vector table
# 18.12.2018 ML port from MKL05Z32VLC4 to STM32L476RG
# 27.02.2019 ML move section of exception handlers to bottom of file
# 25.09.2019 ML minor changes for a better code and comment understanding
# 04.09.2020 HL port from STM32L476RG to STM32F411xE
# 21.09.2020 ML tidy up, comments and formatting
# 29.09.2021 ML port from STM32F411xE to STM32F042K6T6
# 09.03.2022 ML port from STM32F042K6T6 to STM32G431KBT6U
# 10.02.2025 TK remove ASM:Polling,move ASM:Interrupts to task2
# 24.06.2025 TK remove /* ... place your code here ... */
#
# Status: working
#
# Description:
# See the description and requirements of the requested application
# in the lab exercise guide.
#
# Notes:
# - MCU speed at startup is 16 MHz
#
# ToDo:
# - Change the example code to match the description and requirements
# of the requested application in the lab exercise guide.
#****************************************************************************************#
.include "G431_addr.s"
#----------------------------------------------------------------------------------------#
.section .vectortable,"a" // vector table at begin of ROM
#----------------------------------------------------------------------------------------#
.align 2
.word 0x20004000 // initial Stack Pointer: 0x20000000 (RAM base) + 0x4000 (16K SRAM1 length)
.word 0x08000401 // initial Program Counter
.word _ISR_NMI // non-masking interrupt
.word _ISR_HARDF // hard fault interrupt
/* N.B.
Look at the .space or the .org assembler directive to insert the address of the
ISRs at the right place in the vector table. Verify your settings by the help of
the list file. */
.word _ISR_S0
#----------------------------------------------------------------------------------------#
.text // section .text (default section for program code)
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global init
.type init, %function
init:
CPSID i // disable interrupts globally
MOVS r0, #0 // safely initialize the GPRs
MOVS r1, #0
MOVS r2, #0
MOVS r3, #0
MOVS r4, #0
MOVS r5, #0
MOVS r6, #0
MOVS r7, #0
MOV r8, r0
MOV r9, r0
MOV r10, r0
MOV r11, r0
MOV r12, r0
#--- enable port clocking
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask for adjusting port clock gating (A: LEDs)
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for ports
STR r0, [r1, #0] // apply settings
#--- port init
#- LEDs
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0x03 // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r2 // delete bits
MOVS r2, #0x01 // load configuration mask
ORRS r0, r0, r2 // apply mask
STR r0, [r1, #0] // apply result to port A mode register
LDR r1, =GPIOA_MODER
MOVS r3, #0x03
LDR r0, [r1, #1]
BICS r0, r3
MOVS r3, #0x01
ORRS r0, r0, r3
STR r0, [r1, #1]
#- switch LED off
LDR r1, =GPIOA_ODR // load port A output data register
MOVS r2, #0x01 // load mask for LED
LDR r0, [r1, #0] // get current value of GPIOA
ORRS r0, r0, r2 // configure pin state
STR r0, [r1, #0] // apply settings
#- buttons
/* ... place your code here ... */
#--- button interrupt config
#- enable clock for SYSCFG module
#- connect GPIO pins of the buttons to EXTended Interrupt controller lines (EXTI)
# in SYSCFG module (SYSCFG_* registers)
#- configure lines in EXTI module (EXTI_* registers)
#- NVIC: set interrupt priority, clear pending bits
# and enable interrupts for buttons (see: PM, ch. 4.3, NVIC)
CPSIE i // enable interrupts globally
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global main
.type main, %function
main:
LDR r1, =GPIOA_ODR
EORS r0, r0, r3
STR r0, [r1, #0]
BL delay
B main
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global delay
.type delay, %function
delay:
MOVS r6, #0 // ...
LDR r7, =2000000 // ...
.L1:
ADDS r6, r6, #1 // ...
CMP r6, r7 // ...
BNE .L1 // ...
BX lr // ...
#----------------------------------------------------------------------------------------#
.align 2
.global stop
stop:
NOP // do nothing (NOP is here to avoid a debugger crash, only)
B stop // if this line is reached, something went wrong
#----------------------------------------------------------------------------------------#
.lp1: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------------#
.section .exhand,"ax" // section for exception handlers
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_NMI, %function
_ISR_NMI:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x44 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x0A // load mask for blue and yellow LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_NMI
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_HARDF, %function
_ISR_HARDF:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x11 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x05 // load mask for red and green LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_HARDF
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S0, %function
_ISR_S0:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S1, %function
_ISR_S1:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.lp2: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
.end
#************************************** E O F *******************************************#

View File

@ -0,0 +1,325 @@
#****************************************************************************************#
# Project: task2 - ASM: Interrupts
# File: task2.s
#
# Language: ASM
#
# Hardware: STefi Light v1.1
# Processor: STM32G431KBT6U
#
# Author: Manuel Lederhofer
# Datum: 31.10.2014
#
# Version: 6.0
# History:
# 31.10.2014 ML create file
# 27.09.2018 ML edit comments, extend vector table
# 18.12.2018 ML port from MKL05Z32VLC4 to STM32L476RG
# 27.02.2019 ML move section of exception handlers to bottom of file
# 25.09.2019 ML minor changes for a better code and comment understanding
# 04.09.2020 HL port from STM32L476RG to STM32F411xE
# 21.09.2020 ML tidy up, comments and formatting
# 29.09.2021 ML port from STM32F411xE to STM32F042K6T6
# 09.03.2022 ML port from STM32F042K6T6 to STM32G431KBT6U
# 10.02.2025 TK remove ASM:Polling,move ASM:Interrupts to task2
# 24.06.2025 TK remove /* ... place your code here ... */
#
# Status: working
#
# Description:
# See the description and requirements of the requested application
# in the lab exercise guide.
#
# Notes:
# - MCU speed at startup is 16 MHz
#
# ToDo:
# - Change the example code to match the description and requirements
# of the requested application in the lab exercise guide.
#****************************************************************************************#
.include "G431_addr.s"
#----------------------------------------------------------------------------------------#
.section .vectortable,"a" // vector table at begin of ROM
#----------------------------------------------------------------------------------------#
.align 2
.word 0x20004000 // initial Stack Pointer: 0x20000000 (RAM base) + 0x4000 (16K SRAM1 length)
.word 0x08000401 // initial Program Counter
.word _ISR_NMI // non-masking interrupt
.word _ISR_HARDF // hard fault interrupt
/* N.B.
Look at the .space or the .org assembler directive to insert the address of the
ISRs at the right place in the vector table. Verify your settings by the help of
the list file. */
.word _ISR_S0
#----------------------------------------------------------------------------------------#
.text // section .text (default section for program code)
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global init
.type init, %function
init:
CPSID i // disable interrupts globally
MOVS r0, #0 // safely initialize the GPRs
MOVS r1, #0
MOVS r2, #0
MOVS r3, #0
MOVS r4, #0
MOVS r5, #0
MOVS r6, #0
MOVS r7, #0
MOV r8, r0
MOV r9, r0
MOV r10, r0
MOV r11, r0
MOV r12, r0
#--- enable port clocking
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask for adjusting port clock gating (A: LEDs)
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for ports
STR r0, [r1, #0] // apply settings
#--- port init
#- LEDs
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0x03 // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r2 // delete bits
MOVS r2, #0x01 // load configuration mask
ORRS r0, r0, r2 // apply mask
STR r0, [r1, #0] // apply result to port A mode register
LDR r1, =GPIOB_MODER
MOVS r3, #0x03
LDR r0, [r1, #1]
BICS r0, r3
MOVS r3, #0x01
ORRS r0, r0, r3
STR r0, [r1, #1]
#- switch LED off
LDR r1, =GPIOA_ODR // load port A output data register
MOVS r2, #0x01 // load mask for LED
LDR r0, [r1, #0] // get current value of GPIOA
ORRS r0, r0, r2 // configure pin state
STR r0, [r1, #0] // apply settings
#- buttons
/* ... place your code here ... */
#--- button interrupt config
#- enable clock for SYSCFG module
#- connect GPIO pins of the buttons to EXTended Interrupt controller lines (EXTI)
# in SYSCFG module (SYSCFG_* registers)
#- configure lines in EXTI module (EXTI_* registers)
#- NVIC: set interrupt priority, clear pending bits
# and enable interrupts for buttons (see: PM, ch. 4.3, NVIC)
CPSIE i // enable interrupts globally
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global main
.type main, %function
main:
LDR r1, =GPIOA_ODR
EORS r0, r0, r3
STR r0, [r1, #0]
BL delay
B main
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global delay
.type delay, %function
delay:
MOVS r6, #0 // ...
LDR r7, =2000000 // ...
.L1:
ADDS r6, r6, #1 // ...
CMP r6, r7 // ...
BNE .L1 // ...
BX lr // ...
#----------------------------------------------------------------------------------------#
.align 2
.global stop
stop:
NOP // do nothing (NOP is here to avoid a debugger crash, only)
B stop // if this line is reached, something went wrong
#----------------------------------------------------------------------------------------#
.lp1: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------------#
.section .exhand,"ax" // section for exception handlers
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_NMI, %function
_ISR_NMI:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x44 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x0A // load mask for blue and yellow LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_NMI
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_HARDF, %function
_ISR_HARDF:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x11 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x05 // load mask for red and green LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_HARDF
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S0, %function
_ISR_S0:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S1, %function
_ISR_S1:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.lp2: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
.end
#************************************** E O F *******************************************#

View File

@ -0,0 +1,325 @@
#****************************************************************************************#
# Project: task2 - ASM: Interrupts
# File: task2.s
#
# Language: ASM
#
# Hardware: STefi Light v1.1
# Processor: STM32G431KBT6U
#
# Author: Manuel Lederhofer
# Datum: 31.10.2014
#
# Version: 6.0
# History:
# 31.10.2014 ML create file
# 27.09.2018 ML edit comments, extend vector table
# 18.12.2018 ML port from MKL05Z32VLC4 to STM32L476RG
# 27.02.2019 ML move section of exception handlers to bottom of file
# 25.09.2019 ML minor changes for a better code and comment understanding
# 04.09.2020 HL port from STM32L476RG to STM32F411xE
# 21.09.2020 ML tidy up, comments and formatting
# 29.09.2021 ML port from STM32F411xE to STM32F042K6T6
# 09.03.2022 ML port from STM32F042K6T6 to STM32G431KBT6U
# 10.02.2025 TK remove ASM:Polling,move ASM:Interrupts to task2
# 24.06.2025 TK remove /* ... place your code here ... */
#
# Status: working
#
# Description:
# See the description and requirements of the requested application
# in the lab exercise guide.
#
# Notes:
# - MCU speed at startup is 16 MHz
#
# ToDo:
# - Change the example code to match the description and requirements
# of the requested application in the lab exercise guide.
#****************************************************************************************#
.include "G431_addr.s"
#----------------------------------------------------------------------------------------#
.section .vectortable,"a" // vector table at begin of ROM
#----------------------------------------------------------------------------------------#
.align 2
.word 0x20004000 // initial Stack Pointer: 0x20000000 (RAM base) + 0x4000 (16K SRAM1 length)
.word 0x08000401 // initial Program Counter
.word _ISR_NMI // non-masking interrupt
.word _ISR_HARDF // hard fault interrupt
/* N.B.
Look at the .space or the .org assembler directive to insert the address of the
ISRs at the right place in the vector table. Verify your settings by the help of
the list file. */
.word _ISR_S0
#----------------------------------------------------------------------------------------#
.text // section .text (default section for program code)
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global init
.type init, %function
init:
CPSID i // disable interrupts globally
MOVS r0, #0 // safely initialize the GPRs
MOVS r1, #0
MOVS r2, #0
MOVS r3, #0
MOVS r4, #0
MOVS r5, #0
MOVS r6, #0
MOVS r7, #0
MOV r8, r0
MOV r9, r0
MOV r10, r0
MOV r11, r0
MOV r12, r0
#--- enable port clocking
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask for adjusting port clock gating (A: LEDs)
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for ports
STR r0, [r1, #0] // apply settings
#--- port init
#- LEDs
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0x03 // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r2 // delete bits
MOVS r2, #0x01 // load configuration mask
ORRS r0, r0, r2 // apply mask
STR r0, [r1, #0] // apply result to port A mode register
LDR r1, =GPIOA_MODER
MOVS r3, #0x01
LDR r0, [r1, #1]
BICS r0, r3
MOVS r3, #0x01
ORRS r0, r0, r3
STR r0, [r1, #1]
#- switch LED off
LDR r1, =GPIOA_ODR // load port A output data register
MOVS r2, #0x01 // load mask for LED
LDR r0, [r1, #0] // get current value of GPIOA
ORRS r0, r0, r2 // configure pin state
STR r0, [r1, #0] // apply settings
#- buttons
/* ... place your code here ... */
#--- button interrupt config
#- enable clock for SYSCFG module
#- connect GPIO pins of the buttons to EXTended Interrupt controller lines (EXTI)
# in SYSCFG module (SYSCFG_* registers)
#- configure lines in EXTI module (EXTI_* registers)
#- NVIC: set interrupt priority, clear pending bits
# and enable interrupts for buttons (see: PM, ch. 4.3, NVIC)
CPSIE i // enable interrupts globally
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global main
.type main, %function
main:
LDR r1, =GPIOA_ODR
EORS r0, r0, r3
STR r0, [r1, #0]
BL delay
B main
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global delay
.type delay, %function
delay:
MOVS r6, #0 // ...
LDR r7, =2000000 // ...
.L1:
ADDS r6, r6, #1 // ...
CMP r6, r7 // ...
BNE .L1 // ...
BX lr // ...
#----------------------------------------------------------------------------------------#
.align 2
.global stop
stop:
NOP // do nothing (NOP is here to avoid a debugger crash, only)
B stop // if this line is reached, something went wrong
#----------------------------------------------------------------------------------------#
.lp1: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------------#
.section .exhand,"ax" // section for exception handlers
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_NMI, %function
_ISR_NMI:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x44 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x0A // load mask for blue and yellow LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_NMI
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_HARDF, %function
_ISR_HARDF:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x11 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x05 // load mask for red and green LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_HARDF
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S0, %function
_ISR_S0:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S1, %function
_ISR_S1:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.lp2: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
.end
#************************************** E O F *******************************************#

View File

@ -0,0 +1,325 @@
#****************************************************************************************#
# Project: task2 - ASM: Interrupts
# File: task2.s
#
# Language: ASM
#
# Hardware: STefi Light v1.1
# Processor: STM32G431KBT6U
#
# Author: Manuel Lederhofer
# Datum: 31.10.2014
#
# Version: 6.0
# History:
# 31.10.2014 ML create file
# 27.09.2018 ML edit comments, extend vector table
# 18.12.2018 ML port from MKL05Z32VLC4 to STM32L476RG
# 27.02.2019 ML move section of exception handlers to bottom of file
# 25.09.2019 ML minor changes for a better code and comment understanding
# 04.09.2020 HL port from STM32L476RG to STM32F411xE
# 21.09.2020 ML tidy up, comments and formatting
# 29.09.2021 ML port from STM32F411xE to STM32F042K6T6
# 09.03.2022 ML port from STM32F042K6T6 to STM32G431KBT6U
# 10.02.2025 TK remove ASM:Polling,move ASM:Interrupts to task2
# 24.06.2025 TK remove /* ... place your code here ... */
#
# Status: working
#
# Description:
# See the description and requirements of the requested application
# in the lab exercise guide.
#
# Notes:
# - MCU speed at startup is 16 MHz
#
# ToDo:
# - Change the example code to match the description and requirements
# of the requested application in the lab exercise guide.
#****************************************************************************************#
.include "G431_addr.s"
#----------------------------------------------------------------------------------------#
.section .vectortable,"a" // vector table at begin of ROM
#----------------------------------------------------------------------------------------#
.align 2
.word 0x20004000 // initial Stack Pointer: 0x20000000 (RAM base) + 0x4000 (16K SRAM1 length)
.word 0x08000401 // initial Program Counter
.word _ISR_NMI // non-masking interrupt
.word _ISR_HARDF // hard fault interrupt
/* N.B.
Look at the .space or the .org assembler directive to insert the address of the
ISRs at the right place in the vector table. Verify your settings by the help of
the list file. */
.word _ISR_S0
#----------------------------------------------------------------------------------------#
.text // section .text (default section for program code)
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global init
.type init, %function
init:
CPSID i // disable interrupts globally
MOVS r0, #0 // safely initialize the GPRs
MOVS r1, #0
MOVS r2, #0
MOVS r3, #0
MOVS r4, #0
MOVS r5, #0
MOVS r6, #0
MOVS r7, #0
MOV r8, r0
MOV r9, r0
MOV r10, r0
MOV r11, r0
MOV r12, r0
#--- enable port clocking
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask for adjusting port clock gating (A: LEDs)
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for ports
STR r0, [r1, #0] // apply settings
#--- port init
#- LEDs
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0x03 // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r2 // delete bits
MOVS r2, #0x01 // load configuration mask
ORRS r0, r0, r2 // apply mask
STR r0, [r1, #0] // apply result to port A mode register
LDR r1, =GPIOA_MODER
MOVS r3, #0x02
LDR r0, [r1, #1]
BICS r0, r3
MOVS r3, #0x01
ORRS r0, r0, r3
STR r0, [r1, #1]
#- switch LED off
LDR r1, =GPIOA_ODR // load port A output data register
MOVS r2, #0x01 // load mask for LED
LDR r0, [r1, #0] // get current value of GPIOA
ORRS r0, r0, r2 // configure pin state
STR r0, [r1, #0] // apply settings
#- buttons
/* ... place your code here ... */
#--- button interrupt config
#- enable clock for SYSCFG module
#- connect GPIO pins of the buttons to EXTended Interrupt controller lines (EXTI)
# in SYSCFG module (SYSCFG_* registers)
#- configure lines in EXTI module (EXTI_* registers)
#- NVIC: set interrupt priority, clear pending bits
# and enable interrupts for buttons (see: PM, ch. 4.3, NVIC)
CPSIE i // enable interrupts globally
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global main
.type main, %function
main:
LDR r1, =GPIOA_ODR
EORS r0, r0, r3
STR r0, [r1, #0]
BL delay
B main
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global delay
.type delay, %function
delay:
MOVS r6, #0 // ...
LDR r7, =2000000 // ...
.L1:
ADDS r6, r6, #1 // ...
CMP r6, r7 // ...
BNE .L1 // ...
BX lr // ...
#----------------------------------------------------------------------------------------#
.align 2
.global stop
stop:
NOP // do nothing (NOP is here to avoid a debugger crash, only)
B stop // if this line is reached, something went wrong
#----------------------------------------------------------------------------------------#
.lp1: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------------#
.section .exhand,"ax" // section for exception handlers
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_NMI, %function
_ISR_NMI:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x44 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x0A // load mask for blue and yellow LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_NMI
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_HARDF, %function
_ISR_HARDF:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x11 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x05 // load mask for red and green LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_HARDF
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S0, %function
_ISR_S0:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S1, %function
_ISR_S1:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.lp2: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
.end
#************************************** E O F *******************************************#

View File

@ -0,0 +1,314 @@
#****************************************************************************************#
# Project: task2 - ASM: Interrupts
# File: task2.s
#
# Language: ASM
#
# Hardware: STefi Light v1.1
# Processor: STM32G431KBT6U
#
# Author: Manuel Lederhofer
# Datum: 31.10.2014
#
# Version: 6.0
# History:
# 31.10.2014 ML create file
# 27.09.2018 ML edit comments, extend vector table
# 18.12.2018 ML port from MKL05Z32VLC4 to STM32L476RG
# 27.02.2019 ML move section of exception handlers to bottom of file
# 25.09.2019 ML minor changes for a better code and comment understanding
# 04.09.2020 HL port from STM32L476RG to STM32F411xE
# 21.09.2020 ML tidy up, comments and formatting
# 29.09.2021 ML port from STM32F411xE to STM32F042K6T6
# 09.03.2022 ML port from STM32F042K6T6 to STM32G431KBT6U
# 10.02.2025 TK remove ASM:Polling,move ASM:Interrupts to task2
# 24.06.2025 TK remove /* ... place your code here ... */
#
# Status: working
#
# Description:
# See the description and requirements of the requested application
# in the lab exercise guide.
#
# Notes:
# - MCU speed at startup is 16 MHz
#
# ToDo:
# - Change the example code to match the description and requirements
# of the requested application in the lab exercise guide.
#****************************************************************************************#
.include "G431_addr.s"
#----------------------------------------------------------------------------------------#
.section .vectortable,"a" // vector table at begin of ROM
#----------------------------------------------------------------------------------------#
.align 2
.word 0x20004000 // initial Stack Pointer: 0x20000000 (RAM base) + 0x4000 (16K SRAM1 length)
.word 0x08000401 // initial Program Counter
.word _ISR_NMI // non-masking interrupt
.word _ISR_HARDF // hard fault interrupt
/* N.B.
Look at the .space or the .org assembler directive to insert the address of the
ISRs at the right place in the vector table. Verify your settings by the help of
the list file. */
.word _ISR_S0
#----------------------------------------------------------------------------------------#
.text // section .text (default section for program code)
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global init
.type init, %function
init:
CPSID i // disable interrupts globally
MOVS r0, #0 // safely initialize the GPRs
MOVS r1, #0
MOVS r2, #0
MOVS r3, #0
MOVS r4, #0
MOVS r5, #0
MOVS r6, #0
MOVS r7, #0
MOV r8, r0
MOV r9, r0
MOV r10, r0
MOV r11, r0
MOV r12, r0
#--- enable port clocking
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask for adjusting port clock gating (A: LEDs)
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for ports
STR r0, [r1, #0] // apply settings
#--- port init
#- LEDs
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0x03 // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r2 // delete bits
MOVS r2, #0x01 // load configuration mask
ORRS r0, r0, r2 // apply mask
STR r0, [r1, #0] // apply result to port A mode register
#- switch LED off
LDR r1, =GPIOA_ODR // load port A output data register
MOVS r2, #0x01 // load mask for LED
LDR r0, [r1, #0] // get current value of GPIOA
ORRS r0, r0, r2 // configure pin state
STR r0, [r1, #0] // apply settings
#- buttons
/* ... place your code here ... */
#--- button interrupt config
#- enable clock for SYSCFG module
#- connect GPIO pins of the buttons to EXTended Interrupt controller lines (EXTI)
# in SYSCFG module (SYSCFG_* registers)
#- configure lines in EXTI module (EXTI_* registers)
#- NVIC: set interrupt priority, clear pending bits
# and enable interrupts for buttons (see: PM, ch. 4.3, NVIC)
CPSIE i // enable interrupts globally
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global main
.type main, %function
main:
LDR r1, =GPIOA_ODR
EORS r0, r0, r2
STR r0, [r1, #0]
BL delay
B main
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global delay
.type delay, %function
delay:
MOVS r6, #0 // ...
LDR r7, =2000000 // ...
.L1:
ADDS r6, r6, #1 // ...
CMP r6, r7 // ...
BNE .L1 // ...
BX lr // ...
#----------------------------------------------------------------------------------------#
.align 2
.global stop
stop:
NOP // do nothing (NOP is here to avoid a debugger crash, only)
B stop // if this line is reached, something went wrong
#----------------------------------------------------------------------------------------#
.lp1: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------------#
.section .exhand,"ax" // section for exception handlers
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_NMI, %function
_ISR_NMI:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x44 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x0A // load mask for blue and yellow LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_NMI
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_HARDF, %function
_ISR_HARDF:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x11 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x05 // load mask for red and green LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_HARDF
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S0, %function
_ISR_S0:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S1, %function
_ISR_S1:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.lp2: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
.end
#************************************** E O F *******************************************#

View File

@ -0,0 +1,325 @@
#****************************************************************************************#
# Project: task2 - ASM: Interrupts
# File: task2.s
#
# Language: ASM
#
# Hardware: STefi Light v1.1
# Processor: STM32G431KBT6U
#
# Author: Manuel Lederhofer
# Datum: 31.10.2014
#
# Version: 6.0
# History:
# 31.10.2014 ML create file
# 27.09.2018 ML edit comments, extend vector table
# 18.12.2018 ML port from MKL05Z32VLC4 to STM32L476RG
# 27.02.2019 ML move section of exception handlers to bottom of file
# 25.09.2019 ML minor changes for a better code and comment understanding
# 04.09.2020 HL port from STM32L476RG to STM32F411xE
# 21.09.2020 ML tidy up, comments and formatting
# 29.09.2021 ML port from STM32F411xE to STM32F042K6T6
# 09.03.2022 ML port from STM32F042K6T6 to STM32G431KBT6U
# 10.02.2025 TK remove ASM:Polling,move ASM:Interrupts to task2
# 24.06.2025 TK remove /* ... place your code here ... */
#
# Status: working
#
# Description:
# See the description and requirements of the requested application
# in the lab exercise guide.
#
# Notes:
# - MCU speed at startup is 16 MHz
#
# ToDo:
# - Change the example code to match the description and requirements
# of the requested application in the lab exercise guide.
#****************************************************************************************#
.include "G431_addr.s"
#----------------------------------------------------------------------------------------#
.section .vectortable,"a" // vector table at begin of ROM
#----------------------------------------------------------------------------------------#
.align 2
.word 0x20004000 // initial Stack Pointer: 0x20000000 (RAM base) + 0x4000 (16K SRAM1 length)
.word 0x08000401 // initial Program Counter
.word _ISR_NMI // non-masking interrupt
.word _ISR_HARDF // hard fault interrupt
/* N.B.
Look at the .space or the .org assembler directive to insert the address of the
ISRs at the right place in the vector table. Verify your settings by the help of
the list file. */
.word _ISR_S0
#----------------------------------------------------------------------------------------#
.text // section .text (default section for program code)
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global init
.type init, %function
init:
CPSID i // disable interrupts globally
MOVS r0, #0 // safely initialize the GPRs
MOVS r1, #0
MOVS r2, #0
MOVS r3, #0
MOVS r4, #0
MOVS r5, #0
MOVS r6, #0
MOVS r7, #0
MOV r8, r0
MOV r9, r0
MOV r10, r0
MOV r11, r0
MOV r12, r0
#--- enable port clocking
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask for adjusting port clock gating (A: LEDs)
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for ports
STR r0, [r1, #0] // apply settings
#--- port init
#- LEDs
# LDR r1, =GPIOA_MODER // load port A mode register address
# MOVS r2, #0x03 // prepare mask
# LDR r0, [r1, #0] // get current value of port A mode register
# BICS r0, r2 // delete bits
# MOVS r2, #0x01 // load configuration mask
# ORRS r0, r0, r2 // apply mask
# STR r0, [r1, #0] // apply result to port A mode register
LDR r1, =GPIOB_MODER
MOVS r3, #0x03
LDR r0, [r1, #1]
BICS r0, r3
MOVS r3, #0x01
ORRS r0, r0, r3
STR r0, [r1, #1]
#- switch LED off
LDR r1, =GPIOA_ODR // load port A output data register
MOVS r2, #0x01 // load mask for LED
LDR r0, [r1, #0] // get current value of GPIOA
ORRS r0, r0, r2 // configure pin state
STR r0, [r1, #0] // apply settings
#- buttons
/* ... place your code here ... */
#--- button interrupt config
#- enable clock for SYSCFG module
#- connect GPIO pins of the buttons to EXTended Interrupt controller lines (EXTI)
# in SYSCFG module (SYSCFG_* registers)
#- configure lines in EXTI module (EXTI_* registers)
#- NVIC: set interrupt priority, clear pending bits
# and enable interrupts for buttons (see: PM, ch. 4.3, NVIC)
CPSIE i // enable interrupts globally
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global main
.type main, %function
main:
LDR r1, =GPIOA_ODR
EORS r0, r0, r3
STR r0, [r1, #0]
BL delay
B main
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global delay
.type delay, %function
delay:
MOVS r6, #0 // ...
LDR r7, =2000000 // ...
.L1:
ADDS r6, r6, #1 // ...
CMP r6, r7 // ...
BNE .L1 // ...
BX lr // ...
#----------------------------------------------------------------------------------------#
.align 2
.global stop
stop:
NOP // do nothing (NOP is here to avoid a debugger crash, only)
B stop // if this line is reached, something went wrong
#----------------------------------------------------------------------------------------#
.lp1: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------------#
.section .exhand,"ax" // section for exception handlers
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_NMI, %function
_ISR_NMI:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x44 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x0A // load mask for blue and yellow LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_NMI
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_HARDF, %function
_ISR_HARDF:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x11 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x05 // load mask for red and green LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_HARDF
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S0, %function
_ISR_S0:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S1, %function
_ISR_S1:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.lp2: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
.end
#************************************** E O F *******************************************#

View File

@ -0,0 +1,325 @@
#****************************************************************************************#
# Project: task2 - ASM: Interrupts
# File: task2.s
#
# Language: ASM
#
# Hardware: STefi Light v1.1
# Processor: STM32G431KBT6U
#
# Author: Manuel Lederhofer
# Datum: 31.10.2014
#
# Version: 6.0
# History:
# 31.10.2014 ML create file
# 27.09.2018 ML edit comments, extend vector table
# 18.12.2018 ML port from MKL05Z32VLC4 to STM32L476RG
# 27.02.2019 ML move section of exception handlers to bottom of file
# 25.09.2019 ML minor changes for a better code and comment understanding
# 04.09.2020 HL port from STM32L476RG to STM32F411xE
# 21.09.2020 ML tidy up, comments and formatting
# 29.09.2021 ML port from STM32F411xE to STM32F042K6T6
# 09.03.2022 ML port from STM32F042K6T6 to STM32G431KBT6U
# 10.02.2025 TK remove ASM:Polling,move ASM:Interrupts to task2
# 24.06.2025 TK remove /* ... place your code here ... */
#
# Status: working
#
# Description:
# See the description and requirements of the requested application
# in the lab exercise guide.
#
# Notes:
# - MCU speed at startup is 16 MHz
#
# ToDo:
# - Change the example code to match the description and requirements
# of the requested application in the lab exercise guide.
#****************************************************************************************#
.include "G431_addr.s"
#----------------------------------------------------------------------------------------#
.section .vectortable,"a" // vector table at begin of ROM
#----------------------------------------------------------------------------------------#
.align 2
.word 0x20004000 // initial Stack Pointer: 0x20000000 (RAM base) + 0x4000 (16K SRAM1 length)
.word 0x08000401 // initial Program Counter
.word _ISR_NMI // non-masking interrupt
.word _ISR_HARDF // hard fault interrupt
/* N.B.
Look at the .space or the .org assembler directive to insert the address of the
ISRs at the right place in the vector table. Verify your settings by the help of
the list file. */
.word _ISR_S0
#----------------------------------------------------------------------------------------#
.text // section .text (default section for program code)
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global init
.type init, %function
init:
CPSID i // disable interrupts globally
MOVS r0, #0 // safely initialize the GPRs
MOVS r1, #0
MOVS r2, #0
MOVS r3, #0
MOVS r4, #0
MOVS r5, #0
MOVS r6, #0
MOVS r7, #0
MOV r8, r0
MOV r9, r0
MOV r10, r0
MOV r11, r0
MOV r12, r0
#--- enable port clocking
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask for adjusting port clock gating (A: LEDs)
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for ports
STR r0, [r1, #0] // apply settings
#--- port init
#- LEDs
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0x03 // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r2 // delete bits
MOVS r2, #0x01 // load configuration mask
ORRS r0, r0, r2 // apply mask
STR r0, [r1, #0] // apply result to port A mode register
LDR r1, =GPIOA_MODER
MOVS r3, #0x03
LDR r0, [r1, #2]
BICS r0, r3
MOVS r3, #0x01
ORRS r0, r0, r3
STR r0, [r1, #2]
#- switch LED off
LDR r1, =GPIOA_ODR // load port A output data register
MOVS r2, #0x01 // load mask for LED
LDR r0, [r1, #0] // get current value of GPIOA
ORRS r0, r0, r2 // configure pin state
STR r0, [r1, #0] // apply settings
#- buttons
/* ... place your code here ... */
#--- button interrupt config
#- enable clock for SYSCFG module
#- connect GPIO pins of the buttons to EXTended Interrupt controller lines (EXTI)
# in SYSCFG module (SYSCFG_* registers)
#- configure lines in EXTI module (EXTI_* registers)
#- NVIC: set interrupt priority, clear pending bits
# and enable interrupts for buttons (see: PM, ch. 4.3, NVIC)
CPSIE i // enable interrupts globally
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global main
.type main, %function
main:
LDR r1, =GPIOA_ODR
EORS r0, r0, r3
STR r0, [r1, #0]
BL delay
B main
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global delay
.type delay, %function
delay:
MOVS r6, #0 // ...
LDR r7, =2000000 // ...
.L1:
ADDS r6, r6, #1 // ...
CMP r6, r7 // ...
BNE .L1 // ...
BX lr // ...
#----------------------------------------------------------------------------------------#
.align 2
.global stop
stop:
NOP // do nothing (NOP is here to avoid a debugger crash, only)
B stop // if this line is reached, something went wrong
#----------------------------------------------------------------------------------------#
.lp1: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------------#
.section .exhand,"ax" // section for exception handlers
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_NMI, %function
_ISR_NMI:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x44 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x0A // load mask for blue and yellow LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_NMI
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_HARDF, %function
_ISR_HARDF:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x11 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x05 // load mask for red and green LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_HARDF
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S0, %function
_ISR_S0:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S1, %function
_ISR_S1:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.lp2: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
.end
#************************************** E O F *******************************************#

View File

@ -0,0 +1,325 @@
#****************************************************************************************#
# Project: task2 - ASM: Interrupts
# File: task2.s
#
# Language: ASM
#
# Hardware: STefi Light v1.1
# Processor: STM32G431KBT6U
#
# Author: Manuel Lederhofer
# Datum: 31.10.2014
#
# Version: 6.0
# History:
# 31.10.2014 ML create file
# 27.09.2018 ML edit comments, extend vector table
# 18.12.2018 ML port from MKL05Z32VLC4 to STM32L476RG
# 27.02.2019 ML move section of exception handlers to bottom of file
# 25.09.2019 ML minor changes for a better code and comment understanding
# 04.09.2020 HL port from STM32L476RG to STM32F411xE
# 21.09.2020 ML tidy up, comments and formatting
# 29.09.2021 ML port from STM32F411xE to STM32F042K6T6
# 09.03.2022 ML port from STM32F042K6T6 to STM32G431KBT6U
# 10.02.2025 TK remove ASM:Polling,move ASM:Interrupts to task2
# 24.06.2025 TK remove /* ... place your code here ... */
#
# Status: working
#
# Description:
# See the description and requirements of the requested application
# in the lab exercise guide.
#
# Notes:
# - MCU speed at startup is 16 MHz
#
# ToDo:
# - Change the example code to match the description and requirements
# of the requested application in the lab exercise guide.
#****************************************************************************************#
.include "G431_addr.s"
#----------------------------------------------------------------------------------------#
.section .vectortable,"a" // vector table at begin of ROM
#----------------------------------------------------------------------------------------#
.align 2
.word 0x20004000 // initial Stack Pointer: 0x20000000 (RAM base) + 0x4000 (16K SRAM1 length)
.word 0x08000401 // initial Program Counter
.word _ISR_NMI // non-masking interrupt
.word _ISR_HARDF // hard fault interrupt
/* N.B.
Look at the .space or the .org assembler directive to insert the address of the
ISRs at the right place in the vector table. Verify your settings by the help of
the list file. */
.word _ISR_S0
#----------------------------------------------------------------------------------------#
.text // section .text (default section for program code)
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global init
.type init, %function
init:
CPSID i // disable interrupts globally
MOVS r0, #0 // safely initialize the GPRs
MOVS r1, #0
MOVS r2, #0
MOVS r3, #0
MOVS r4, #0
MOVS r5, #0
MOVS r6, #0
MOVS r7, #0
MOV r8, r0
MOV r9, r0
MOV r10, r0
MOV r11, r0
MOV r12, r0
#--- enable port clocking
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask for adjusting port clock gating (A: LEDs)
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for ports
STR r0, [r1, #0] // apply settings
#--- port init
#- LEDs
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0x03 // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r2 // delete bits
MOVS r2, #0x01 // load configuration mask
ORRS r0, r0, r2 // apply mask
STR r0, [r1, #0] // apply result to port A mode register
LDR r1, =GPIOA_MODER
MOVS r3, #0x03
LDR r0, [r1, #1]
BICS r0, r3
MOVS r3, #0x01
ORRS r0, r0, r3
STR r0, [r1, #1]
#- switch LED off
LDR r1, =GPIOA_ODR // load port A output data register
MOVS r2, #0x01 // load mask for LED
LDR r0, [r1, #0] // get current value of GPIOA
ORRS r0, r0, r2 // configure pin state
STR r0, [r1, #0] // apply settings
#- buttons
/* ... place your code here ... */
#--- button interrupt config
#- enable clock for SYSCFG module
#- connect GPIO pins of the buttons to EXTended Interrupt controller lines (EXTI)
# in SYSCFG module (SYSCFG_* registers)
#- configure lines in EXTI module (EXTI_* registers)
#- NVIC: set interrupt priority, clear pending bits
# and enable interrupts for buttons (see: PM, ch. 4.3, NVIC)
CPSIE i // enable interrupts globally
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global main
.type main, %function
main:
LDR r1, =GPIOA_ODR
EORS r0, r0, r3
STR r0, [r1, #0]
BL delay
B main
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global delay
.type delay, %function
delay:
MOVS r6, #0 // ...
LDR r7, =2000000 // ...
.L1:
ADDS r6, r6, #1 // ...
CMP r6, r7 // ...
BNE .L1 // ...
BX lr // ...
#----------------------------------------------------------------------------------------#
.align 2
.global stop
stop:
NOP // do nothing (NOP is here to avoid a debugger crash, only)
B stop // if this line is reached, something went wrong
#----------------------------------------------------------------------------------------#
.lp1: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------------#
.section .exhand,"ax" // section for exception handlers
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_NMI, %function
_ISR_NMI:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x44 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x0A // load mask for blue and yellow LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_NMI
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_HARDF, %function
_ISR_HARDF:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x11 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x05 // load mask for red and green LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_HARDF
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S0, %function
_ISR_S0:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S1, %function
_ISR_S1:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.lp2: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
.end
#************************************** E O F *******************************************#

View File

@ -1,212 +0,0 @@
/* ***************************************************************************************
* Project: task1 - C:GPIO
* File: task1.c
*
* Language: C
*
* Hardware: STefi Light v1.1
* Processor: STM32G431KBT6U
*
* Author: Manuel Lederhofer
* Datum: 10.09.2021
*
* Version: 2.1
* History:
* 10.09.2021 ML create project
* 09.03.2022 ML port from STM32F042K6T6 to STM32G431KBT6U
* 18.02.2025 TK changed projectname to "C: GPIO)
*
* Status: under development
*
* Description:
* Blinks the red LED of STefi Light, currently.
* This file contains the main routine and the initialization.
*
* Notes:
* - MCU speed at startup is 16 MHz
*
* Todo:
* - Change the example code to match the description and requirements
* of the requested application in the lab exercise guide.
*
************************************************************************************** */
/* ------------------------------------ INCLUDES -------------------------------------- */
#include "stm32g431xx.h"
#include "STefi-Light.h"
/* ------------------------------------ DEFINES --------------------------------------- */
#define LOOPS_PER_MS 1244 // NOP-loops for delay()
#define WAITTIME 333
/* ------------------------------------ TYPE DEFINITIONS ------------------------------ */
/* ------------------------------------ GLOBAL VARIABLES ------------------------------ */
int state = 0;
/* ------------------------------------ PRIVATE VARIABLES ----------------------------- */
/* ------------------------------------ PROTOTYPES ------------------------------------ */
static void GPIO_init(void);
static void delay(const uint16_t ms);
/* ------------------------------------ M A I N --------------------------------------- */
int main(void)
{
/* --- initialization --- */
__disable_irq(); // disable interrupts globally
GPIO_init();
__enable_irq(); // enable interrupts globally
/* --- one time tasks --- */
//s0 Hilfvariablen auserhalb von while deklarieren
int running = 0; //0 Lauflicht aus, 1 Lauflicht an
int lastButtonState = 1; // Hilfsvariable zur Flankenerkennung
/* --- infinite processing loop --- */
while (1)
{
int buttonState = GPIOB->IDR & (1 << 0);
// fallende Flanke erkennen
if (lastButtonState && !buttonState)
{
running ^= 1; // toggle running
/* delay(50); // entprellen */
}
lastButtonState = buttonState;
if(running)
{
switch (state)
{
case 0:
state++;
GPIOA->ODR &= ~(1 << 0);
delay(WAITTIME);
GPIOA->ODR |= (1 << 0);
break;
case 1:
state++;
GPIOA->ODR &= ~(1 << 1);
delay(WAITTIME);
GPIOA->ODR |= (1 << 1);
break;
case 2:
state++;
GPIOA->ODR &= ~(1 << 2);
delay(WAITTIME);
GPIOA->ODR |= (1 << 2);
break;
case 3:
state++;
GPIOA->ODR &= ~(1 << 3);
delay(WAITTIME);
GPIOA->ODR |= (1 << 3);
break;
case 4:
state++;
GPIOA->ODR &= ~(1 << 2);
delay(WAITTIME);
GPIOA->ODR |= (1 << 2);
break;
case 5:
state=0;
GPIOA->ODR &= ~(1 << 1);
delay(WAITTIME);
GPIOA->ODR |= (1 << 1);
break;
case 99:
GPIOA->ODR |= MASK_LED_ALL;
while(1){
if((GPIOB->IDR & (1 << 0)) == 0){
delay(150);
state=0;
break;
}
}
}
}
}
//aktuell geht er mit drücken durch die cases
// wegen break geht er ganz aus der if bedingung raus, nicht nur ausm switch case
return 1;
}
/* ------------------------------------ GLOBAL FUNCTIONS ------------------------------ */
/* ------------------------------------ PRIVATE FUNCTIONS ----------------------------- */
/* ------------------------------------------------------------------------------------ *\
* method: static void GPIO_init(void)
*
* Initializes GPIOs on STefi Light for pins with peripherals attached.
*
* requires: - nothing -
* parameters: - none -
* returns: - nothing -
\* ------------------------------------------------------------------------------------ */
static void GPIO_init(void)
{
/* enable port clocks */
RCC->AHB2ENR |= RCC_AHB2ENR_GPIOAEN; // LEDs: A
RCC->AHB2ENR |= RCC_AHB2ENR_GPIOBEN; //Taster versuch
/* --- LEDs --- */
GPIOA->ODR |= MASK_LED_ALL;
GPIOA->MODER &= ~(3 << 0);
GPIOA->MODER |= (1 << 0); // set LED pin to output
/* LED1 als Output */
GPIOA->MODER &= ~(3 << 2); // Versuch: LED 1 Mode löschen :klappt so
GPIOA->MODER |= (1 << 2); // Versuch: LED 1 PA1 = output :klappt so
/* LED2 als Output */
GPIOA->MODER &= ~(3 << 4); // Versuch: LED 2 Mode löschen :klappt
GPIOA->MODER |= (1 << 4); // Versuch: LED 2 PA1 = output :klappt
/* LED3 als output */
GPIOA->MODER &= ~(3 << 6);
GPIOA->MODER |= (1 << 6);
/* s0 (PB0) als Input Versuch */
GPIOB->MODER &= ~(3 << 0);
/* Pull-Up Aktivieren Versuch */
GPIOB->PUPDR &= ~(3 << 0);
GPIOB->PUPDR |= (1 << 0); // 01 = Pull-Up
}
/* ------------------------------------------------------------------------------------ *\
* method: static void delay(const uint16_t ms)
*
* Realizes a millisecond delay by very bad busy-wait.
*
* requires: - nothing -
* parameters: ms - delay time in milliseconds
* returns: - nothing -
\* ------------------------------------------------------------------------------------ */
static void delay(const uint16_t ms)
{
for (uint16_t i = 0; i < ms; ++i)
{
if((GPIOB->IDR & (1 << 0) && state != 99) == 0){
state = 99;
break;
}
for (uint16_t j = 0; j < LOOPS_PER_MS; ++j)
{
__asm("NOP");
}
}
}
/* ************************************ E O F ***************************************** */

View File

@ -0,0 +1,324 @@
#****************************************************************************************#
# Project: task2 - ASM: Interrupts
# File: task2.s
#
# Language: ASM
#
# Hardware: STefi Light v1.1
# Processor: STM32G431KBT6U
#
# Author: Manuel Lederhofer
# Datum: 31.10.2014
#
# Version: 6.0
# History:
# 31.10.2014 ML create file
# 27.09.2018 ML edit comments, extend vector table
# 18.12.2018 ML port from MKL05Z32VLC4 to STM32L476RG
# 27.02.2019 ML move section of exception handlers to bottom of file
# 25.09.2019 ML minor changes for a better code and comment understanding
# 04.09.2020 HL port from STM32L476RG to STM32F411xE
# 21.09.2020 ML tidy up, comments and formatting
# 29.09.2021 ML port from STM32F411xE to STM32F042K6T6
# 09.03.2022 ML port from STM32F042K6T6 to STM32G431KBT6U
# 10.02.2025 TK remove ASM:Polling,move ASM:Interrupts to task2
# 24.06.2025 TK remove /* ... place your code here ... */
#
# Status: working
#
# Description:
# See the description and requirements of the requested application
# in the lab exercise guide.
#
# Notes:
# - MCU speed at startup is 16 MHz
#
# ToDo:
# - Change the example code to match the description and requirements
# of the requested application in the lab exercise guide.
#****************************************************************************************#
.include "G431_addr.s"
#----------------------------------------------------------------------------------------#
.section .vectortable,"a" // vector table at begin of ROM
#----------------------------------------------------------------------------------------#
.align 2
.word 0x20004000 // initial Stack Pointer: 0x20000000 (RAM base) + 0x4000 (16K SRAM1 length)
.word 0x08000401 // initial Program Counter
.word _ISR_NMI // non-masking interrupt
.word _ISR_HARDF // hard fault interrupt
/* N.B.
Look at the .space or the .org assembler directive to insert the address of the
ISRs at the right place in the vector table. Verify your settings by the help of
the list file. */
.word _ISR_S0
#----------------------------------------------------------------------------------------#
.text // section .text (default section for program code)
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global init
.type init, %function
init:
CPSID i // disable interrupts globally
MOVS r0, #0 // safely initialize the GPRs
MOVS r1, #0
MOVS r2, #0
MOVS r3, #0
MOVS r4, #0
MOVS r5, #0
MOVS r6, #0
MOVS r7, #0
MOV r8, r0
MOV r9, r0
MOV r10, r0
MOV r11, r0
MOV r12, r0
#--- enable port clocking
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask for adjusting port clock gating (A: LEDs)
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for ports
STR r0, [r1, #0] // apply settings
#--- port init
#- LEDs
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0x03 // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r2 // delete bits
MOVS r2, #0x01 // load configuration mask
ORRS r0, r0, r2 // apply mask
STR r0, [r1, #0] // apply result to port A mode register
LDR r1, =GPIOA_MODER
MOVS r3, #0x05
LDR r0, [r1, #1]
BICS r0, r3
MOVS r3, #0x01
ORRS r0, r0, r3
STR r0, [r1, #1]
#- switch LED off
LDR r1, =GPIOA_ODR // load port A output data register
MOVS r2, #0x01 // load mask for LED
LDR r0, [r1, #0] // get current value of GPIOA
ORRS r0, r0, r2 // configure pin state
STR r0, [r1, #0] // apply settings
#- buttons
/* ... place your code here ... */
LDR r1, =GPIO_IDR
MOVS
#--- button interrupt config
#- enable clock for SYSCFG module
#- connect GPIO pins of the buttons to EXTended Interrupt controller lines (EXTI)
# in SYSCFG module (SYSCFG_* registers)
#- configure lines in EXTI module (EXTI_* registers)
#- NVIC: set interrupt priority, clear pending bits
# and enable interrupts for buttons (see: PM, ch. 4.3, NVIC)
CPSIE i // enable interrupts globally
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global main
.type main, %function
main:
LDR r1, =GPIOA_ODR
EORS r0, r0, r2
EORS r0, r0, r3
STR r0, [r1, #0]
BL delay
B main
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global delay
.type delay, %function
delay:
MOVS r6, #0 // ...
LDR r7, =2000000 // ...
.L1:
ADDS r6, r6, #1 // ...
CMP r6, r7 // ...
BNE .L1 // ...
BX lr // ...
#----------------------------------------------------------------------------------------#
.align 2
.global stop
stop:
NOP // do nothing (NOP is here to avoid a debugger crash, only)
B stop // if this line is reached, something went wrong
#----------------------------------------------------------------------------------------#
.lp1: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------------#
.section .exhand,"ax" // section for exception handlers
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_NMI, %function
_ISR_NMI:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x44 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x0A // load mask for blue and yellow LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_NMI
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_HARDF, %function
_ISR_HARDF:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x11 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x05 // load mask for red and green LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_HARDF
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S0, %function
_ISR_S0:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S1, %function
_ISR_S1:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.lp2: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
.end
#************************************** E O F *******************************************#

View File

@ -0,0 +1,323 @@
#****************************************************************************************#
# Project: task2 - ASM: Interrupts
# File: task2.s
#
# Language: ASM
#
# Hardware: STefi Light v1.1
# Processor: STM32G431KBT6U
#
# Author: Manuel Lederhofer
# Datum: 31.10.2014
#
# Version: 6.0
# History:
# 31.10.2014 ML create file
# 27.09.2018 ML edit comments, extend vector table
# 18.12.2018 ML port from MKL05Z32VLC4 to STM32L476RG
# 27.02.2019 ML move section of exception handlers to bottom of file
# 25.09.2019 ML minor changes for a better code and comment understanding
# 04.09.2020 HL port from STM32L476RG to STM32F411xE
# 21.09.2020 ML tidy up, comments and formatting
# 29.09.2021 ML port from STM32F411xE to STM32F042K6T6
# 09.03.2022 ML port from STM32F042K6T6 to STM32G431KBT6U
# 10.02.2025 TK remove ASM:Polling,move ASM:Interrupts to task2
# 24.06.2025 TK remove /* ... place your code here ... */
#
# Status: working
#
# Description:
# See the description and requirements of the requested application
# in the lab exercise guide.
#
# Notes:
# - MCU speed at startup is 16 MHz
#
# ToDo:
# - Change the example code to match the description and requirements
# of the requested application in the lab exercise guide.
#****************************************************************************************#
.include "G431_addr.s"
#----------------------------------------------------------------------------------------#
.section .vectortable,"a" // vector table at begin of ROM
#----------------------------------------------------------------------------------------#
.align 2
.word 0x20004000 // initial Stack Pointer: 0x20000000 (RAM base) + 0x4000 (16K SRAM1 length)
.word 0x08000401 // initial Program Counter
.word _ISR_NMI // non-masking interrupt
.word _ISR_HARDF // hard fault interrupt
/* N.B.
Look at the .space or the .org assembler directive to insert the address of the
ISRs at the right place in the vector table. Verify your settings by the help of
the list file. */
.word _ISR_S0
#----------------------------------------------------------------------------------------#
.text // section .text (default section for program code)
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global init
.type init, %function
init:
CPSID i // disable interrupts globally
MOVS r0, #0 // safely initialize the GPRs
MOVS r1, #0
MOVS r2, #0
MOVS r3, #0
MOVS r4, #0
MOVS r5, #0
MOVS r6, #0
MOVS r7, #0
MOV r8, r0
MOV r9, r0
MOV r10, r0
MOV r11, r0
MOV r12, r0
#--- enable port clocking
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask for adjusting port clock gating (A: LEDs)
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for ports
STR r0, [r1, #0] // apply settings
#--- port init
#- LEDs
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0x03 // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r2 // delete bits
MOVS r2, #0x01 // load configuration mask
ORRS r0, r0, r2 // apply mask
STR r0, [r1, #0] // apply result to port A mode register
LDR r1, =GPIOA_MODER
MOVS r3, #0x05
LDR r0, [r1, #1]
BICS r0, r3
MOVS r3, #0x01
ORRS r0, r0, r3
STR r0, [r1, #1]
#- switch LED off
LDR r1, =GPIOA_ODR // load port A output data register
MOVS r2, #0x01 // load mask for LED
LDR r0, [r1, #0] // get current value of GPIOA
ORRS r0, r0, r2 // configure pin state
STR r0, [r1, #0] // apply settings
#- buttons
/* ... place your code here ... */
#--- button interrupt config
#- enable clock for SYSCFG module
#- connect GPIO pins of the buttons to EXTended Interrupt controller lines (EXTI)
# in SYSCFG module (SYSCFG_* registers)
#- configure lines in EXTI module (EXTI_* registers)
#- NVIC: set interrupt priority, clear pending bits
# and enable interrupts for buttons (see: PM, ch. 4.3, NVIC)
CPSIE i // enable interrupts globally
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global main
.type main, %function
main:
LDR r1, =GPIOA_ODR
EORS r0, r0, r2
EORS r0, r0, r3
STR r0, [r1, #0]
BL delay
B main
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global delay
.type delay, %function
delay:
MOVS r6, #0 // ...
LDR r7, =2000000 // ...
.L1:
ADDS r6, r6, #1 // ...
CMP r6, r7 // ...
BNE .L1 // ...
BX lr // ...
#----------------------------------------------------------------------------------------#
.align 2
.global stop
stop:
NOP // do nothing (NOP is here to avoid a debugger crash, only)
B stop // if this line is reached, something went wrong
#----------------------------------------------------------------------------------------#
.lp1: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------------#
.section .exhand,"ax" // section for exception handlers
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_NMI, %function
_ISR_NMI:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x44 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x0A // load mask for blue and yellow LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_NMI
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_HARDF, %function
_ISR_HARDF:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x11 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x05 // load mask for red and green LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_HARDF
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S0, %function
_ISR_S0:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S1, %function
_ISR_S1:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.lp2: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
.end
#************************************** E O F *******************************************#

View File

@ -0,0 +1,325 @@
#****************************************************************************************#
# Project: task2 - ASM: Interrupts
# File: task2.s
#
# Language: ASM
#
# Hardware: STefi Light v1.1
# Processor: STM32G431KBT6U
#
# Author: Manuel Lederhofer
# Datum: 31.10.2014
#
# Version: 6.0
# History:
# 31.10.2014 ML create file
# 27.09.2018 ML edit comments, extend vector table
# 18.12.2018 ML port from MKL05Z32VLC4 to STM32L476RG
# 27.02.2019 ML move section of exception handlers to bottom of file
# 25.09.2019 ML minor changes for a better code and comment understanding
# 04.09.2020 HL port from STM32L476RG to STM32F411xE
# 21.09.2020 ML tidy up, comments and formatting
# 29.09.2021 ML port from STM32F411xE to STM32F042K6T6
# 09.03.2022 ML port from STM32F042K6T6 to STM32G431KBT6U
# 10.02.2025 TK remove ASM:Polling,move ASM:Interrupts to task2
# 24.06.2025 TK remove /* ... place your code here ... */
#
# Status: working
#
# Description:
# See the description and requirements of the requested application
# in the lab exercise guide.
#
# Notes:
# - MCU speed at startup is 16 MHz
#
# ToDo:
# - Change the example code to match the description and requirements
# of the requested application in the lab exercise guide.
#****************************************************************************************#
.include "G431_addr.s"
#----------------------------------------------------------------------------------------#
.section .vectortable,"a" // vector table at begin of ROM
#----------------------------------------------------------------------------------------#
.align 2
.word 0x20004000 // initial Stack Pointer: 0x20000000 (RAM base) + 0x4000 (16K SRAM1 length)
.word 0x08000401 // initial Program Counter
.word _ISR_NMI // non-masking interrupt
.word _ISR_HARDF // hard fault interrupt
/* N.B.
Look at the .space or the .org assembler directive to insert the address of the
ISRs at the right place in the vector table. Verify your settings by the help of
the list file. */
.word _ISR_S0
#----------------------------------------------------------------------------------------#
.text // section .text (default section for program code)
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global init
.type init, %function
init:
CPSID i // disable interrupts globally
MOVS r0, #0 // safely initialize the GPRs
MOVS r1, #0
MOVS r2, #0
MOVS r3, #0
MOVS r4, #0
MOVS r5, #0
MOVS r6, #0
MOVS r7, #0
MOV r8, r0
MOV r9, r0
MOV r10, r0
MOV r11, r0
MOV r12, r0
#--- enable port clocking
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask for adjusting port clock gating (A: LEDs)
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for ports
STR r0, [r1, #0] // apply settings
#--- port init
#- LEDs
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0x03 // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r2 // delete bits
MOVS r2, #0x01 // load configuration mask
ORRS r0, r0, r2 // apply mask
STR r0, [r1, #0] // apply result to port A mode register
# LDR r1, =GPIOA_MODER
# MOVS r3, #0x05
# LDR r0, [r1, #1]
# BICS r0, r3
# MOVS r3, #0x01
# ORRS r0, r0, r3
# STR r0, [r1, #1]
#- switch LED off
LDR r1, =GPIOA_ODR // load port A output data register
MOVS r2, #0x01 // load mask for LED
LDR r0, [r1, #0] // get current value of GPIOA
ORRS r0, r0, r2 // configure pin state
STR r0, [r1, #0] // apply settings
#- buttons
/* ... place your code here ... */
#--- button interrupt config
#- enable clock for SYSCFG module
#- connect GPIO pins of the buttons to EXTended Interrupt controller lines (EXTI)
# in SYSCFG module (SYSCFG_* registers)
#- configure lines in EXTI module (EXTI_* registers)
#- NVIC: set interrupt priority, clear pending bits
# and enable interrupts for buttons (see: PM, ch. 4.3, NVIC)
CPSIE i // enable interrupts globally
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global main
.type main, %function
main:
LDR r1, =GPIOA_ODR
EORS r0, r0, r3
STR r0, [r1, #0]
BL delay
B main
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global delay
.type delay, %function
delay:
MOVS r6, #0 // ...
LDR r7, =2000000 // ...
.L1:
ADDS r6, r6, #1 // ...
CMP r6, r7 // ...
BNE .L1 // ...
BX lr // ...
#----------------------------------------------------------------------------------------#
.align 2
.global stop
stop:
NOP // do nothing (NOP is here to avoid a debugger crash, only)
B stop // if this line is reached, something went wrong
#----------------------------------------------------------------------------------------#
.lp1: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------------#
.section .exhand,"ax" // section for exception handlers
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_NMI, %function
_ISR_NMI:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x44 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x0A // load mask for blue and yellow LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_NMI
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_HARDF, %function
_ISR_HARDF:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x11 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x05 // load mask for red and green LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_HARDF
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S0, %function
_ISR_S0:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S1, %function
_ISR_S1:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.lp2: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
.end
#************************************** E O F *******************************************#

View File

@ -0,0 +1,315 @@
#****************************************************************************************#
# Project: task2 - ASM: Interrupts
# File: task2.s
#
# Language: ASM
#
# Hardware: STefi Light v1.1
# Processor: STM32G431KBT6U
#
# Author: Manuel Lederhofer
# Datum: 31.10.2014
#
# Version: 6.0
# History:
# 31.10.2014 ML create file
# 27.09.2018 ML edit comments, extend vector table
# 18.12.2018 ML port from MKL05Z32VLC4 to STM32L476RG
# 27.02.2019 ML move section of exception handlers to bottom of file
# 25.09.2019 ML minor changes for a better code and comment understanding
# 04.09.2020 HL port from STM32L476RG to STM32F411xE
# 21.09.2020 ML tidy up, comments and formatting
# 29.09.2021 ML port from STM32F411xE to STM32F042K6T6
# 09.03.2022 ML port from STM32F042K6T6 to STM32G431KBT6U
# 10.02.2025 TK remove ASM:Polling,move ASM:Interrupts to task2
# 24.06.2025 TK remove /* ... place your code here ... */
#
# Status: working
#
# Description:
# See the description and requirements of the requested application
# in the lab exercise guide.
#
# Notes:
# - MCU speed at startup is 16 MHz
#
# ToDo:
# - Change the example code to match the description and requirements
# of the requested application in the lab exercise guide.
#****************************************************************************************#
.include "G431_addr.s"
#----------------------------------------------------------------------------------------#
.section .vectortable,"a" // vector table at begin of ROM
#----------------------------------------------------------------------------------------#
.align 2
.word 0x20004000 // initial Stack Pointer: 0x20000000 (RAM base) + 0x4000 (16K SRAM1 length)
.word 0x08000401 // initial Program Counter
.word _ISR_NMI // non-masking interrupt
.word _ISR_HARDF // hard fault interrupt
/* N.B.
Look at the .space or the .org assembler directive to insert the address of the
ISRs at the right place in the vector table. Verify your settings by the help of
the list file. */
.word _ISR_S0
#----------------------------------------------------------------------------------------#
.text // section .text (default section for program code)
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global init
.type init, %function
init:
CPSID i // disable interrupts globally
MOVS r0, #0 // safely initialize the GPRs
MOVS r1, #0
MOVS r2, #0
MOVS r3, #0
MOVS r4, #0
MOVS r5, #0
MOVS r6, #0
MOVS r7, #0
MOV r8, r0
MOV r9, r0
MOV r10, r0
MOV r11, r0
MOV r12, r0
#--- enable port clocking
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask for adjusting port clock gating (A: LEDs)
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for ports
STR r0, [r1, #0] // apply settings
#--- port init
#- LEDs
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0x03 // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r2 // delete bits
MOVS r2, #0x01 // load configuration mask
ORRS r0, r0, r2 // apply mask
STR r0, [r1, #0] // apply result to port A mode register
#- switch LED off
LDR r1, =GPIOA_ODR // load port A output data register
MOVS r2, #0x01 // load mask for LED
LDR r0, [r1, #0] // get current value of GPIOA
ORRS r0, r0, r2 // configure pin state
STR r0, [r1, #0] // apply settings
#- buttons
/* ... place your code here ... */
LDR r1, =GPIO_IDR
MOVS
#--- button interrupt config
#- enable clock for SYSCFG module
#- connect GPIO pins of the buttons to EXTended Interrupt controller lines (EXTI)
# in SYSCFG module (SYSCFG_* registers)
#- configure lines in EXTI module (EXTI_* registers)
#- NVIC: set interrupt priority, clear pending bits
# and enable interrupts for buttons (see: PM, ch. 4.3, NVIC)
CPSIE i // enable interrupts globally
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global main
.type main, %function
main:
LDR r1, =GPIOA_ODR
EORS r0, r0, r2
STR r0, [r1, #0]
BL delay
B main
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global delay
.type delay, %function
delay:
MOVS r6, #0 // ...
LDR r7, =2000000 // ...
.L1:
ADDS r6, r6, #1 // ...
CMP r6, r7 // ...
BNE .L1 // ...
BX lr // ...
#----------------------------------------------------------------------------------------#
.align 2
.global stop
stop:
NOP // do nothing (NOP is here to avoid a debugger crash, only)
B stop // if this line is reached, something went wrong
#----------------------------------------------------------------------------------------#
.lp1: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------------#
.section .exhand,"ax" // section for exception handlers
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_NMI, %function
_ISR_NMI:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x44 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x0A // load mask for blue and yellow LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_NMI
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_HARDF, %function
_ISR_HARDF:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x11 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x05 // load mask for red and green LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_HARDF
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S0, %function
_ISR_S0:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S1, %function
_ISR_S1:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.lp2: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
.end
#************************************** E O F *******************************************#

View File

@ -0,0 +1,325 @@
#****************************************************************************************#
# Project: task2 - ASM: Interrupts
# File: task2.s
#
# Language: ASM
#
# Hardware: STefi Light v1.1
# Processor: STM32G431KBT6U
#
# Author: Manuel Lederhofer
# Datum: 31.10.2014
#
# Version: 6.0
# History:
# 31.10.2014 ML create file
# 27.09.2018 ML edit comments, extend vector table
# 18.12.2018 ML port from MKL05Z32VLC4 to STM32L476RG
# 27.02.2019 ML move section of exception handlers to bottom of file
# 25.09.2019 ML minor changes for a better code and comment understanding
# 04.09.2020 HL port from STM32L476RG to STM32F411xE
# 21.09.2020 ML tidy up, comments and formatting
# 29.09.2021 ML port from STM32F411xE to STM32F042K6T6
# 09.03.2022 ML port from STM32F042K6T6 to STM32G431KBT6U
# 10.02.2025 TK remove ASM:Polling,move ASM:Interrupts to task2
# 24.06.2025 TK remove /* ... place your code here ... */
#
# Status: working
#
# Description:
# See the description and requirements of the requested application
# in the lab exercise guide.
#
# Notes:
# - MCU speed at startup is 16 MHz
#
# ToDo:
# - Change the example code to match the description and requirements
# of the requested application in the lab exercise guide.
#****************************************************************************************#
.include "G431_addr.s"
#----------------------------------------------------------------------------------------#
.section .vectortable,"a" // vector table at begin of ROM
#----------------------------------------------------------------------------------------#
.align 2
.word 0x20004000 // initial Stack Pointer: 0x20000000 (RAM base) + 0x4000 (16K SRAM1 length)
.word 0x08000401 // initial Program Counter
.word _ISR_NMI // non-masking interrupt
.word _ISR_HARDF // hard fault interrupt
/* N.B.
Look at the .space or the .org assembler directive to insert the address of the
ISRs at the right place in the vector table. Verify your settings by the help of
the list file. */
.word _ISR_S0
#----------------------------------------------------------------------------------------#
.text // section .text (default section for program code)
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global init
.type init, %function
init:
CPSID i // disable interrupts globally
MOVS r0, #0 // safely initialize the GPRs
MOVS r1, #0
MOVS r2, #0
MOVS r3, #0
MOVS r4, #0
MOVS r5, #0
MOVS r6, #0
MOVS r7, #0
MOV r8, r0
MOV r9, r0
MOV r10, r0
MOV r11, r0
MOV r12, r0
#--- enable port clocking
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask for adjusting port clock gating (A: LEDs)
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for ports
STR r0, [r1, #0] // apply settings
#--- port init
#- LEDs
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0x03 // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r2 // delete bits
MOVS r2, #0x01 // load configuration mask
ORRS r0, r0, r2 // apply mask
STR r0, [r1, #0] // apply result to port A mode register
LDR r1, =GPIOA_MODER
MOVS r3, #0x05
LDR r0, [r1, #1]
BICS r0, r3
MOVS r3, #0x02
ORRS r0, r0, r3
STR r0, [r1, #1]
#- switch LED off
LDR r1, =GPIOA_ODR // load port A output data register
MOVS r2, #0x01 // load mask for LED
LDR r0, [r1, #0] // get current value of GPIOA
ORRS r0, r0, r2 // configure pin state
STR r0, [r1, #0] // apply settings
#- buttons
/* ... place your code here ... */
#--- button interrupt config
#- enable clock for SYSCFG module
#- connect GPIO pins of the buttons to EXTended Interrupt controller lines (EXTI)
# in SYSCFG module (SYSCFG_* registers)
#- configure lines in EXTI module (EXTI_* registers)
#- NVIC: set interrupt priority, clear pending bits
# and enable interrupts for buttons (see: PM, ch. 4.3, NVIC)
CPSIE i // enable interrupts globally
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global main
.type main, %function
main:
LDR r1, =GPIOA_ODR
EORS r0, r0, r3
STR r0, [r1, #0]
BL delay
B main
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global delay
.type delay, %function
delay:
MOVS r6, #0 // ...
LDR r7, =2000000 // ...
.L1:
ADDS r6, r6, #1 // ...
CMP r6, r7 // ...
BNE .L1 // ...
BX lr // ...
#----------------------------------------------------------------------------------------#
.align 2
.global stop
stop:
NOP // do nothing (NOP is here to avoid a debugger crash, only)
B stop // if this line is reached, something went wrong
#----------------------------------------------------------------------------------------#
.lp1: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------------#
.section .exhand,"ax" // section for exception handlers
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_NMI, %function
_ISR_NMI:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x44 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x0A // load mask for blue and yellow LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_NMI
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_HARDF, %function
_ISR_HARDF:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x11 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x05 // load mask for red and green LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_HARDF
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S0, %function
_ISR_S0:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S1, %function
_ISR_S1:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.lp2: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
.end
#************************************** E O F *******************************************#

Binary file not shown.

View File

@ -5,4 +5,4 @@
//org.eclipse.debug.core.PREFERRED_DELEGATES/org.eclipse.cdt.launch.remoteApplicationLaunchType=org.eclipse.rse.remotecdt.dsf.debug,debug,; //org.eclipse.debug.core.PREFERRED_DELEGATES/org.eclipse.cdt.launch.remoteApplicationLaunchType=org.eclipse.rse.remotecdt.dsf.debug,debug,;
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.debug.core.PREF_DELETE_CONFIGS_ON_PROJECT_DELETE=false org.eclipse.debug.core.PREF_DELETE_CONFIGS_ON_PROJECT_DELETE=false
prefWatchExpressions=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\r\n<watchExpressions/>\r\n prefWatchExpressions=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\n<watchExpressions/>\n

View File

@ -1,7 +1,7 @@
LaunchTargetManager/org.eclipse.launchbar.core.launchTargetType.local,Local/arch=x86_64 LaunchTargetManager/org.eclipse.launchbar.core.launchTargetType.local,Local/arch=x86_64
LaunchTargetManager/org.eclipse.launchbar.core.launchTargetType.local,Local/name=Local LaunchTargetManager/org.eclipse.launchbar.core.launchTargetType.local,Local/name=Local
LaunchTargetManager/org.eclipse.launchbar.core.launchTargetType.local,Local/os=win32 LaunchTargetManager/org.eclipse.launchbar.core.launchTargetType.local,Local/os=win32
configDescList=org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:task3 Debug,org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:task3,org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:task4,org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:task2,org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:task1 configDescList=org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:task3 Debug,org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:task3,org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:task4,org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:task1,org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:task2
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:A3_Timer/activeLaunchMode=run org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:A3_Timer/activeLaunchMode=run
org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:task1/activeLaunchMode=run org.eclipse.cdt.dsf.gdb.gdbRemotedescriptorType\:task1/activeLaunchMode=run

View File

@ -1,6 +1,6 @@
IMPORT_FILES_AND_FOLDERS_RELATIVE=true IMPORT_FILES_AND_FOLDERS_RELATIVE=true
IMPORT_FILES_AND_FOLDERS_TYPE=23,1 IMPORT_FILES_AND_FOLDERS_TYPE=23,1
eclipse.preferences.version=1 eclipse.preferences.version=1
platformState=1772304866316 platformState=1772304866322
quickStart=false quickStart=false
tipsAndTricks=true tipsAndTricks=true

View File

@ -2,8 +2,8 @@
<launchHistory> <launchHistory>
<launchGroup id="org.eclipse.debug.ui.launchGroup.debug"> <launchGroup id="org.eclipse.debug.ui.launchGroup.debug">
<mruHistory> <mruHistory>
<launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;launchConfiguration local=&quot;false&quot; path=&quot;/task1/task1.launch&quot;/&gt;&#13;&#10;"/>
<launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;launchConfiguration local=&quot;false&quot; path=&quot;/task2/task2.launch&quot;/&gt;&#13;&#10;"/> <launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;launchConfiguration local=&quot;false&quot; path=&quot;/task2/task2.launch&quot;/&gt;&#13;&#10;"/>
<launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;launchConfiguration local=&quot;false&quot; path=&quot;/task1/task1.launch&quot;/&gt;&#13;&#10;"/>
<launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;launchConfiguration local=&quot;false&quot; path=&quot;/task4/task4.launch&quot;/&gt;&#13;&#10;"/> <launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;launchConfiguration local=&quot;false&quot; path=&quot;/task4/task4.launch&quot;/&gt;&#13;&#10;"/>
<launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;launchConfiguration local=&quot;false&quot; path=&quot;/task3/task3 Debug.launch&quot;/&gt;&#13;&#10;"/> <launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;launchConfiguration local=&quot;false&quot; path=&quot;/task3/task3 Debug.launch&quot;/&gt;&#13;&#10;"/>
</mruHistory> </mruHistory>
@ -24,8 +24,8 @@
</launchGroup> </launchGroup>
<launchGroup id="org.eclipse.debug.ui.launchGroup.run"> <launchGroup id="org.eclipse.debug.ui.launchGroup.run">
<mruHistory> <mruHistory>
<launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;launchConfiguration local=&quot;false&quot; path=&quot;/task1/task1.launch&quot;/&gt;&#13;&#10;"/>
<launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;launchConfiguration local=&quot;false&quot; path=&quot;/task2/task2.launch&quot;/&gt;&#13;&#10;"/> <launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;launchConfiguration local=&quot;false&quot; path=&quot;/task2/task2.launch&quot;/&gt;&#13;&#10;"/>
<launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;launchConfiguration local=&quot;false&quot; path=&quot;/task1/task1.launch&quot;/&gt;&#13;&#10;"/>
<launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;launchConfiguration local=&quot;false&quot; path=&quot;/task4/task4.launch&quot;/&gt;&#13;&#10;"/> <launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;launchConfiguration local=&quot;false&quot; path=&quot;/task4/task4.launch&quot;/&gt;&#13;&#10;"/>
<launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;launchConfiguration local=&quot;false&quot; path=&quot;/task3/task3 Debug.launch&quot;/&gt;&#13;&#10;"/> <launch memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;launchConfiguration local=&quot;false&quot; path=&quot;/task3/task3 Debug.launch&quot;/&gt;&#13;&#10;"/>
</mruHistory> </mruHistory>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<session version="1.0">&#x0A;<refactoring comment="Rename resource &apos;task2/task2.s&apos; to &apos;task2_tobi.s&apos;" description="Rename resource &apos;task2.s&apos;" flags="7" id="org.eclipse.ltk.core.refactoring.rename.resource" input="task2.s" name="task2_tobi.s" stamp="1774358097434" updateReferences="true"/>&#x0A;<refactoring comment="Rename resource &apos;task2/task2_efe.s&apos; to &apos;task2.s&apos;" description="Rename resource &apos;task2_efe.s&apos;" flags="7" id="org.eclipse.ltk.core.refactoring.rename.resource" input="task2_efe.s" name="task2.s" stamp="1774358106409" updateReferences="true"/>
</session>

View File

@ -0,0 +1,2 @@
1774358097434 Rename resource 'task2.s'
1774358106409 Rename resource 'task2_efe.s'

View File

@ -1,3 +1,3 @@
#Fri Mar 20 18:06:30 CET 2026 #Tue Mar 24 14:11:27 CET 2026
org.eclipse.core.runtime=2 org.eclipse.core.runtime=2
org.eclipse.platform=4.30.0.v20231201-0110 org.eclipse.platform=4.30.0.v20231201-0110

View File

@ -1,8 +1,16 @@
= 3.2 Aufgabe 2 - ASM: Interrupts, Entprellen = 3.2 Aufgabe 2 - ASM: Interrupts, Entprellen
== Aufgabenstellung: == Aufgabenstellung:
Das Programm soll per Tastendruck den Zustand der LEDs wechseln. Taster *S-1* soll *LED0* und *LED3* ein-bzw. auschalten, Taster *S1 LED1* und *LED2* Das Programm soll per Tastendruck den Zustand der LEDs wechseln. Taster *S1* soll *LED0* und *LED3* ein-bzw. auschalten, Taster *S1 LED1* und *LED2*
== Vorbereitungsfragen: == Vorbereitungsfragen:
=== a. Welche vier Einträge stehen am Beginn der ARM Exception Vector Table? === a. Welche vier Einträge stehen am Beginn der ARM Exception Vector Table?
#table(
columns: (1fr, auto, auto),
inset: 10pt,
align: horizon,
table.header(
[*Postion*], [*Vektor*], [*Beschreibung*]
),
[0], [WWDG],
=== b. Wie viele Interrupt-Prioritätsstufen unterstützt ein ARM-Controller maximal? === b. Wie viele Interrupt-Prioritätsstufen unterstützt ein ARM-Controller maximal?
=== c. An welchen Positionen in der Exception Vector Table stehen die Adressen der ISRs für die Tasten? (ST Dokumentation) === c. An welchen Positionen in der Exception Vector Table stehen die Adressen der ISRs für die Tasten? (ST Dokumentation)
=== d. Schauen Sie sich das Prellen eines Tasters an und überlegen Sie sich eine Lösung. === d. Schauen Sie sich das Prellen eines Tasters an und überlegen Sie sich eine Lösung.

View File

@ -1,3 +0,0 @@
../Src/task1.c:53:5:main 14
../Src/task1.c:157:13:GPIO_init 1
../Src/task1.c:197:13:delay 6

View File

@ -1,11 +0,0 @@
Src/task1.o: ../Src/task1.c ../Inc/stm32g431xx.h ../Inc/core_cm4.h \
../Inc/cmsis_version.h ../Inc/cmsis_compiler.h ../Inc/cmsis_gcc.h \
../Inc/mpu_armv7.h ../Inc/system_stm32g4xx.h ../Inc/STefi-Light.h
../Inc/stm32g431xx.h:
../Inc/core_cm4.h:
../Inc/cmsis_version.h:
../Inc/cmsis_compiler.h:
../Inc/cmsis_gcc.h:
../Inc/mpu_armv7.h:
../Inc/system_stm32g4xx.h:
../Inc/STefi-Light.h:

Binary file not shown.

View File

@ -1,3 +0,0 @@
../Src/task1.c:53:5:main 24 static,ignoring_inline_asm
../Src/task1.c:157:13:GPIO_init 4 static
../Src/task1.c:197:13:delay 24 static,ignoring_inline_asm

View File

@ -1,2 +0,0 @@
../Src/task1_it.c:56:6:ISR_error 1
../Src/task1_it.c:76:6:ISR_default 1

View File

@ -1,11 +0,0 @@
Src/task1_it.o: ../Src/task1_it.c ../Inc/stm32g431xx.h ../Inc/core_cm4.h \
../Inc/cmsis_version.h ../Inc/cmsis_compiler.h ../Inc/cmsis_gcc.h \
../Inc/mpu_armv7.h ../Inc/system_stm32g4xx.h ../Inc/STefi-Light.h
../Inc/stm32g431xx.h:
../Inc/core_cm4.h:
../Inc/cmsis_version.h:
../Inc/cmsis_compiler.h:
../Inc/cmsis_gcc.h:
../Inc/mpu_armv7.h:
../Inc/system_stm32g4xx.h:
../Inc/STefi-Light.h:

Binary file not shown.

View File

@ -1,2 +0,0 @@
../Src/task1_it.c:56:6:ISR_error 4 static
../Src/task1_it.c:76:6:ISR_default 4 static

View File

@ -1 +0,0 @@
Startup/startup_stm32g431kbtx.o: ../Startup/startup_stm32g431kbtx.s

View File

@ -1,18 +0,0 @@
../Startup/syscalls.c:44:6:initialise_monitor_handles 1
../Startup/syscalls.c:48:5:_getpid 1
../Startup/syscalls.c:53:5:_kill 1
../Startup/syscalls.c:61:6:_exit 1
../Startup/syscalls.c:67:27:_read 2
../Startup/syscalls.c:80:27:_write 2
../Startup/syscalls.c:92:5:_close 1
../Startup/syscalls.c:99:5:_fstat 1
../Startup/syscalls.c:106:5:_isatty 1
../Startup/syscalls.c:112:5:_lseek 1
../Startup/syscalls.c:120:5:_open 1
../Startup/syscalls.c:128:5:_wait 1
../Startup/syscalls.c:135:5:_unlink 1
../Startup/syscalls.c:142:5:_times 1
../Startup/syscalls.c:148:5:_stat 1
../Startup/syscalls.c:155:5:_link 1
../Startup/syscalls.c:163:5:_fork 1
../Startup/syscalls.c:169:5:_execve 1

View File

@ -1 +0,0 @@
Startup/syscalls.o: ../Startup/syscalls.c

Binary file not shown.

View File

@ -1,18 +0,0 @@
../Startup/syscalls.c:44:6:initialise_monitor_handles 4 static
../Startup/syscalls.c:48:5:_getpid 4 static
../Startup/syscalls.c:53:5:_kill 16 static
../Startup/syscalls.c:61:6:_exit 16 static
../Startup/syscalls.c:67:27:_read 32 static
../Startup/syscalls.c:80:27:_write 32 static
../Startup/syscalls.c:92:5:_close 16 static
../Startup/syscalls.c:99:5:_fstat 16 static
../Startup/syscalls.c:106:5:_isatty 16 static
../Startup/syscalls.c:112:5:_lseek 24 static
../Startup/syscalls.c:120:5:_open 12 static
../Startup/syscalls.c:128:5:_wait 16 static
../Startup/syscalls.c:135:5:_unlink 16 static
../Startup/syscalls.c:142:5:_times 16 static
../Startup/syscalls.c:148:5:_stat 16 static
../Startup/syscalls.c:155:5:_link 16 static
../Startup/syscalls.c:163:5:_fork 8 static
../Startup/syscalls.c:169:5:_execve 24 static

View File

@ -1 +0,0 @@
../Startup/sysmem.c:53:7:_sbrk 3

View File

@ -1 +0,0 @@
Startup/sysmem.o: ../Startup/sysmem.c

Binary file not shown.

View File

@ -1 +0,0 @@
../Startup/sysmem.c:53:7:_sbrk 32 static

Binary file not shown.

View File

@ -1,764 +0,0 @@
task1.elf: file format elf32-littlearm
Sections:
Idx Name Size VMA LMA File off Algn
0 .isr_vector 000001d8 08000000 08000000 00001000 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
1 .text 000004bc 080001d8 080001d8 000011d8 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
2 .rodata 00000000 08000694 0800069c 0000169c 2**0
CONTENTS, ALLOC, LOAD, DATA
3 .ARM.extab 00000000 08000694 08000694 0000169c 2**0
CONTENTS
4 .ARM 00000000 08000694 08000694 0000169c 2**0
CONTENTS
5 .preinit_array 00000000 08000694 0800069c 0000169c 2**0
CONTENTS, ALLOC, LOAD, DATA
6 .init_array 00000004 08000694 08000694 00001694 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
7 .fini_array 00000004 08000698 08000698 00001698 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
8 .data 00000000 20000000 20000000 0000169c 2**0
CONTENTS, ALLOC, LOAD, DATA
9 .ccmsram 00000000 10000000 10000000 0000169c 2**0
CONTENTS
10 .bss 00000020 20000000 20000000 00002000 2**2
ALLOC
11 ._user_heap_stack 00000600 20000020 20000020 00002000 2**0
ALLOC
12 .ARM.attributes 00000030 00000000 00000000 0000169c 2**0
CONTENTS, READONLY
13 .debug_info 000007eb 00000000 00000000 000016cc 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
14 .debug_abbrev 00000296 00000000 00000000 00001eb7 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
15 .debug_aranges 00000078 00000000 00000000 00002150 2**3
CONTENTS, READONLY, DEBUGGING, OCTETS
16 .debug_rnglists 0000003a 00000000 00000000 000021c8 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
17 .debug_macro 00013740 00000000 00000000 00002202 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
18 .debug_line 00000a3e 00000000 00000000 00015942 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
19 .debug_str 0006f831 00000000 00000000 00016380 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
20 .comment 00000043 00000000 00000000 00085bb1 2**0
CONTENTS, READONLY
21 .debug_frame 000000e4 00000000 00000000 00085bf4 2**2
CONTENTS, READONLY, DEBUGGING, OCTETS
22 .debug_line_str 0000007a 00000000 00000000 00085cd8 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
Disassembly of section .text:
080001d8 <__do_global_dtors_aux>:
80001d8: b510 push {r4, lr}
80001da: 4c05 ldr r4, [pc, #20] @ (80001f0 <__do_global_dtors_aux+0x18>)
80001dc: 7823 ldrb r3, [r4, #0]
80001de: b933 cbnz r3, 80001ee <__do_global_dtors_aux+0x16>
80001e0: 4b04 ldr r3, [pc, #16] @ (80001f4 <__do_global_dtors_aux+0x1c>)
80001e2: b113 cbz r3, 80001ea <__do_global_dtors_aux+0x12>
80001e4: 4804 ldr r0, [pc, #16] @ (80001f8 <__do_global_dtors_aux+0x20>)
80001e6: f3af 8000 nop.w
80001ea: 2301 movs r3, #1
80001ec: 7023 strb r3, [r4, #0]
80001ee: bd10 pop {r4, pc}
80001f0: 20000000 .word 0x20000000
80001f4: 00000000 .word 0x00000000
80001f8: 0800067c .word 0x0800067c
080001fc <frame_dummy>:
80001fc: b508 push {r3, lr}
80001fe: 4b03 ldr r3, [pc, #12] @ (800020c <frame_dummy+0x10>)
8000200: b11b cbz r3, 800020a <frame_dummy+0xe>
8000202: 4903 ldr r1, [pc, #12] @ (8000210 <frame_dummy+0x14>)
8000204: 4803 ldr r0, [pc, #12] @ (8000214 <frame_dummy+0x18>)
8000206: f3af 8000 nop.w
800020a: bd08 pop {r3, pc}
800020c: 00000000 .word 0x00000000
8000210: 20000004 .word 0x20000004
8000214: 0800067c .word 0x0800067c
08000218 <main>:
static void GPIO_init(void);
static void delay(const uint16_t ms);
/* ------------------------------------ M A I N --------------------------------------- */
int main(void)
{
8000218: b580 push {r7, lr}
800021a: b084 sub sp, #16
800021c: af00 add r7, sp, #0
\details Disables IRQ interrupts by setting the I-bit in the CPSR.
Can only be executed in Privileged modes.
*/
__STATIC_FORCEINLINE void __disable_irq(void)
{
__ASM volatile ("cpsid i" : : : "memory");
800021e: b672 cpsid i
}
8000220: bf00 nop
/* --- initialization --- */
__disable_irq(); // disable interrupts globally
GPIO_init();
8000222: f000 f8e9 bl 80003f8 <GPIO_init>
__ASM volatile ("cpsie i" : : : "memory");
8000226: b662 cpsie i
}
8000228: bf00 nop
__enable_irq(); // enable interrupts globally
/* --- one time tasks --- */
//s0 Hilfvariablen auserhalb von while deklarieren
int running = 0; //0 Lauflicht aus, 1 Lauflicht an
800022a: 2300 movs r3, #0
800022c: 60fb str r3, [r7, #12]
int lastButtonState = 1; // Hilfsvariable zur Flankenerkennung
800022e: 2301 movs r3, #1
8000230: 60bb str r3, [r7, #8]
/* --- infinite processing loop --- */
while (1)
{
int buttonState = GPIOB->IDR & (1 << 0);
8000232: 4b6f ldr r3, [pc, #444] @ (80003f0 <main+0x1d8>)
8000234: 691b ldr r3, [r3, #16]
8000236: f003 0301 and.w r3, r3, #1
800023a: 607b str r3, [r7, #4]
// fallende Flanke erkennen
if (lastButtonState && !buttonState)
800023c: 68bb ldr r3, [r7, #8]
800023e: 2b00 cmp r3, #0
8000240: d006 beq.n 8000250 <main+0x38>
8000242: 687b ldr r3, [r7, #4]
8000244: 2b00 cmp r3, #0
8000246: d103 bne.n 8000250 <main+0x38>
{
running ^= 1; // toggle running
8000248: 68fb ldr r3, [r7, #12]
800024a: f083 0301 eor.w r3, r3, #1
800024e: 60fb str r3, [r7, #12]
/* delay(50); // entprellen */
}
lastButtonState = buttonState;
8000250: 687b ldr r3, [r7, #4]
8000252: 60bb str r3, [r7, #8]
if(running)
8000254: 68fb ldr r3, [r7, #12]
8000256: 2b00 cmp r3, #0
8000258: d0eb beq.n 8000232 <main+0x1a>
{
switch (state)
800025a: 4b66 ldr r3, [pc, #408] @ (80003f4 <main+0x1dc>)
800025c: 681b ldr r3, [r3, #0]
800025e: 2b05 cmp r3, #5
8000260: dc12 bgt.n 8000288 <main+0x70>
8000262: 2b00 cmp r3, #0
8000264: dbe5 blt.n 8000232 <main+0x1a>
8000266: 2b05 cmp r3, #5
8000268: d8e3 bhi.n 8000232 <main+0x1a>
800026a: a201 add r2, pc, #4 @ (adr r2, 8000270 <main+0x58>)
800026c: f852 f023 ldr.w pc, [r2, r3, lsl #2]
8000270: 08000291 .word 0x08000291
8000274: 080002c5 .word 0x080002c5
8000278: 080002f9 .word 0x080002f9
800027c: 0800032d .word 0x0800032d
8000280: 08000361 .word 0x08000361
8000284: 08000395 .word 0x08000395
8000288: 2b63 cmp r3, #99 @ 0x63
800028a: f000 809b beq.w 80003c4 <main+0x1ac>
800028e: e0ad b.n 80003ec <main+0x1d4>
{
case 0:
state++;
8000290: 4b58 ldr r3, [pc, #352] @ (80003f4 <main+0x1dc>)
8000292: 681b ldr r3, [r3, #0]
8000294: 3301 adds r3, #1
8000296: 4a57 ldr r2, [pc, #348] @ (80003f4 <main+0x1dc>)
8000298: 6013 str r3, [r2, #0]
GPIOA->ODR &= ~(1 << 0);
800029a: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
800029e: 695b ldr r3, [r3, #20]
80002a0: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
80002a4: f023 0301 bic.w r3, r3, #1
80002a8: 6153 str r3, [r2, #20]
delay(WAITTIME);
80002aa: f240 104d movw r0, #333 @ 0x14d
80002ae: f000 f915 bl 80004dc <delay>
GPIOA->ODR |= (1 << 0);
80002b2: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
80002b6: 695b ldr r3, [r3, #20]
80002b8: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
80002bc: f043 0301 orr.w r3, r3, #1
80002c0: 6153 str r3, [r2, #20]
break;
80002c2: e093 b.n 80003ec <main+0x1d4>
case 1:
state++;
80002c4: 4b4b ldr r3, [pc, #300] @ (80003f4 <main+0x1dc>)
80002c6: 681b ldr r3, [r3, #0]
80002c8: 3301 adds r3, #1
80002ca: 4a4a ldr r2, [pc, #296] @ (80003f4 <main+0x1dc>)
80002cc: 6013 str r3, [r2, #0]
GPIOA->ODR &= ~(1 << 1);
80002ce: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
80002d2: 695b ldr r3, [r3, #20]
80002d4: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
80002d8: f023 0302 bic.w r3, r3, #2
80002dc: 6153 str r3, [r2, #20]
delay(WAITTIME);
80002de: f240 104d movw r0, #333 @ 0x14d
80002e2: f000 f8fb bl 80004dc <delay>
GPIOA->ODR |= (1 << 1);
80002e6: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
80002ea: 695b ldr r3, [r3, #20]
80002ec: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
80002f0: f043 0302 orr.w r3, r3, #2
80002f4: 6153 str r3, [r2, #20]
break;
80002f6: e079 b.n 80003ec <main+0x1d4>
case 2:
state++;
80002f8: 4b3e ldr r3, [pc, #248] @ (80003f4 <main+0x1dc>)
80002fa: 681b ldr r3, [r3, #0]
80002fc: 3301 adds r3, #1
80002fe: 4a3d ldr r2, [pc, #244] @ (80003f4 <main+0x1dc>)
8000300: 6013 str r3, [r2, #0]
GPIOA->ODR &= ~(1 << 2);
8000302: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000306: 695b ldr r3, [r3, #20]
8000308: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
800030c: f023 0304 bic.w r3, r3, #4
8000310: 6153 str r3, [r2, #20]
delay(WAITTIME);
8000312: f240 104d movw r0, #333 @ 0x14d
8000316: f000 f8e1 bl 80004dc <delay>
GPIOA->ODR |= (1 << 2);
800031a: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
800031e: 695b ldr r3, [r3, #20]
8000320: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
8000324: f043 0304 orr.w r3, r3, #4
8000328: 6153 str r3, [r2, #20]
break;
800032a: e05f b.n 80003ec <main+0x1d4>
case 3:
state++;
800032c: 4b31 ldr r3, [pc, #196] @ (80003f4 <main+0x1dc>)
800032e: 681b ldr r3, [r3, #0]
8000330: 3301 adds r3, #1
8000332: 4a30 ldr r2, [pc, #192] @ (80003f4 <main+0x1dc>)
8000334: 6013 str r3, [r2, #0]
GPIOA->ODR &= ~(1 << 3);
8000336: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
800033a: 695b ldr r3, [r3, #20]
800033c: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
8000340: f023 0308 bic.w r3, r3, #8
8000344: 6153 str r3, [r2, #20]
delay(WAITTIME);
8000346: f240 104d movw r0, #333 @ 0x14d
800034a: f000 f8c7 bl 80004dc <delay>
GPIOA->ODR |= (1 << 3);
800034e: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000352: 695b ldr r3, [r3, #20]
8000354: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
8000358: f043 0308 orr.w r3, r3, #8
800035c: 6153 str r3, [r2, #20]
break;
800035e: e045 b.n 80003ec <main+0x1d4>
case 4:
state++;
8000360: 4b24 ldr r3, [pc, #144] @ (80003f4 <main+0x1dc>)
8000362: 681b ldr r3, [r3, #0]
8000364: 3301 adds r3, #1
8000366: 4a23 ldr r2, [pc, #140] @ (80003f4 <main+0x1dc>)
8000368: 6013 str r3, [r2, #0]
GPIOA->ODR &= ~(1 << 2);
800036a: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
800036e: 695b ldr r3, [r3, #20]
8000370: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
8000374: f023 0304 bic.w r3, r3, #4
8000378: 6153 str r3, [r2, #20]
delay(WAITTIME);
800037a: f240 104d movw r0, #333 @ 0x14d
800037e: f000 f8ad bl 80004dc <delay>
GPIOA->ODR |= (1 << 2);
8000382: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000386: 695b ldr r3, [r3, #20]
8000388: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
800038c: f043 0304 orr.w r3, r3, #4
8000390: 6153 str r3, [r2, #20]
break;
8000392: e02b b.n 80003ec <main+0x1d4>
case 5:
state=0;
8000394: 4b17 ldr r3, [pc, #92] @ (80003f4 <main+0x1dc>)
8000396: 2200 movs r2, #0
8000398: 601a str r2, [r3, #0]
GPIOA->ODR &= ~(1 << 1);
800039a: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
800039e: 695b ldr r3, [r3, #20]
80003a0: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
80003a4: f023 0302 bic.w r3, r3, #2
80003a8: 6153 str r3, [r2, #20]
delay(WAITTIME);
80003aa: f240 104d movw r0, #333 @ 0x14d
80003ae: f000 f895 bl 80004dc <delay>
GPIOA->ODR |= (1 << 1);
80003b2: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
80003b6: 695b ldr r3, [r3, #20]
80003b8: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
80003bc: f043 0302 orr.w r3, r3, #2
80003c0: 6153 str r3, [r2, #20]
break;
80003c2: e013 b.n 80003ec <main+0x1d4>
case 99:
GPIOA->ODR |= MASK_LED_ALL;
80003c4: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
80003c8: 695b ldr r3, [r3, #20]
80003ca: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
80003ce: f043 030f orr.w r3, r3, #15
80003d2: 6153 str r3, [r2, #20]
while(1){
if((GPIOB->IDR & (1 << 0)) == 0){
80003d4: 4b06 ldr r3, [pc, #24] @ (80003f0 <main+0x1d8>)
80003d6: 691b ldr r3, [r3, #16]
80003d8: f003 0301 and.w r3, r3, #1
80003dc: 2b00 cmp r3, #0
80003de: d1f9 bne.n 80003d4 <main+0x1bc>
delay(150);
80003e0: 2096 movs r0, #150 @ 0x96
80003e2: f000 f87b bl 80004dc <delay>
state=0;
80003e6: 4b03 ldr r3, [pc, #12] @ (80003f4 <main+0x1dc>)
80003e8: 2200 movs r2, #0
80003ea: 601a str r2, [r3, #0]
{
80003ec: e721 b.n 8000232 <main+0x1a>
80003ee: bf00 nop
80003f0: 48000400 .word 0x48000400
80003f4: 2000001c .word 0x2000001c
080003f8 <GPIO_init>:
* requires: - nothing -
* parameters: - none -
* returns: - nothing -
\* ------------------------------------------------------------------------------------ */
static void GPIO_init(void)
{
80003f8: b480 push {r7}
80003fa: af00 add r7, sp, #0
/* enable port clocks */
RCC->AHB2ENR |= RCC_AHB2ENR_GPIOAEN; // LEDs: A
80003fc: 4b35 ldr r3, [pc, #212] @ (80004d4 <GPIO_init+0xdc>)
80003fe: 6cdb ldr r3, [r3, #76] @ 0x4c
8000400: 4a34 ldr r2, [pc, #208] @ (80004d4 <GPIO_init+0xdc>)
8000402: f043 0301 orr.w r3, r3, #1
8000406: 64d3 str r3, [r2, #76] @ 0x4c
RCC->AHB2ENR |= RCC_AHB2ENR_GPIOBEN; //Taster versuch
8000408: 4b32 ldr r3, [pc, #200] @ (80004d4 <GPIO_init+0xdc>)
800040a: 6cdb ldr r3, [r3, #76] @ 0x4c
800040c: 4a31 ldr r2, [pc, #196] @ (80004d4 <GPIO_init+0xdc>)
800040e: f043 0302 orr.w r3, r3, #2
8000412: 64d3 str r3, [r2, #76] @ 0x4c
/* --- LEDs --- */
GPIOA->ODR |= MASK_LED_ALL;
8000414: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000418: 695b ldr r3, [r3, #20]
800041a: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
800041e: f043 030f orr.w r3, r3, #15
8000422: 6153 str r3, [r2, #20]
GPIOA->MODER &= ~(3 << 0);
8000424: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000428: 681b ldr r3, [r3, #0]
800042a: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
800042e: f023 0303 bic.w r3, r3, #3
8000432: 6013 str r3, [r2, #0]
GPIOA->MODER |= (1 << 0); // set LED pin to output
8000434: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000438: 681b ldr r3, [r3, #0]
800043a: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
800043e: f043 0301 orr.w r3, r3, #1
8000442: 6013 str r3, [r2, #0]
/* LED1 als Output */
GPIOA->MODER &= ~(3 << 2); // Versuch: LED 1 Mode löschen :klappt so
8000444: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000448: 681b ldr r3, [r3, #0]
800044a: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
800044e: f023 030c bic.w r3, r3, #12
8000452: 6013 str r3, [r2, #0]
GPIOA->MODER |= (1 << 2); // Versuch: LED 1 PA1 = output :klappt so
8000454: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000458: 681b ldr r3, [r3, #0]
800045a: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
800045e: f043 0304 orr.w r3, r3, #4
8000462: 6013 str r3, [r2, #0]
/* LED2 als Output */
GPIOA->MODER &= ~(3 << 4); // Versuch: LED 2 Mode löschen :klappt
8000464: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000468: 681b ldr r3, [r3, #0]
800046a: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
800046e: f023 0330 bic.w r3, r3, #48 @ 0x30
8000472: 6013 str r3, [r2, #0]
GPIOA->MODER |= (1 << 4); // Versuch: LED 2 PA1 = output :klappt
8000474: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000478: 681b ldr r3, [r3, #0]
800047a: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
800047e: f043 0310 orr.w r3, r3, #16
8000482: 6013 str r3, [r2, #0]
/* LED3 als output */
GPIOA->MODER &= ~(3 << 6);
8000484: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000488: 681b ldr r3, [r3, #0]
800048a: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
800048e: f023 03c0 bic.w r3, r3, #192 @ 0xc0
8000492: 6013 str r3, [r2, #0]
GPIOA->MODER |= (1 << 6);
8000494: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000498: 681b ldr r3, [r3, #0]
800049a: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
800049e: f043 0340 orr.w r3, r3, #64 @ 0x40
80004a2: 6013 str r3, [r2, #0]
/* s0 (PB0) als Input Versuch */
GPIOB->MODER &= ~(3 << 0);
80004a4: 4b0c ldr r3, [pc, #48] @ (80004d8 <GPIO_init+0xe0>)
80004a6: 681b ldr r3, [r3, #0]
80004a8: 4a0b ldr r2, [pc, #44] @ (80004d8 <GPIO_init+0xe0>)
80004aa: f023 0303 bic.w r3, r3, #3
80004ae: 6013 str r3, [r2, #0]
/* Pull-Up Aktivieren Versuch */
GPIOB->PUPDR &= ~(3 << 0);
80004b0: 4b09 ldr r3, [pc, #36] @ (80004d8 <GPIO_init+0xe0>)
80004b2: 68db ldr r3, [r3, #12]
80004b4: 4a08 ldr r2, [pc, #32] @ (80004d8 <GPIO_init+0xe0>)
80004b6: f023 0303 bic.w r3, r3, #3
80004ba: 60d3 str r3, [r2, #12]
GPIOB->PUPDR |= (1 << 0); // 01 = Pull-Up
80004bc: 4b06 ldr r3, [pc, #24] @ (80004d8 <GPIO_init+0xe0>)
80004be: 68db ldr r3, [r3, #12]
80004c0: 4a05 ldr r2, [pc, #20] @ (80004d8 <GPIO_init+0xe0>)
80004c2: f043 0301 orr.w r3, r3, #1
80004c6: 60d3 str r3, [r2, #12]
}
80004c8: bf00 nop
80004ca: 46bd mov sp, r7
80004cc: f85d 7b04 ldr.w r7, [sp], #4
80004d0: 4770 bx lr
80004d2: bf00 nop
80004d4: 40021000 .word 0x40021000
80004d8: 48000400 .word 0x48000400
080004dc <delay>:
* requires: - nothing -
* parameters: ms - delay time in milliseconds
* returns: - nothing -
\* ------------------------------------------------------------------------------------ */
static void delay(const uint16_t ms)
{
80004dc: b480 push {r7}
80004de: b085 sub sp, #20
80004e0: af00 add r7, sp, #0
80004e2: 4603 mov r3, r0
80004e4: 80fb strh r3, [r7, #6]
for (uint16_t i = 0; i < ms; ++i)
80004e6: 2300 movs r3, #0
80004e8: 81fb strh r3, [r7, #14]
80004ea: e021 b.n 8000530 <delay+0x54>
{
if((GPIOB->IDR & (1 << 0) && state != 99) == 0){
80004ec: 4b16 ldr r3, [pc, #88] @ (8000548 <delay+0x6c>)
80004ee: 691b ldr r3, [r3, #16]
80004f0: f003 0301 and.w r3, r3, #1
80004f4: 2b00 cmp r3, #0
80004f6: d005 beq.n 8000504 <delay+0x28>
80004f8: 4b14 ldr r3, [pc, #80] @ (800054c <delay+0x70>)
80004fa: 681b ldr r3, [r3, #0]
80004fc: 2b63 cmp r3, #99 @ 0x63
80004fe: d001 beq.n 8000504 <delay+0x28>
8000500: 2301 movs r3, #1
8000502: e000 b.n 8000506 <delay+0x2a>
8000504: 2300 movs r3, #0
8000506: 2b00 cmp r3, #0
8000508: d103 bne.n 8000512 <delay+0x36>
state = 99;
800050a: 4b10 ldr r3, [pc, #64] @ (800054c <delay+0x70>)
800050c: 2263 movs r2, #99 @ 0x63
800050e: 601a str r2, [r3, #0]
break;
8000510: e013 b.n 800053a <delay+0x5e>
}
for (uint16_t j = 0; j < LOOPS_PER_MS; ++j)
8000512: 2300 movs r3, #0
8000514: 81bb strh r3, [r7, #12]
8000516: e003 b.n 8000520 <delay+0x44>
{
__asm("NOP");
8000518: bf00 nop
for (uint16_t j = 0; j < LOOPS_PER_MS; ++j)
800051a: 89bb ldrh r3, [r7, #12]
800051c: 3301 adds r3, #1
800051e: 81bb strh r3, [r7, #12]
8000520: 89bb ldrh r3, [r7, #12]
8000522: f240 42db movw r2, #1243 @ 0x4db
8000526: 4293 cmp r3, r2
8000528: d9f6 bls.n 8000518 <delay+0x3c>
for (uint16_t i = 0; i < ms; ++i)
800052a: 89fb ldrh r3, [r7, #14]
800052c: 3301 adds r3, #1
800052e: 81fb strh r3, [r7, #14]
8000530: 89fa ldrh r2, [r7, #14]
8000532: 88fb ldrh r3, [r7, #6]
8000534: 429a cmp r2, r3
8000536: d3d9 bcc.n 80004ec <delay+0x10>
}
}
}
8000538: bf00 nop
800053a: bf00 nop
800053c: 3714 adds r7, #20
800053e: 46bd mov sp, r7
8000540: f85d 7b04 ldr.w r7, [sp], #4
8000544: 4770 bx lr
8000546: bf00 nop
8000548: 48000400 .word 0x48000400
800054c: 2000001c .word 0x2000001c
08000550 <ISR_error>:
*
* Default interrupt handler for core interrupts.
* Enables the green and red LED on the STefi Light board.
\* ------------------------------------------------------------------------------------ */
void ISR_error(void)
{
8000550: b480 push {r7}
8000552: af00 add r7, sp, #0
/* init */
RCC->AHB2ENR |= RCC_AHB2ENR_GPIOAEN; // PA: clock on (LEDs)
8000554: 4b10 ldr r3, [pc, #64] @ (8000598 <ISR_error+0x48>)
8000556: 6cdb ldr r3, [r3, #76] @ 0x4c
8000558: 4a0f ldr r2, [pc, #60] @ (8000598 <ISR_error+0x48>)
800055a: f043 0301 orr.w r3, r3, #1
800055e: 64d3 str r3, [r2, #76] @ 0x4c
GPIOA->ODR |= MASK_LED_ALL;
8000560: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000564: 695b ldr r3, [r3, #20]
8000566: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
800056a: f043 030f orr.w r3, r3, #15
800056e: 6153 str r3, [r2, #20]
GPIOA->MODER = (GPIOA->MODER & 0xFFFFFF00) | 0x11;
8000570: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000574: 681b ldr r3, [r3, #0]
8000576: f023 03ff bic.w r3, r3, #255 @ 0xff
800057a: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
800057e: f043 0311 orr.w r3, r3, #17
8000582: 6013 str r3, [r2, #0]
while(1)
{ /* light up the LEDs permanently */
GPIOA->ODR &= ~(MASK_LED_GREEN | MASK_LED_RED);
8000584: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
8000588: 695b ldr r3, [r3, #20]
800058a: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
800058e: f023 0305 bic.w r3, r3, #5
8000592: 6153 str r3, [r2, #20]
8000594: e7f6 b.n 8000584 <ISR_error+0x34>
8000596: bf00 nop
8000598: 40021000 .word 0x40021000
0800059c <ISR_default>:
*
* Default interrupt handler for non-core interrupts.
* Enables the blue and yellow LED on the STefi Light board.
\* ------------------------------------------------------------------------------------ */
void ISR_default(void)
{
800059c: b480 push {r7}
800059e: af00 add r7, sp, #0
/* init */
RCC->AHB2ENR |= RCC_AHB2ENR_GPIOAEN; // PA: clock on (LEDs)
80005a0: 4b10 ldr r3, [pc, #64] @ (80005e4 <ISR_default+0x48>)
80005a2: 6cdb ldr r3, [r3, #76] @ 0x4c
80005a4: 4a0f ldr r2, [pc, #60] @ (80005e4 <ISR_default+0x48>)
80005a6: f043 0301 orr.w r3, r3, #1
80005aa: 64d3 str r3, [r2, #76] @ 0x4c
GPIOA->ODR |= MASK_LED_ALL;
80005ac: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
80005b0: 695b ldr r3, [r3, #20]
80005b2: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
80005b6: f043 030f orr.w r3, r3, #15
80005ba: 6153 str r3, [r2, #20]
GPIOA->MODER = (GPIOA->MODER & 0xFFFFFF00) | 0x44;
80005bc: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
80005c0: 681b ldr r3, [r3, #0]
80005c2: f023 03ff bic.w r3, r3, #255 @ 0xff
80005c6: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
80005ca: f043 0344 orr.w r3, r3, #68 @ 0x44
80005ce: 6013 str r3, [r2, #0]
while(1)
{ /* light up the LEDs permanently */
GPIOA->ODR &= ~(MASK_LED_BLUE | MASK_LED_YELLOW);
80005d0: f04f 4390 mov.w r3, #1207959552 @ 0x48000000
80005d4: 695b ldr r3, [r3, #20]
80005d6: f04f 4290 mov.w r2, #1207959552 @ 0x48000000
80005da: f023 030a bic.w r3, r3, #10
80005de: 6153 str r3, [r2, #20]
80005e0: e7f6 b.n 80005d0 <ISR_default+0x34>
80005e2: bf00 nop
80005e4: 40021000 .word 0x40021000
080005e8 <Reset_Handler>:
.section .text.Reset_Handler
.weak Reset_Handler
.type Reset_Handler, %function
Reset_Handler:
ldr r0, =_estack
80005e8: 480c ldr r0, [pc, #48] @ (800061c <LoopForever+0x2>)
mov sp, r0 /* set stack pointer */
80005ea: 4685 mov sp, r0
/* Call the clock system initialization function.*/
// bl SystemInit
/* Copy the data segment initializers from flash to SRAM */
ldr r0, =_sdata
80005ec: 480c ldr r0, [pc, #48] @ (8000620 <LoopForever+0x6>)
ldr r1, =_edata
80005ee: 490d ldr r1, [pc, #52] @ (8000624 <LoopForever+0xa>)
ldr r2, =_sidata
80005f0: 4a0d ldr r2, [pc, #52] @ (8000628 <LoopForever+0xe>)
movs r3, #0
80005f2: 2300 movs r3, #0
b LoopCopyDataInit
80005f4: e002 b.n 80005fc <LoopCopyDataInit>
080005f6 <CopyDataInit>:
CopyDataInit:
ldr r4, [r2, r3]
80005f6: 58d4 ldr r4, [r2, r3]
str r4, [r0, r3]
80005f8: 50c4 str r4, [r0, r3]
adds r3, r3, #4
80005fa: 3304 adds r3, #4
080005fc <LoopCopyDataInit>:
LoopCopyDataInit:
adds r4, r0, r3
80005fc: 18c4 adds r4, r0, r3
cmp r4, r1
80005fe: 428c cmp r4, r1
bcc CopyDataInit
8000600: d3f9 bcc.n 80005f6 <CopyDataInit>
/* Zero fill the bss segment. */
ldr r2, =_sbss
8000602: 4a0a ldr r2, [pc, #40] @ (800062c <LoopForever+0x12>)
ldr r4, =_ebss
8000604: 4c0a ldr r4, [pc, #40] @ (8000630 <LoopForever+0x16>)
movs r3, #0
8000606: 2300 movs r3, #0
b LoopFillZerobss
8000608: e001 b.n 800060e <LoopFillZerobss>
0800060a <FillZerobss>:
FillZerobss:
str r3, [r2]
800060a: 6013 str r3, [r2, #0]
adds r2, r2, #4
800060c: 3204 adds r2, #4
0800060e <LoopFillZerobss>:
LoopFillZerobss:
cmp r2, r4
800060e: 42a2 cmp r2, r4
bcc FillZerobss
8000610: d3fb bcc.n 800060a <FillZerobss>
/* Call static constructors */
bl __libc_init_array
8000612: f000 f80f bl 8000634 <__libc_init_array>
/* Call the application's entry point.*/
bl main
8000616: f7ff fdff bl 8000218 <main>
0800061a <LoopForever>:
LoopForever:
b LoopForever
800061a: e7fe b.n 800061a <LoopForever>
ldr r0, =_estack
800061c: 20008000 .word 0x20008000
ldr r0, =_sdata
8000620: 20000000 .word 0x20000000
ldr r1, =_edata
8000624: 20000000 .word 0x20000000
ldr r2, =_sidata
8000628: 0800069c .word 0x0800069c
ldr r2, =_sbss
800062c: 20000000 .word 0x20000000
ldr r4, =_ebss
8000630: 20000020 .word 0x20000020
08000634 <__libc_init_array>:
8000634: b570 push {r4, r5, r6, lr}
8000636: 4d0d ldr r5, [pc, #52] @ (800066c <__libc_init_array+0x38>)
8000638: 4c0d ldr r4, [pc, #52] @ (8000670 <__libc_init_array+0x3c>)
800063a: 1b64 subs r4, r4, r5
800063c: 10a4 asrs r4, r4, #2
800063e: 2600 movs r6, #0
8000640: 42a6 cmp r6, r4
8000642: d109 bne.n 8000658 <__libc_init_array+0x24>
8000644: 4d0b ldr r5, [pc, #44] @ (8000674 <__libc_init_array+0x40>)
8000646: 4c0c ldr r4, [pc, #48] @ (8000678 <__libc_init_array+0x44>)
8000648: f000 f818 bl 800067c <_init>
800064c: 1b64 subs r4, r4, r5
800064e: 10a4 asrs r4, r4, #2
8000650: 2600 movs r6, #0
8000652: 42a6 cmp r6, r4
8000654: d105 bne.n 8000662 <__libc_init_array+0x2e>
8000656: bd70 pop {r4, r5, r6, pc}
8000658: f855 3b04 ldr.w r3, [r5], #4
800065c: 4798 blx r3
800065e: 3601 adds r6, #1
8000660: e7ee b.n 8000640 <__libc_init_array+0xc>
8000662: f855 3b04 ldr.w r3, [r5], #4
8000666: 4798 blx r3
8000668: 3601 adds r6, #1
800066a: e7f2 b.n 8000652 <__libc_init_array+0x1e>
800066c: 08000694 .word 0x08000694
8000670: 08000694 .word 0x08000694
8000674: 08000694 .word 0x08000694
8000678: 08000698 .word 0x08000698
0800067c <_init>:
800067c: b5f8 push {r3, r4, r5, r6, r7, lr}
800067e: bf00 nop
8000680: bcf8 pop {r3, r4, r5, r6, r7}
8000682: bc08 pop {r3}
8000684: 469e mov lr, r3
8000686: 4770 bx lr
08000688 <_fini>:
8000688: b5f8 push {r3, r4, r5, r6, r7, lr}
800068a: bf00 nop
800068c: bcf8 pop {r3, r4, r5, r6, r7}
800068e: bc08 pop {r3}
8000690: 469e mov lr, r3
8000692: 4770 bx lr

View File

@ -1,825 +0,0 @@
Archive member included to satisfy reference by file (symbol)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-exit.o)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/crt0.o (exit)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-findfp.o)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-exit.o) (__stdio_exit_handler)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-fwalk.o)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-findfp.o) (_fwalk_sglue)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-stdio.o)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-findfp.o) (__sread)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-memset.o)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/crt0.o (memset)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-closer.o)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-stdio.o) (_close_r)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-reent.o)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-closer.o) (errno)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-impure.o)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-reent.o) (_impure_ptr)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lseekr.o)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-stdio.o) (_lseek_r)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-readr.o)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-stdio.o) (_read_r)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-writer.o)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-stdio.o) (_write_r)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-errno.o)
./Startup/syscalls.o (__errno)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-init.o)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/crt0.o (__libc_init_array)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lock.o)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-findfp.o) (__retarget_lock_init_recursive)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-freer.o)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-reent.o) (_free_r)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-mallocr.o)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-findfp.o) (_malloc_r)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-mlock.o)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-freer.o) (__malloc_lock)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-fflush.o)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-findfp.o) (_fflush_r)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-sbrkr.o)
/opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-mallocr.o) (_sbrk_r)
Discarded input sections
.text 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crti.o
.data 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crti.o
.bss 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crti.o
.data 0x00000000 0x4 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crtbegin.o
.rodata 0x00000000 0x24 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crtbegin.o
.text 0x00000000 0x7c /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/crt0.o
.data 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/crt0.o
.bss 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/crt0.o
.ARM.extab 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/crt0.o
.ARM.exidx 0x00000000 0x10 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/crt0.o
.ARM.attributes
0x00000000 0x20 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/crt0.o
.group 0x00000000 0xc ./Src/task1.o
.group 0x00000000 0xc ./Src/task1.o
.group 0x00000000 0xc ./Src/task1.o
.group 0x00000000 0xc ./Src/task1.o
.group 0x00000000 0xc ./Src/task1.o
.group 0x00000000 0xc ./Src/task1.o
.group 0x00000000 0xc ./Src/task1.o
.group 0x00000000 0xc ./Src/task1.o
.group 0x00000000 0xc ./Src/task1.o
.group 0x00000000 0xc ./Src/task1.o
.group 0x00000000 0xc ./Src/task1.o
.group 0x00000000 0xc ./Src/task1.o
.group 0x00000000 0xc ./Src/task1.o
.group 0x00000000 0xc ./Src/task1.o
.group 0x00000000 0xc ./Src/task1.o
.text 0x00000000 0x0 ./Src/task1.o
.data 0x00000000 0x0 ./Src/task1.o
.bss 0x00000000 0x0 ./Src/task1.o
.group 0x00000000 0xc ./Src/task1_it.o
.group 0x00000000 0xc ./Src/task1_it.o
.group 0x00000000 0xc ./Src/task1_it.o
.group 0x00000000 0xc ./Src/task1_it.o
.group 0x00000000 0xc ./Src/task1_it.o
.group 0x00000000 0xc ./Src/task1_it.o
.group 0x00000000 0xc ./Src/task1_it.o
.group 0x00000000 0xc ./Src/task1_it.o
.group 0x00000000 0xc ./Src/task1_it.o
.group 0x00000000 0xc ./Src/task1_it.o
.group 0x00000000 0xc ./Src/task1_it.o
.group 0x00000000 0xc ./Src/task1_it.o
.group 0x00000000 0xc ./Src/task1_it.o
.group 0x00000000 0xc ./Src/task1_it.o
.group 0x00000000 0xc ./Src/task1_it.o
.text 0x00000000 0x0 ./Src/task1_it.o
.data 0x00000000 0x0 ./Src/task1_it.o
.bss 0x00000000 0x0 ./Src/task1_it.o
.debug_macro 0x00000000 0xac0 ./Src/task1_it.o
.debug_macro 0x00000000 0x28 ./Src/task1_it.o
.debug_macro 0x00000000 0x22 ./Src/task1_it.o
.debug_macro 0x00000000 0x8e ./Src/task1_it.o
.debug_macro 0x00000000 0x51 ./Src/task1_it.o
.debug_macro 0x00000000 0x103 ./Src/task1_it.o
.debug_macro 0x00000000 0x6a ./Src/task1_it.o
.debug_macro 0x00000000 0x1df ./Src/task1_it.o
.debug_macro 0x00000000 0x1c ./Src/task1_it.o
.debug_macro 0x00000000 0x22 ./Src/task1_it.o
.debug_macro 0x00000000 0xfb ./Src/task1_it.o
.debug_macro 0x00000000 0x1011 ./Src/task1_it.o
.debug_macro 0x00000000 0x11f ./Src/task1_it.o
.debug_macro 0x00000000 0x11396 ./Src/task1_it.o
.debug_macro 0x00000000 0x70 ./Src/task1_it.o
.text 0x00000000 0x14 ./Startup/startup_stm32g431kbtx.o
.data 0x00000000 0x0 ./Startup/startup_stm32g431kbtx.o
.bss 0x00000000 0x0 ./Startup/startup_stm32g431kbtx.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/syscalls.o
.text 0x00000000 0x0 ./Startup/syscalls.o
.data 0x00000000 0x0 ./Startup/syscalls.o
.bss 0x00000000 0x0 ./Startup/syscalls.o
.bss.__env 0x00000000 0x4 ./Startup/syscalls.o
.data.environ 0x00000000 0x4 ./Startup/syscalls.o
.text.initialise_monitor_handles
0x00000000 0xe ./Startup/syscalls.o
.text._getpid 0x00000000 0x10 ./Startup/syscalls.o
.text._kill 0x00000000 0x20 ./Startup/syscalls.o
.text._exit 0x00000000 0x16 ./Startup/syscalls.o
.text._read 0x00000000 0x3a ./Startup/syscalls.o
.text._write 0x00000000 0x38 ./Startup/syscalls.o
.text._close 0x00000000 0x18 ./Startup/syscalls.o
.text._fstat 0x00000000 0x20 ./Startup/syscalls.o
.text._isatty 0x00000000 0x16 ./Startup/syscalls.o
.text._lseek 0x00000000 0x1a ./Startup/syscalls.o
.text._open 0x00000000 0x1c ./Startup/syscalls.o
.text._wait 0x00000000 0x1e ./Startup/syscalls.o
.text._unlink 0x00000000 0x1e ./Startup/syscalls.o
.text._times 0x00000000 0x18 ./Startup/syscalls.o
.text._stat 0x00000000 0x20 ./Startup/syscalls.o
.text._link 0x00000000 0x20 ./Startup/syscalls.o
.text._fork 0x00000000 0x16 ./Startup/syscalls.o
.text._execve 0x00000000 0x22 ./Startup/syscalls.o
.debug_info 0x00000000 0x6a3 ./Startup/syscalls.o
.debug_abbrev 0x00000000 0x1b6 ./Startup/syscalls.o
.debug_aranges
0x00000000 0xa8 ./Startup/syscalls.o
.debug_rnglists
0x00000000 0x79 ./Startup/syscalls.o
.debug_macro 0x00000000 0x274 ./Startup/syscalls.o
.debug_macro 0x00000000 0xac0 ./Startup/syscalls.o
.debug_macro 0x00000000 0x22 ./Startup/syscalls.o
.debug_macro 0x00000000 0x5b ./Startup/syscalls.o
.debug_macro 0x00000000 0x2a ./Startup/syscalls.o
.debug_macro 0x00000000 0x94 ./Startup/syscalls.o
.debug_macro 0x00000000 0x43 ./Startup/syscalls.o
.debug_macro 0x00000000 0x34 ./Startup/syscalls.o
.debug_macro 0x00000000 0x57 ./Startup/syscalls.o
.debug_macro 0x00000000 0x189 ./Startup/syscalls.o
.debug_macro 0x00000000 0x369 ./Startup/syscalls.o
.debug_macro 0x00000000 0x16 ./Startup/syscalls.o
.debug_macro 0x00000000 0x43 ./Startup/syscalls.o
.debug_macro 0x00000000 0x34 ./Startup/syscalls.o
.debug_macro 0x00000000 0x10 ./Startup/syscalls.o
.debug_macro 0x00000000 0x58 ./Startup/syscalls.o
.debug_macro 0x00000000 0x8e ./Startup/syscalls.o
.debug_macro 0x00000000 0x1c ./Startup/syscalls.o
.debug_macro 0x00000000 0x177 ./Startup/syscalls.o
.debug_macro 0x00000000 0x10 ./Startup/syscalls.o
.debug_macro 0x00000000 0x35 ./Startup/syscalls.o
.debug_macro 0x00000000 0x10 ./Startup/syscalls.o
.debug_macro 0x00000000 0x10 ./Startup/syscalls.o
.debug_macro 0x00000000 0x10 ./Startup/syscalls.o
.debug_macro 0x00000000 0x6a ./Startup/syscalls.o
.debug_macro 0x00000000 0x1c ./Startup/syscalls.o
.debug_macro 0x00000000 0x52 ./Startup/syscalls.o
.debug_macro 0x00000000 0x22 ./Startup/syscalls.o
.debug_macro 0x00000000 0x10 ./Startup/syscalls.o
.debug_macro 0x00000000 0x52 ./Startup/syscalls.o
.debug_macro 0x00000000 0xcf ./Startup/syscalls.o
.debug_macro 0x00000000 0x1c ./Startup/syscalls.o
.debug_macro 0x00000000 0x3d ./Startup/syscalls.o
.debug_macro 0x00000000 0x35 ./Startup/syscalls.o
.debug_macro 0x00000000 0x12c ./Startup/syscalls.o
.debug_macro 0x00000000 0x16 ./Startup/syscalls.o
.debug_macro 0x00000000 0x16 ./Startup/syscalls.o
.debug_macro 0x00000000 0x29 ./Startup/syscalls.o
.debug_macro 0x00000000 0x10 ./Startup/syscalls.o
.debug_macro 0x00000000 0x242 ./Startup/syscalls.o
.debug_macro 0x00000000 0x1c ./Startup/syscalls.o
.debug_macro 0x00000000 0x10 ./Startup/syscalls.o
.debug_macro 0x00000000 0x10 ./Startup/syscalls.o
.debug_macro 0x00000000 0x16 ./Startup/syscalls.o
.debug_macro 0x00000000 0x146 ./Startup/syscalls.o
.debug_macro 0x00000000 0x103 ./Startup/syscalls.o
.debug_macro 0x00000000 0x1df ./Startup/syscalls.o
.debug_macro 0x00000000 0x18a ./Startup/syscalls.o
.debug_macro 0x00000000 0x16 ./Startup/syscalls.o
.debug_macro 0x00000000 0xce ./Startup/syscalls.o
.debug_line 0x00000000 0x7e6 ./Startup/syscalls.o
.debug_str 0x00000000 0x98e2 ./Startup/syscalls.o
.comment 0x00000000 0x44 ./Startup/syscalls.o
.debug_frame 0x00000000 0x2ac ./Startup/syscalls.o
.ARM.attributes
0x00000000 0x34 ./Startup/syscalls.o
.group 0x00000000 0xc ./Startup/sysmem.o
.group 0x00000000 0xc ./Startup/sysmem.o
.group 0x00000000 0xc ./Startup/sysmem.o
.group 0x00000000 0xc ./Startup/sysmem.o
.group 0x00000000 0xc ./Startup/sysmem.o
.group 0x00000000 0xc ./Startup/sysmem.o
.group 0x00000000 0xc ./Startup/sysmem.o
.group 0x00000000 0xc ./Startup/sysmem.o
.group 0x00000000 0xc ./Startup/sysmem.o
.group 0x00000000 0xc ./Startup/sysmem.o
.group 0x00000000 0xc ./Startup/sysmem.o
.group 0x00000000 0xc ./Startup/sysmem.o
.group 0x00000000 0xc ./Startup/sysmem.o
.group 0x00000000 0xc ./Startup/sysmem.o
.group 0x00000000 0xc ./Startup/sysmem.o
.group 0x00000000 0xc ./Startup/sysmem.o
.group 0x00000000 0xc ./Startup/sysmem.o
.group 0x00000000 0xc ./Startup/sysmem.o
.group 0x00000000 0xc ./Startup/sysmem.o
.group 0x00000000 0xc ./Startup/sysmem.o
.group 0x00000000 0xc ./Startup/sysmem.o
.group 0x00000000 0xc ./Startup/sysmem.o
.text 0x00000000 0x0 ./Startup/sysmem.o
.data 0x00000000 0x0 ./Startup/sysmem.o
.bss 0x00000000 0x0 ./Startup/sysmem.o
.bss.__sbrk_heap_end
0x00000000 0x4 ./Startup/sysmem.o
.text._sbrk 0x00000000 0x6c ./Startup/sysmem.o
.debug_info 0x00000000 0x168 ./Startup/sysmem.o
.debug_abbrev 0x00000000 0xbc ./Startup/sysmem.o
.debug_aranges
0x00000000 0x20 ./Startup/sysmem.o
.debug_rnglists
0x00000000 0x13 ./Startup/sysmem.o
.debug_macro 0x00000000 0xff ./Startup/sysmem.o
.debug_macro 0x00000000 0xac0 ./Startup/sysmem.o
.debug_macro 0x00000000 0x10 ./Startup/sysmem.o
.debug_macro 0x00000000 0x22 ./Startup/sysmem.o
.debug_macro 0x00000000 0x5b ./Startup/sysmem.o
.debug_macro 0x00000000 0x2a ./Startup/sysmem.o
.debug_macro 0x00000000 0x94 ./Startup/sysmem.o
.debug_macro 0x00000000 0x43 ./Startup/sysmem.o
.debug_macro 0x00000000 0x34 ./Startup/sysmem.o
.debug_macro 0x00000000 0x189 ./Startup/sysmem.o
.debug_macro 0x00000000 0x16 ./Startup/sysmem.o
.debug_macro 0x00000000 0x43 ./Startup/sysmem.o
.debug_macro 0x00000000 0x57 ./Startup/sysmem.o
.debug_macro 0x00000000 0x34 ./Startup/sysmem.o
.debug_macro 0x00000000 0x10 ./Startup/sysmem.o
.debug_macro 0x00000000 0x58 ./Startup/sysmem.o
.debug_macro 0x00000000 0x8e ./Startup/sysmem.o
.debug_macro 0x00000000 0x1c ./Startup/sysmem.o
.debug_macro 0x00000000 0x177 ./Startup/sysmem.o
.debug_macro 0x00000000 0x23c ./Startup/sysmem.o
.debug_macro 0x00000000 0x103 ./Startup/sysmem.o
.debug_macro 0x00000000 0x6a ./Startup/sysmem.o
.debug_macro 0x00000000 0x1df ./Startup/sysmem.o
.debug_line 0x00000000 0x4b7 ./Startup/sysmem.o
.debug_str 0x00000000 0x60fa ./Startup/sysmem.o
.comment 0x00000000 0x44 ./Startup/sysmem.o
.debug_frame 0x00000000 0x34 ./Startup/sysmem.o
.ARM.attributes
0x00000000 0x34 ./Startup/sysmem.o
.text 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-exit.o)
.data 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-exit.o)
.bss 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-exit.o)
.text.exit 0x00000000 0x24 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-exit.o)
.debug_frame 0x00000000 0x28 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-exit.o)
.ARM.attributes
0x00000000 0x34 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-exit.o)
.text 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-findfp.o)
.data 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-findfp.o)
.bss 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-findfp.o)
.text.std 0x00000000 0x6c /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-findfp.o)
.text.stdio_exit_handler
0x00000000 0x18 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-findfp.o)
.text.cleanup_stdio
0x00000000 0x40 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-findfp.o)
.text.__fp_lock
0x00000000 0x18 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-findfp.o)
.text.__fp_unlock
0x00000000 0x18 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-findfp.o)
.text.global_stdio_init.part.0
0x00000000 0x3c /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-findfp.o)
.text.__sfp_lock_acquire
0x00000000 0xc /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-findfp.o)
.text.__sfp_lock_release
0x00000000 0xc /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-findfp.o)
.text.__sfp 0x00000000 0xa4 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-findfp.o)
.text.__sinit 0x00000000 0x30 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-findfp.o)
.text.__fp_lock_all
0x00000000 0x1c /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-findfp.o)
.text.__fp_unlock_all
0x00000000 0x1c /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-findfp.o)
.data.__sglue 0x00000000 0xc /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-findfp.o)
.bss.__sf 0x00000000 0x138 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-findfp.o)
.bss.__stdio_exit_handler
0x00000000 0x4 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-findfp.o)
.debug_frame 0x00000000 0x144 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-findfp.o)
.ARM.attributes
0x00000000 0x34 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-findfp.o)
.text 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-fwalk.o)
.data 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-fwalk.o)
.bss 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-fwalk.o)
.text._fwalk_sglue
0x00000000 0x3c /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-fwalk.o)
.debug_frame 0x00000000 0x34 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-fwalk.o)
.ARM.attributes
0x00000000 0x34 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-fwalk.o)
.text 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-stdio.o)
.data 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-stdio.o)
.bss 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-stdio.o)
.text.__sread 0x00000000 0x22 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-stdio.o)
.text.__seofread
0x00000000 0x4 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-stdio.o)
.text.__swrite
0x00000000 0x38 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-stdio.o)
.text.__sseek 0x00000000 0x24 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-stdio.o)
.text.__sclose
0x00000000 0x8 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-stdio.o)
.debug_frame 0x00000000 0x88 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-stdio.o)
.ARM.attributes
0x00000000 0x34 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-stdio.o)
.text 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-memset.o)
.data 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-memset.o)
.bss 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-memset.o)
.text.memset 0x00000000 0x10 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-memset.o)
.debug_frame 0x00000000 0x20 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-memset.o)
.ARM.attributes
0x00000000 0x34 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-memset.o)
.text 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-closer.o)
.data 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-closer.o)
.bss 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-closer.o)
.text._close_r
0x00000000 0x20 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-closer.o)
.debug_frame 0x00000000 0x2c /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-closer.o)
.ARM.attributes
0x00000000 0x34 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-closer.o)
.text 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-reent.o)
.data 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-reent.o)
.bss 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-reent.o)
.text._reclaim_reent
0x00000000 0xac /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-reent.o)
.bss.errno 0x00000000 0x4 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-reent.o)
.debug_frame 0x00000000 0x38 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-reent.o)
.ARM.attributes
0x00000000 0x34 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-reent.o)
.text 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-impure.o)
.data 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-impure.o)
.bss 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-impure.o)
.data._impure_ptr
0x00000000 0x4 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-impure.o)
.data._impure_data
0x00000000 0x4c /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-impure.o)
.ARM.attributes
0x00000000 0x34 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-impure.o)
.text 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lseekr.o)
.data 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lseekr.o)
.bss 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lseekr.o)
.text._lseek_r
0x00000000 0x24 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lseekr.o)
.debug_frame 0x00000000 0x2c /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lseekr.o)
.ARM.attributes
0x00000000 0x34 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lseekr.o)
.text 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-readr.o)
.data 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-readr.o)
.bss 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-readr.o)
.text._read_r 0x00000000 0x24 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-readr.o)
.debug_frame 0x00000000 0x2c /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-readr.o)
.ARM.attributes
0x00000000 0x34 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-readr.o)
.text 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-writer.o)
.data 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-writer.o)
.bss 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-writer.o)
.text._write_r
0x00000000 0x24 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-writer.o)
.debug_frame 0x00000000 0x2c /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-writer.o)
.ARM.attributes
0x00000000 0x34 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-writer.o)
.text 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-errno.o)
.data 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-errno.o)
.bss 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-errno.o)
.text.__errno 0x00000000 0xc /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-errno.o)
.debug_frame 0x00000000 0x20 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-errno.o)
.ARM.attributes
0x00000000 0x34 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-errno.o)
.text 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-init.o)
.data 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-init.o)
.bss 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-init.o)
.text 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lock.o)
.data 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lock.o)
.bss 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lock.o)
.text.__retarget_lock_init
0x00000000 0x2 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lock.o)
.text.__retarget_lock_init_recursive
0x00000000 0x2 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lock.o)
.text.__retarget_lock_close
0x00000000 0x2 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lock.o)
.text.__retarget_lock_close_recursive
0x00000000 0x2 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lock.o)
.text.__retarget_lock_acquire
0x00000000 0x2 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lock.o)
.text.__retarget_lock_acquire_recursive
0x00000000 0x2 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lock.o)
.text.__retarget_lock_try_acquire
0x00000000 0x4 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lock.o)
.text.__retarget_lock_try_acquire_recursive
0x00000000 0x4 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lock.o)
.text.__retarget_lock_release
0x00000000 0x2 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lock.o)
.text.__retarget_lock_release_recursive
0x00000000 0x2 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lock.o)
.bss.__lock___arc4random_mutex
0x00000000 0x1 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lock.o)
.bss.__lock___dd_hash_mutex
0x00000000 0x1 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lock.o)
.bss.__lock___tz_mutex
0x00000000 0x1 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lock.o)
.bss.__lock___env_recursive_mutex
0x00000000 0x1 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lock.o)
.bss.__lock___malloc_recursive_mutex
0x00000000 0x1 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lock.o)
.bss.__lock___at_quick_exit_mutex
0x00000000 0x1 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lock.o)
.bss.__lock___atexit_recursive_mutex
0x00000000 0x1 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lock.o)
.bss.__lock___sfp_recursive_mutex
0x00000000 0x1 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lock.o)
.debug_frame 0x00000000 0xb0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lock.o)
.ARM.attributes
0x00000000 0x34 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-lock.o)
.text 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-freer.o)
.data 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-freer.o)
.bss 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-freer.o)
.text._free_r 0x00000000 0x94 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-freer.o)
.debug_frame 0x00000000 0x38 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-freer.o)
.ARM.attributes
0x00000000 0x34 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-freer.o)
.text 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-mallocr.o)
.data 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-mallocr.o)
.bss 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-mallocr.o)
.text.sbrk_aligned
0x00000000 0x44 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-mallocr.o)
.text._malloc_r
0x00000000 0x100 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-mallocr.o)
.bss.__malloc_sbrk_start
0x00000000 0x4 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-mallocr.o)
.bss.__malloc_free_list
0x00000000 0x4 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-mallocr.o)
.debug_frame 0x00000000 0x50 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-mallocr.o)
.ARM.attributes
0x00000000 0x34 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-mallocr.o)
.text 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-mlock.o)
.data 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-mlock.o)
.bss 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-mlock.o)
.text.__malloc_lock
0x00000000 0xc /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-mlock.o)
.text.__malloc_unlock
0x00000000 0xc /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-mlock.o)
.debug_frame 0x00000000 0x30 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-mlock.o)
.ARM.attributes
0x00000000 0x34 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-mlock.o)
.text 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-fflush.o)
.data 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-fflush.o)
.bss 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-fflush.o)
.text.__sflush_r
0x00000000 0x108 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-fflush.o)
.text._fflush_r
0x00000000 0x50 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-fflush.o)
.text.fflush 0x00000000 0x28 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-fflush.o)
.debug_frame 0x00000000 0x5c /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-fflush.o)
.ARM.attributes
0x00000000 0x34 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-fflush.o)
.text 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-sbrkr.o)
.data 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-sbrkr.o)
.bss 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-sbrkr.o)
.text._sbrk_r 0x00000000 0x20 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-sbrkr.o)
.debug_frame 0x00000000 0x2c /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-sbrkr.o)
.ARM.attributes
0x00000000 0x34 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-sbrkr.o)
.text 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crtend.o
.data 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crtend.o
.bss 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crtend.o
.rodata 0x00000000 0x24 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crtend.o
.eh_frame 0x00000000 0x4 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crtend.o
.ARM.attributes
0x00000000 0x34 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crtend.o
.text 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crtn.o
.data 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crtn.o
.bss 0x00000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crtn.o
Memory Configuration
Name Origin Length Attributes
CCMSRAM 0x10000000 0x00002800 xrw
RAM 0x20000000 0x00008000 xrw
FLASH 0x08000000 0x00020000 xr
*default* 0x00000000 0xffffffff
Linker script and memory map
LOAD /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crti.o
LOAD /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crtbegin.o
LOAD /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/crt0.o
LOAD ./Src/task1.o
LOAD ./Src/task1_it.o
LOAD ./Startup/startup_stm32g431kbtx.o
LOAD ./Startup/syscalls.o
LOAD ./Startup/sysmem.o
START GROUP
LOAD /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a
LOAD /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libm.a
END GROUP
START GROUP
LOAD /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/libgcc.a
LOAD /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a
END GROUP
START GROUP
LOAD /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/libgcc.a
LOAD /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a
LOAD /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libnosys.a
END GROUP
START GROUP
LOAD /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/libgcc.a
LOAD /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a
LOAD /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libnosys.a
END GROUP
LOAD /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crtend.o
LOAD /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crtn.o
0x20008000 _estack = (ORIGIN (RAM) + LENGTH (RAM))
0x00000200 _Min_Heap_Size = 0x200
0x00000400 _Min_Stack_Size = 0x400
.isr_vector 0x08000000 0x1d8
0x08000000 . = ALIGN (0x4)
*(.isr_vector)
.isr_vector 0x08000000 0x1d8 ./Src/task1_it.o
0x08000000 paIsrFunc
0x080001d8 . = ALIGN (0x4)
.text 0x080001d8 0x4bc
0x080001d8 . = ALIGN (0x4)
*(.text)
.text 0x080001d8 0x40 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crtbegin.o
*(.text*)
.text.main 0x08000218 0x1e0 ./Src/task1.o
0x08000218 main
.text.GPIO_init
0x080003f8 0xe4 ./Src/task1.o
.text.delay 0x080004dc 0x74 ./Src/task1.o
.text.ISR_error
0x08000550 0x4c ./Src/task1_it.o
0x08000550 ISR_error
.text.ISR_default
0x0800059c 0x4c ./Src/task1_it.o
0x0800059c ISR_default
.text.Reset_Handler
0x080005e8 0x4c ./Startup/startup_stm32g431kbtx.o
0x080005e8 Reset_Handler
.text.__libc_init_array
0x08000634 0x48 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-init.o)
0x08000634 __libc_init_array
*(.glue_7)
.glue_7 0x0800067c 0x0 linker stubs
*(.glue_7t)
.glue_7t 0x0800067c 0x0 linker stubs
*(.eh_frame)
.eh_frame 0x0800067c 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crtbegin.o
*(.init)
.init 0x0800067c 0x4 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crti.o
0x0800067c _init
.init 0x08000680 0x8 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crtn.o
*(.fini)
.fini 0x08000688 0x4 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crti.o
0x08000688 _fini
.fini 0x0800068c 0x8 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crtn.o
0x08000694 . = ALIGN (0x4)
0x08000694 _etext = .
.vfp11_veneer 0x08000694 0x0
.vfp11_veneer 0x08000694 0x0 linker stubs
.v4_bx 0x08000694 0x0
.v4_bx 0x08000694 0x0 linker stubs
.iplt 0x08000694 0x0
.iplt 0x08000694 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crtbegin.o
.rodata 0x08000694 0x0
0x08000694 . = ALIGN (0x4)
*(.rodata)
*(.rodata*)
0x08000694 . = ALIGN (0x4)
.ARM.extab 0x08000694 0x0
0x08000694 . = ALIGN (0x4)
*(.ARM.extab* .gnu.linkonce.armextab.*)
0x08000694 . = ALIGN (0x4)
.ARM 0x08000694 0x0
0x08000694 . = ALIGN (0x4)
0x08000694 __exidx_start = .
*(.ARM.exidx*)
0x08000694 __exidx_end = .
0x08000694 . = ALIGN (0x4)
.preinit_array 0x08000694 0x0
0x08000694 . = ALIGN (0x4)
0x08000694 PROVIDE (__preinit_array_start = .)
*(.preinit_array*)
0x08000694 PROVIDE (__preinit_array_end = .)
0x08000694 . = ALIGN (0x4)
.init_array 0x08000694 0x4
0x08000694 . = ALIGN (0x4)
0x08000694 PROVIDE (__init_array_start = .)
*(SORT_BY_NAME(.init_array.*))
*(.init_array*)
.init_array 0x08000694 0x4 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crtbegin.o
0x08000698 PROVIDE (__init_array_end = .)
0x08000698 . = ALIGN (0x4)
.fini_array 0x08000698 0x4
0x08000698 . = ALIGN (0x4)
[!provide] PROVIDE (__fini_array_start = .)
*(SORT_BY_NAME(.fini_array.*))
*(.fini_array*)
.fini_array 0x08000698 0x4 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crtbegin.o
[!provide] PROVIDE (__fini_array_end = .)
0x0800069c . = ALIGN (0x4)
0x0800069c _sidata = LOADADDR (.data)
.rel.dyn 0x0800069c 0x0
.rel.iplt 0x0800069c 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crtbegin.o
.data 0x20000000 0x0 load address 0x0800069c
0x20000000 . = ALIGN (0x4)
0x20000000 _sdata = .
*(.data)
*(.data*)
*(.RamFunc)
*(.RamFunc*)
0x20000000 . = ALIGN (0x4)
0x20000000 _edata = .
0x0800069c _siccmsram = LOADADDR (.ccmsram)
.igot.plt 0x20000000 0x0 load address 0x0800069c
.igot.plt 0x20000000 0x0 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crtbegin.o
.ccmsram 0x10000000 0x0 load address 0x0800069c
0x10000000 . = ALIGN (0x4)
0x10000000 _sccmsram = .
*(.ccmsram)
*(.ccmsram*)
0x10000000 . = ALIGN (0x4)
0x10000000 _eccmsram = .
0x10000000 . = ALIGN (0x4)
.bss 0x20000000 0x20
0x20000000 _sbss = .
0x20000000 __bss_start__ = _sbss
*(.bss)
.bss 0x20000000 0x1c /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crtbegin.o
*(.bss*)
.bss.state 0x2000001c 0x4 ./Src/task1.o
0x2000001c state
*(COMMON)
0x20000020 . = ALIGN (0x4)
0x20000020 _ebss = .
0x20000020 __bss_end__ = _ebss
._user_heap_stack
0x20000020 0x600
0x20000020 . = ALIGN (0x8)
[!provide] PROVIDE (end = .)
0x20000020 PROVIDE (_end = .)
0x20000220 . = (. + _Min_Heap_Size)
*fill* 0x20000020 0x200
0x20000620 . = (. + _Min_Stack_Size)
*fill* 0x20000220 0x400
0x20000620 . = ALIGN (0x8)
/DISCARD/
libc.a(*)
libm.a(*)
libgcc.a(*)
.ARM.attributes
0x00000000 0x30
*(.ARM.attributes)
.ARM.attributes
0x00000000 0x22 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crti.o
.ARM.attributes
0x00000022 0x34 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crtbegin.o
.ARM.attributes
0x00000056 0x34 ./Src/task1.o
.ARM.attributes
0x0000008a 0x34 ./Src/task1_it.o
.ARM.attributes
0x000000be 0x21 ./Startup/startup_stm32g431kbtx.o
.ARM.attributes
0x000000df 0x34 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-init.o)
.ARM.attributes
0x00000113 0x22 /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crtn.o
OUTPUT(task1.elf elf32-littlearm)
LOAD linker stubs
LOAD /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc.a
LOAD /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libm.a
LOAD /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/libgcc.a
.debug_info 0x00000000 0x7eb
.debug_info 0x00000000 0x42f ./Src/task1.o
.debug_info 0x0000042f 0x38b ./Src/task1_it.o
.debug_info 0x000007ba 0x31 ./Startup/startup_stm32g431kbtx.o
.debug_abbrev 0x00000000 0x296
.debug_abbrev 0x00000000 0x173 ./Src/task1.o
.debug_abbrev 0x00000173 0xfd ./Src/task1_it.o
.debug_abbrev 0x00000270 0x26 ./Startup/startup_stm32g431kbtx.o
.debug_aranges 0x00000000 0x78
.debug_aranges
0x00000000 0x30 ./Src/task1.o
.debug_aranges
0x00000030 0x28 ./Src/task1_it.o
.debug_aranges
0x00000058 0x20 ./Startup/startup_stm32g431kbtx.o
.debug_rnglists
0x00000000 0x3a
.debug_rnglists
0x00000000 0x21 ./Src/task1.o
.debug_rnglists
0x00000021 0x19 ./Src/task1_it.o
.debug_macro 0x00000000 0x13740
.debug_macro 0x00000000 0xd4 ./Src/task1.o
.debug_macro 0x000000d4 0xac0 ./Src/task1.o
.debug_macro 0x00000b94 0x28 ./Src/task1.o
.debug_macro 0x00000bbc 0x22 ./Src/task1.o
.debug_macro 0x00000bde 0x8e ./Src/task1.o
.debug_macro 0x00000c6c 0x51 ./Src/task1.o
.debug_macro 0x00000cbd 0x103 ./Src/task1.o
.debug_macro 0x00000dc0 0x6a ./Src/task1.o
.debug_macro 0x00000e2a 0x1df ./Src/task1.o
.debug_macro 0x00001009 0x1c ./Src/task1.o
.debug_macro 0x00001025 0x22 ./Src/task1.o
.debug_macro 0x00001047 0xfb ./Src/task1.o
.debug_macro 0x00001142 0x1011 ./Src/task1.o
.debug_macro 0x00002153 0x11f ./Src/task1.o
.debug_macro 0x00002272 0x11396 ./Src/task1.o
.debug_macro 0x00013608 0x70 ./Src/task1.o
.debug_macro 0x00013678 0xc8 ./Src/task1_it.o
.debug_line 0x00000000 0xa3e
.debug_line 0x00000000 0x58f ./Src/task1.o
.debug_line 0x0000058f 0x445 ./Src/task1_it.o
.debug_line 0x000009d4 0x6a ./Startup/startup_stm32g431kbtx.o
.debug_str 0x00000000 0x6f831
.debug_str 0x00000000 0x6f7b8 ./Src/task1.o
0x6f954 (size before relaxing)
.debug_str 0x0006f7b8 0x48 ./Src/task1_it.o
0x6f900 (size before relaxing)
.debug_str 0x0006f800 0x31 ./Startup/startup_stm32g431kbtx.o
0x96 (size before relaxing)
.comment 0x00000000 0x43
.comment 0x00000000 0x43 ./Src/task1.o
0x44 (size before relaxing)
.comment 0x00000043 0x44 ./Src/task1_it.o
.debug_frame 0x00000000 0xe4
.debug_frame 0x00000000 0x78 ./Src/task1.o
.debug_frame 0x00000078 0x40 ./Src/task1_it.o
.debug_frame 0x000000b8 0x2c /opt/st/stm32cubeide_1.16.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc_nano.a(libc_a-init.o)
.debug_line_str
0x00000000 0x7a
.debug_line_str
0x00000000 0x7a ./Startup/startup_stm32g431kbtx.o

1620
task2/task2.als Normal file

File diff suppressed because it is too large Load Diff

BIN
task2/task2.elf Executable file

Binary file not shown.

View File

@ -37,7 +37,7 @@
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_txt_serial_number" value=""/> <stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.stlink_txt_serial_number" value=""/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.watchdog_config" value="none"/> <stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlink.watchdog_config" value="none"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkenable_rtos" value="false"/> <booleanAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkenable_rtos" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkrestart_configurations" value="{&quot;fVersion&quot;:1,&quot;fItems&quot;:[{&quot;fDisplayName&quot;:&quot;Reset&quot;,&quot;fIsSuppressible&quot;:false,&quot;fResetAttribute&quot;:&quot;Software system reset&quot;,&quot;fResetStrategies&quot;:[{&quot;fDisplayName&quot;:&quot;Software system reset&quot;,&quot;fLaunchAttribute&quot;:&quot;system_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset\r\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;Hardware reset&quot;,&quot;fLaunchAttribute&quot;:&quot;hardware_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset hardware\r\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;Core reset&quot;,&quot;fLaunchAttribute&quot;:&quot;core_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset core\r\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;None&quot;,&quot;fLaunchAttribute&quot;:&quot;no_reset&quot;,&quot;fGdbCommands&quot;:[],&quot;fCmdOptions&quot;:[&quot;-g&quot;]}],&quot;fGdbCommandGroup&quot;:{&quot;name&quot;:&quot;Additional commands&quot;,&quot;commands&quot;:[]},&quot;fStartApplication&quot;:true}]}"/> <stringAttribute key="com.st.stm32cube.ide.mcu.debug.stlinkrestart_configurations" value="{&quot;fVersion&quot;:1,&quot;fItems&quot;:[{&quot;fDisplayName&quot;:&quot;Reset&quot;,&quot;fIsSuppressible&quot;:false,&quot;fResetAttribute&quot;:&quot;Software system reset&quot;,&quot;fResetStrategies&quot;:[{&quot;fDisplayName&quot;:&quot;Software system reset&quot;,&quot;fLaunchAttribute&quot;:&quot;system_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;Hardware reset&quot;,&quot;fLaunchAttribute&quot;:&quot;hardware_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset hardware\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;Core reset&quot;,&quot;fLaunchAttribute&quot;:&quot;core_reset&quot;,&quot;fGdbCommands&quot;:[&quot;monitor reset core\n&quot;],&quot;fCmdOptions&quot;:[&quot;-g&quot;]},{&quot;fDisplayName&quot;:&quot;None&quot;,&quot;fLaunchAttribute&quot;:&quot;no_reset&quot;,&quot;fGdbCommands&quot;:[],&quot;fCmdOptions&quot;:[&quot;-g&quot;]}],&quot;fGdbCommandGroup&quot;:{&quot;name&quot;:&quot;Additional commands&quot;,&quot;commands&quot;:[]},&quot;fStartApplication&quot;:true}]}"/>
<booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.enableRtosProxy" value="false"/> <booleanAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.enableRtosProxy" value="false"/>
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyCustomProperties" value=""/> <stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyCustomProperties" value=""/>
<stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriver" value="threadx"/> <stringAttribute key="com.st.stm32cube.ide.mcu.rtosproxy.rtosProxyDriver" value="threadx"/>

156
task2/task2.lst Normal file
View File

@ -0,0 +1,156 @@
task2.elf: file format elf32-littlearm
Sections:
Idx Name Size VMA LMA File off Algn
0 .vectortable 00000014 08000000 08000000 00001000 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
1 .text 00000074 08000400 08000400 00001400 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
2 .exhand 00000068 08001000 08001000 00002000 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
SYMBOL TABLE:
08000000 l d .vectortable 00000000 .vectortable
08000400 l d .text 00000000 .text
08001000 l d .exhand 00000000 .exhand
08001000 l F .exhand 00000000 _ISR_NMI
08001028 l F .exhand 00000000 _ISR_HARDF
08001050 l F .exhand 00000000 _ISR_S0
08000466 l .text 00000000 .lp1
08001058 l F .exhand 00000000 _ISR_S1
0800105e l .exhand 00000000 .lp2
08000400 g F .text 00000000 init
08000444 g F .text 00000000 main
08000454 g F .text 00000000 delay
08000460 g .text 00000000 stop
Disassembly of section .vectortable:
08000000 <.vectortable>:
8000000: 20004000 .word 0x20004000
8000004: 08000401 .word 0x08000401
8000008: 08001001 .word 0x08001001
800000c: 08001029 .word 0x08001029
8000010: 08001051 .word 0x08001051
Disassembly of section .text:
08000400 <init>:
8000400: b672 cpsid i
8000402: 2000 movs r0, #0
8000404: 2100 movs r1, #0
8000406: 2200 movs r2, #0
8000408: 2300 movs r3, #0
800040a: 2400 movs r4, #0
800040c: 2500 movs r5, #0
800040e: 2600 movs r6, #0
8000410: 2700 movs r7, #0
8000412: 4680 mov r8, r0
8000414: 4681 mov r9, r0
8000416: 4682 mov sl, r0
8000418: 4683 mov fp, r0
800041a: 4684 mov ip, r0
800041c: 4912 ldr r1, [pc, #72] @ (8000468 <.lp1+0x2>)
800041e: f04f 0201 mov.w r2, #1
8000422: 6808 ldr r0, [r1, #0]
8000424: 4310 orrs r0, r2
8000426: 6008 str r0, [r1, #0]
8000428: f04f 4190 mov.w r1, #1207959552 @ 0x48000000
800042c: 2203 movs r2, #3
800042e: 6808 ldr r0, [r1, #0]
8000430: 4390 bics r0, r2
8000432: 2201 movs r2, #1
8000434: 4310 orrs r0, r2
8000436: 6008 str r0, [r1, #0]
8000438: 490c ldr r1, [pc, #48] @ (800046c <.lp1+0x6>)
800043a: 2201 movs r2, #1
800043c: 6808 ldr r0, [r1, #0]
800043e: 4310 orrs r0, r2
8000440: 6008 str r0, [r1, #0]
8000442: b662 cpsie i
08000444 <main>:
8000444: 4909 ldr r1, [pc, #36] @ (800046c <.lp1+0x6>)
8000446: 4050 eors r0, r2
8000448: 6008 str r0, [r1, #0]
800044a: f000 f803 bl 8000454 <delay>
800044e: f7ff bff9 b.w 8000444 <main>
8000452: bf00 nop
08000454 <delay>:
8000454: 2600 movs r6, #0
8000456: 4f06 ldr r7, [pc, #24] @ (8000470 <.lp1+0xa>)
8000458: 3601 adds r6, #1
800045a: 42be cmp r6, r7
800045c: d1fc bne.n 8000458 <delay+0x4>
800045e: 4770 bx lr
08000460 <stop>:
8000460: bf00 nop
8000462: f7ff bffd b.w 8000460 <stop>
08000466 <.lp1>:
8000466: 0000 .short 0x0000
8000468: 4002104c .word 0x4002104c
800046c: 48000014 .word 0x48000014
8000470: 001e8480 .word 0x001e8480
Disassembly of section .exhand:
08001000 <_ISR_NMI>:
8001000: 4917 ldr r1, [pc, #92] @ (8001060 <.lp2+0x2>)
8001002: f04f 0201 mov.w r2, #1
8001006: 6808 ldr r0, [r1, #0]
8001008: 4310 orrs r0, r2
800100a: 6008 str r0, [r1, #0]
800100c: f04f 4190 mov.w r1, #1207959552 @ 0x48000000
8001010: 22ff movs r2, #255 @ 0xff
8001012: 6808 ldr r0, [r1, #0]
8001014: 4390 bics r0, r2
8001016: 2244 movs r2, #68 @ 0x44
8001018: 4310 orrs r0, r2
800101a: 6008 str r0, [r1, #0]
800101c: 4911 ldr r1, [pc, #68] @ (8001064 <.lp2+0x6>)
800101e: 220a movs r2, #10
8001020: 6808 ldr r0, [r1, #0]
8001022: 4390 bics r0, r2
8001024: 6008 str r0, [r1, #0]
8001026: e7eb b.n 8001000 <_ISR_NMI>
08001028 <_ISR_HARDF>:
8001028: 490d ldr r1, [pc, #52] @ (8001060 <.lp2+0x2>)
800102a: f04f 0201 mov.w r2, #1
800102e: 6808 ldr r0, [r1, #0]
8001030: 4310 orrs r0, r2
8001032: 6008 str r0, [r1, #0]
8001034: f04f 4190 mov.w r1, #1207959552 @ 0x48000000
8001038: 22ff movs r2, #255 @ 0xff
800103a: 6808 ldr r0, [r1, #0]
800103c: 4390 bics r0, r2
800103e: 2211 movs r2, #17
8001040: 4310 orrs r0, r2
8001042: 6008 str r0, [r1, #0]
8001044: 4907 ldr r1, [pc, #28] @ (8001064 <.lp2+0x6>)
8001046: 2205 movs r2, #5
8001048: 6808 ldr r0, [r1, #0]
800104a: 4390 bics r0, r2
800104c: 6008 str r0, [r1, #0]
800104e: e7eb b.n 8001028 <_ISR_HARDF>
08001050 <_ISR_S0>:
8001050: b500 push {lr}
8001052: bc02 pop {r1}
8001054: 4708 bx r1
8001056: bf00 nop
08001058 <_ISR_S1>:
8001058: b500 push {lr}
800105a: bc02 pop {r1}
800105c: 4708 bx r1
0800105e <.lp2>:
800105e: 0000 .short 0x0000
8001060: 4002104c .word 0x4002104c
8001064: 48000014 .word 0x48000014

92
task2/task2.map Normal file
View File

@ -0,0 +1,92 @@
Memory Configuration
Name Origin Length Attributes
IVECS 0x08000000 0x000001d8 r
PGM 0x08000400 0x00000c00 xr
EXHANDS 0x08001000 0x00000400 xr
RAM 0x20000000 0x00001800 rw
*default* 0x00000000 0xffffffff
Linker script and memory map
.vectortable 0x08000000 0x14
0x08000000 . = ALIGN (0x4)
*(.vectortable)
.vectortable 0x08000000 0x14 task2.o
0x08000014 . = ALIGN (0x4)
.text 0x08000400 0x74
*(.text)
.text 0x08000400 0x74 task2.o
0x08000400 init
0x08000444 main
0x08000454 delay
0x08000460 stop
.glue_7 0x08000474 0x0
.glue_7 0x08000474 0x0 linker stubs
.glue_7t 0x08000474 0x0
.glue_7t 0x08000474 0x0 linker stubs
.vfp11_veneer 0x08000474 0x0
.vfp11_veneer 0x08000474 0x0 linker stubs
.v4_bx 0x08000474 0x0
.v4_bx 0x08000474 0x0 linker stubs
.iplt 0x08000474 0x0
.iplt 0x08000474 0x0 task2.o
.exhand 0x08001000 0x68
*(.exhand)
.exhand 0x08001000 0x68 task2.o
LOAD task2.o
OUTPUT(task2.elf elf32-littlearm)
LOAD linker stubs
.rel.dyn 0x08001068 0x0
.rel.iplt 0x08001068 0x0 task2.o
.data 0x08001068 0x0
.data 0x08001068 0x0 task2.o
.igot.plt 0x08001068 0x0
.igot.plt 0x08001068 0x0 task2.o
.bss 0x08001068 0x0
.bss 0x08001068 0x0 task2.o
.ARM.attributes
0x00000000 0x21
.ARM.attributes
0x00000000 0x21 task2.o
.debug_line 0x00000000 0xc1
.debug_line 0x00000000 0xc1 task2.o
.debug_info 0x00000000 0x22
.debug_info 0x00000000 0x22 task2.o
.debug_abbrev 0x00000000 0x12
.debug_abbrev 0x00000000 0x12 task2.o
.debug_aranges 0x00000000 0x28
.debug_aranges
0x00000000 0x28 task2.o
.debug_str 0x00000000 0x68
.debug_str 0x00000000 0x68 task2.o
.debug_ranges 0x00000000 0x20
.debug_ranges 0x00000000 0x20 task2.o
Cross Reference Table
Symbol File
delay task2.o
init task2.o
main task2.o
stop task2.o

BIN
task2/task2.o Normal file

Binary file not shown.

View File

@ -1,45 +1,32 @@
#****************************************************************************************# #****************************************************************************************#
# Project: task2 - ASM: Interrupts # Project: task2 - ASM: Interrupts
# File: task2.s # File: task2.s
#
# Language: ASM
#
# Hardware: STefi Light v1.1 # Hardware: STefi Light v1.1
# Processor: STM32G431KBT6U # Processor: STM32G431KBT6U
#
# Author: Manuel Lederhofer
# Datum: 31.10.2014
#
# Version: 6.0
# History:
# 31.10.2014 ML create file
# 27.09.2018 ML edit comments, extend vector table
# 18.12.2018 ML port from MKL05Z32VLC4 to STM32L476RG
# 27.02.2019 ML move section of exception handlers to bottom of file
# 25.09.2019 ML minor changes for a better code and comment understanding
# 04.09.2020 HL port from STM32L476RG to STM32F411xE
# 21.09.2020 ML tidy up, comments and formatting
# 29.09.2021 ML port from STM32F411xE to STM32F042K6T6
# 09.03.2022 ML port from STM32F042K6T6 to STM32G431KBT6U
# 10.02.2025 TK remove ASM:Polling,move ASM:Interrupts to task2
# 24.06.2025 TK remove /* ... place your code here ... */
#
# Status: working
#
# Description:
# See the description and requirements of the requested application
# in the lab exercise guide.
#
# Notes:
# - MCU speed at startup is 16 MHz
#
# ToDo:
# - Change the example code to match the description and requirements
# of the requested application in the lab exercise guide.
#****************************************************************************************# #****************************************************************************************#
.include "G431_addr.s" .include "G431_addr.s"
// Zusätzliche und benötigte Adressen
.equ RCC_AHB2ENR, 0x4002104C
.equ RCC_APB2ENR, 0x40021060
.equ GPIOA_MODER, 0x48000000
.equ GPIOA_ODR, 0x48000014
.equ GPIOC_MODER, 0x48000800
.equ GPIOC_PUPDR, 0x4800080C
.equ GPIOC_IDR, 0x48000810
.equ SYSCFG_BASE, 0x40010000
.equ SYSCFG_EXTICR4, (SYSCFG_BASE + 0x14)
.equ EXTI_BASE, 0x40010400
.equ EXTI_IMR1, (EXTI_BASE + 0x00)
.equ EXTI_FTSR1, (EXTI_BASE + 0x0C)
.equ EXTI_PR1, (EXTI_BASE + 0x14)
.equ NVIC_ISER1, 0xE000E104
#----------------------------------------------------------------------------------------# #----------------------------------------------------------------------------------------#
.section .vectortable,"a" // vector table at begin of ROM .section .vectortable,"a" // vector table at begin of ROM
@ -47,20 +34,13 @@
.align 2 .align 2
.word 0x20004000 // initial Stack Pointer: 0x20000000 (RAM base) + 0x4000 (16K SRAM1 length) .word 0x20004000 // initial Stack Pointer
.word 0x08000401 // initial Program Counter .word 0x08000401 // initial Program Counter
.word _ISR_NMI // non-masking interrupt .word _ISR_NMI // non-masking interrupt
.word _ISR_HARDF // hard fault interrupt .word _ISR_HARDF // hard fault interrupt
.space 0xD0 // padding 208 Bytes bis Offset 0xE0 (EXTI15_10 IRQ 40)
.word _ISR_S0_S1 // gemeinsamer Interrupt für PC13 (S0) und PC14 (S1)
/* N.B.
Look at the .space or the .org assembler directive to insert the address of the
ISRs at the right place in the vector table. Verify your settings by the help of
the list file. */
.word _ISR_S0
#----------------------------------------------------------------------------------------# #----------------------------------------------------------------------------------------#
.text // section .text (default section for program code) .text // section .text (default section for program code)
@ -90,57 +70,85 @@ init:
MOV r12, r0 MOV r12, r0
#--- enable port clocking #--- enable port clocking
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR LDR r1, =RCC_AHB2ENR
MOV r2, #0x01 // load mask for adjusting port clock gating (A: LEDs) MOVS r2, #0x05 // Bit 0 (GPIOA) und Bit 2 (GPIOC)
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR LDR r0, [r1, #0]
ORRS r0, r0, r2 // configure clock gating for ports ORRS r0, r2
STR r0, [r1, #0] // apply settings STR r0, [r1, #0]
#--- port init #--- port init
#- LEDs #- LEDs (PA0-PA3)
LDR r1, =GPIOA_MODER // load port A mode register address LDR r1, =GPIOA_MODER
MOVS r2, #0x03 // prepare mask LDR r2, =0x000000FF // Maske PA0-PA3
LDR r0, [r1, #0] // get current value of port A mode register LDR r0, [r1, #0]
BICS r0, r2 // delete bits BICS r0, r2
MOVS r2, #0x01 // load configuration mask LDR r2, =0x00000055 // Maske Output 0101 0101
ORRS r0, r0, r2 // apply mask ORRS r0, r2
STR r0, [r1, #0] // apply result to port A mode register STR r0, [r1, #0]
#- switch LED off #- switch LED off
LDR r1, =GPIOA_ODR // load port A output data register LDR r1, =GPIOA_ODR
MOVS r2, #0x01 // load mask for LED MOVS r2, #0x0F // Maske LED0-3
LDR r0, [r1, #0] // get current value of GPIOA LDR r0, [r1, #0]
ORRS r0, r0, r2 // configure pin state ORRS r0, r2
STR r0, [r1, #0] // apply settings STR r0, [r1, #0]
#- buttons #- buttons (PC13, PC14 als Input)
LDR r1, =GPIOC_MODER
/* ... place your code here ... */ LDR r2, =0x3C000000 // Maske Bits 26-29
LDR r0, [r1, #0]
BICS r0, r2
STR r0, [r1, #0]
#- Pull-Up für PC13, PC14
LDR r1, =GPIOC_PUPDR
LDR r2, =0x3C000000
LDR r0, [r1, #0]
BICS r0, r2
LDR r2, =0x14000000 // 01 = Pull-Up für PC13 (Bits 27:26) und PC14 (Bits 29:28)
ORRS r0, r2
STR r0, [r1, #0]
#--- button interrupt config #--- button interrupt config
#- enable clock for SYSCFG module #- enable clock for SYSCFG module
LDR r1, =RCC_APB2ENR
MOVS r2, #0x01
LDR r0, [r1, #0]
ORRS r0, r2
STR r0, [r1, #0]
#- connect GPIO pins of the buttons to EXTended Interrupt controller lines (EXTI) #- connect GPIO pins of the buttons to EXTended Interrupt controller lines (EXTI)
# in SYSCFG module (SYSCFG_* registers) LDR r1, =SYSCFG_EXTICR4
LDR r2, =0x00000FF0 // Maske für EXTI13 (Bits 7:4) und EXTI14 (Bits 11:8)
LDR r0, [r1, #0]
BICS r0, r2
LDR r2, =0x00000220 // Port C (0010) für EXTI13 und EXTI14
ORRS r0, r2
STR r0, [r1, #0]
#- configure lines in EXTI module (EXTI_* registers) #- configure lines in EXTI module (EXTI_* registers)
LDR r1, =EXTI_FTSR1 // Fallende Flanke
LDR r2, =0x00006000 // Bits 13 und 14
LDR r0, [r1, #0]
ORRS r0, r2
STR r0, [r1, #0]
LDR r1, =EXTI_IMR1 // Maskierung aufheben
LDR r2, =0x00006000
LDR r0, [r1, #0]
ORRS r0, r2
STR r0, [r1, #0]
#- NVIC: set interrupt priority, clear pending bits #- NVIC: set interrupt priority, clear pending bits
# and enable interrupts for buttons (see: PM, ch. 4.3, NVIC) LDR r1, =NVIC_ISER1
LDR r2, =0x00000100 // Bit 8 für IRQ 40 (EXTI15_10)
LDR r0, [r1, #0]
ORRS r0, r2
STR r0, [r1, #0]
CPSIE i // enable interrupts globally CPSIE i // enable interrupts globally
#----------------------------------------------------------------------------------------# #----------------------------------------------------------------------------------------#
.align 2 .align 2
@ -150,16 +158,9 @@ init:
.global main .global main
.type main, %function .type main, %function
main: main:
LDR r1, =GPIOA_ODR WFI
EORS r0, r0, r2
STR r0, [r1, #0]
BL delay
B main B main
#----------------------------------------------------------------------------------------# #----------------------------------------------------------------------------------------#
.align 2 .align 2
@ -169,30 +170,25 @@ main:
.global delay .global delay
.type delay, %function .type delay, %function
delay: delay:
MOVS r6, #0 // ... LDR r0, =106000 // Entprell-Zeit ~20ms
LDR r7, =2000000 // ...
.L1: .L1:
ADDS r6, r6, #1 // ... SUBS r0, r0, #1
CMP r6, r7 // ... BNE .L1
BNE .L1 // ... BX lr
BX lr // ...
#----------------------------------------------------------------------------------------# #----------------------------------------------------------------------------------------#
.align 2 .align 2
.global stop .global stop
stop: stop:
NOP // do nothing (NOP is here to avoid a debugger crash, only) NOP
B stop // if this line is reached, something went wrong B stop
#----------------------------------------------------------------------------------------# #----------------------------------------------------------------------------------------#
.lp1: // this label is only to nicify the line up in the .lst file .lp1:
.ltorg .ltorg
#----------------------------------------------------------------------------------------# #----------------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------------# #----------------------------------------------------------------------------------------#
.section .exhand,"ax" // section for exception handlers .section .exhand,"ax" // section for exception handlers
#----------------------------------------------------------------------------------------# #----------------------------------------------------------------------------------------#
@ -202,32 +198,28 @@ stop:
.thumb .thumb
.type _ISR_NMI, %function .type _ISR_NMI, %function
_ISR_NMI: _ISR_NMI:
#--- enable clock LDR r1, =RCC_AHB2ENR
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR MOV r2, #0x01
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x44 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x0A // load mask for blue and yellow LED
LDR r0, [r1, #0] LDR r0, [r1, #0]
BICS r0, r0, r2 ORRS r0, r2
STR r0, [r1, #0] // switch LEDs on STR r0, [r1, #0]
LDR r1, =GPIOA_MODER
MOVS r2, #0xFF
LDR r0, [r1, #0]
BICS r0, r2
MOVS r2, #0x44
ORRS r0, r2
STR r0, [r1, #0]
LDR r1, =GPIOA_ODR
MOVS r2, #0x0A
LDR r0, [r1, #0]
BICS r0, r2
STR r0, [r1, #0]
B _ISR_NMI B _ISR_NMI
#----------------------------------------------------------------------------------------# #----------------------------------------------------------------------------------------#
.align 2 .align 2
@ -235,77 +227,99 @@ _ISR_NMI:
.thumb .thumb
.type _ISR_HARDF, %function .type _ISR_HARDF, %function
_ISR_HARDF: _ISR_HARDF:
#--- enable clock LDR r1, =RCC_AHB2ENR
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR MOV r2, #0x01
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x11 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x05 // load mask for red and green LED
LDR r0, [r1, #0] LDR r0, [r1, #0]
BICS r0, r0, r2 ORRS r0, r2
STR r0, [r1, #0] // switch LEDs on STR r0, [r1, #0]
LDR r1, =GPIOA_MODER
MOVS r2, #0xFF
LDR r0, [r1, #0]
BICS r0, r2
MOVS r2, #0x11
ORRS r0, r2
STR r0, [r1, #0]
LDR r1, =GPIOA_ODR
MOVS r2, #0x05
LDR r0, [r1, #0]
BICS r0, r2
STR r0, [r1, #0]
B _ISR_HARDF B _ISR_HARDF
#----------------------------------------------------------------------------------------# #----------------------------------------------------------------------------------------#
.align 2 .align 2
.syntax unified .syntax unified
.thumb .thumb
.type _ISR_S0, %function .type _ISR_S0_S1, %function
_ISR_S0: _ISR_S0_S1:
PUSH {lr} // save special content PUSH {r4, r5, lr} // Wichtig: Register sichern gemäß AAPCS
#--- do the work _check_S0:
LDR r4, =EXTI_PR1
LDR r5, [r4, #0]
LDR r2, =0x2000 // Maske für S0 (PC13 / Bit 13)
TST r5, r2
BEQ _check_S1 // Wenn Bit 13 nicht gesetzt, überspringen
#--- do the work S0
BL delay // Entprellen
#--- clear interrupt flag LDR r0, =GPIOC_IDR
LDR r1, [r0, #0]
LDR r2, =0x2000
TST r1, r2
BNE _clear_S0 // Abbruch, wenn High (Taster prellt / schon losgelassen)
LDR r0, =GPIOA_ODR
LDR r1, [r0, #0]
MOVS r2, #0x09 // LED0 & LED3 toggeln (1001)
EORS r1, r2
STR r1, [r0, #0]
_clear_S0:
#--- clear interrupt flag S0
LDR r4, =EXTI_PR1
LDR r5, =0x2000
STR r5, [r4, #0]
_check_S1:
LDR r4, =EXTI_PR1
LDR r5, [r4, #0]
LDR r2, =0x4000 // Maske für S1 (PC14 / Bit 14)
TST r5, r2
BEQ _leave_ISR // Wenn Bit 14 nicht gesetzt, Ende
#--- do the work S1
BL delay
LDR r0, =GPIOC_IDR
LDR r1, [r0, #0]
LDR r2, =0x4000
TST r1, r2
BNE _clear_S1 // Abbruch, wenn High
LDR r0, =GPIOA_ODR
LDR r1, [r0, #0]
MOVS r2, #0x06 // LED1 & LED2 toggeln (0110)
EORS r1, r2
STR r1, [r0, #0]
_clear_S1:
#--- clear interrupt flag S1
LDR r4, =EXTI_PR1
LDR r5, =0x4000
STR r5, [r4, #0]
_leave_ISR:
#--- leave ISR #--- leave ISR
POP {r1} // get special content back POP {r4, r5, pc} // Register wiederherstellen und zurückkehren
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------# #----------------------------------------------------------------------------------------#
.lp2:
.align 2
.syntax unified
.thumb
.type _ISR_S1, %function
_ISR_S1:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.lp2: // this label is only to nicify the line up in the .lst file
.ltorg .ltorg
#----------------------------------------------------------------------------------------# #----------------------------------------------------------------------------------------#

325
task2/task2_tobi.s Normal file
View File

@ -0,0 +1,325 @@
#****************************************************************************************#
# Project: task2 - ASM: Interrupts
# File: task2.s
#
# Language: ASM
#
# Hardware: STefi Light v1.1
# Processor: STM32G431KBT6U
#
# Author: Manuel Lederhofer
# Datum: 31.10.2014
#
# Version: 6.0
# History:
# 31.10.2014 ML create file
# 27.09.2018 ML edit comments, extend vector table
# 18.12.2018 ML port from MKL05Z32VLC4 to STM32L476RG
# 27.02.2019 ML move section of exception handlers to bottom of file
# 25.09.2019 ML minor changes for a better code and comment understanding
# 04.09.2020 HL port from STM32L476RG to STM32F411xE
# 21.09.2020 ML tidy up, comments and formatting
# 29.09.2021 ML port from STM32F411xE to STM32F042K6T6
# 09.03.2022 ML port from STM32F042K6T6 to STM32G431KBT6U
# 10.02.2025 TK remove ASM:Polling,move ASM:Interrupts to task2
# 24.06.2025 TK remove /* ... place your code here ... */
#
# Status: working
#
# Description:
# See the description and requirements of the requested application
# in the lab exercise guide.
#
# Notes:
# - MCU speed at startup is 16 MHz
#
# ToDo:
# - Change the example code to match the description and requirements
# of the requested application in the lab exercise guide.
#****************************************************************************************#
.include "G431_addr.s"
#----------------------------------------------------------------------------------------#
.section .vectortable,"a" // vector table at begin of ROM
#----------------------------------------------------------------------------------------#
.align 2
.word 0x20004000 // initial Stack Pointer: 0x20000000 (RAM base) + 0x4000 (16K SRAM1 length)
.word 0x08000401 // initial Program Counter
.word _ISR_NMI // non-masking interrupt
.word _ISR_HARDF // hard fault interrupt
/* N.B.
Look at the .space or the .org assembler directive to insert the address of the
ISRs at the right place in the vector table. Verify your settings by the help of
the list file. */
.word _ISR_S0
#----------------------------------------------------------------------------------------#
.text // section .text (default section for program code)
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global init
.type init, %function
init:
CPSID i // disable interrupts globally
MOVS r0, #0 // safely initialize the GPRs
MOVS r1, #0
MOVS r2, #0
MOVS r3, #0
MOVS r4, #0
MOVS r5, #0
MOVS r6, #0
MOVS r7, #0
MOV r8, r0
MOV r9, r0
MOV r10, r0
MOV r11, r0
MOV r12, r0
#--- enable port clocking
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask for adjusting port clock gating (A: LEDs)
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for ports
STR r0, [r1, #0] // apply settings
#--- port init
#- LEDs
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0x03 // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r2 // delete bits
MOVS r2, #0x01 // load configuration mask
ORRS r0, r0, r2 // apply mask
STR r0, [r1, #0] // apply result to port A mode register
# LDR r1, =GPIOB_MODER
# MOVS r3, #0x03
# LDR r0, [r1, #1]
# BICS r0, r3
# MOVS r3, #0x01
# ORRS r0, r0, r3
# STR r0, [r1, #1]
#- switch LED off
LDR r1, =GPIOA_ODR // load port A output data register
MOVS r2, #0x01 // load mask for LED
LDR r0, [r1, #0] // get current value of GPIOA
ORRS r0, r0, r2 // configure pin state
STR r0, [r1, #0] // apply settings
#- buttons
/* ... place your code here ... */
#--- button interrupt config
#- enable clock for SYSCFG module
#- connect GPIO pins of the buttons to EXTended Interrupt controller lines (EXTI)
# in SYSCFG module (SYSCFG_* registers)
#- configure lines in EXTI module (EXTI_* registers)
#- NVIC: set interrupt priority, clear pending bits
# and enable interrupts for buttons (see: PM, ch. 4.3, NVIC)
CPSIE i // enable interrupts globally
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global main
.type main, %function
main:
LDR r1, =GPIOA_ODR
EORS r0, r0, r2
STR r0, [r1, #0]
BL delay
B main
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.thumb_func
.global delay
.type delay, %function
delay:
MOVS r6, #0 // ...
LDR r7, =2000000 // ...
.L1:
ADDS r6, r6, #1 // ...
CMP r6, r7 // ...
BNE .L1 // ...
BX lr // ...
#----------------------------------------------------------------------------------------#
.align 2
.global stop
stop:
NOP // do nothing (NOP is here to avoid a debugger crash, only)
B stop // if this line is reached, something went wrong
#----------------------------------------------------------------------------------------#
.lp1: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------------#
.section .exhand,"ax" // section for exception handlers
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_NMI, %function
_ISR_NMI:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x44 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x0A // load mask for blue and yellow LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_NMI
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_HARDF, %function
_ISR_HARDF:
#--- enable clock
LDR r1, =RCC_AHB2ENR // load address of RCC_AHB2ENR
MOV r2, #0x01 // load mask
LDR r0, [r1, #0] // get current value of RCC_AHB2ENR
ORRS r0, r0, r2 // configure clock gating for port
STR r0, [r1, #0] // apply settings
#--- init pins
LDR r1, =GPIOA_MODER // load port A mode register address
MOVS r2, #0xFF // prepare mask
LDR r0, [r1, #0] // get current value of port A mode register
BICS r0, r0, r2 // delete bits
MOVS r2, #0x11 // load configuration mask
ORRS r0, r0, r2 // configure pins
STR r0, [r1, #0] // apply settings to port A mode register
#--- switch some LEDs on
LDR r1, =GPIOA_ODR // load port A data output register address
MOVS r2, #0x05 // load mask for red and green LED
LDR r0, [r1, #0]
BICS r0, r0, r2
STR r0, [r1, #0] // switch LEDs on
B _ISR_HARDF
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S0, %function
_ISR_S0:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.align 2
.syntax unified
.thumb
.type _ISR_S1, %function
_ISR_S1:
PUSH {lr} // save special content
#--- do the work
#--- clear interrupt flag
#--- leave ISR
POP {r1} // get special content back
BX r1 // go back to where we came from
#----------------------------------------------------------------------------------------#
.lp2: // this label is only to nicify the line up in the .lst file
.ltorg
#----------------------------------------------------------------------------------------#
.end
#************************************** E O F *******************************************#