diff --git a/.gitignore b/.gitignore index fa35f7b..18be6e8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ -\lab2barnestr\lab2barnestr Debug.cfg -\lab2barnestr\LinkerScript.ld -\lab2barnestr\NUCLEO-F446RE.xml -\lab2barnestr\.settings\** +\**\lab2barnestr Debug.cfg +\**\LinkerScript.ld +\**\NUCLEO-F446RE.xml +\**\.settings\** \.metadata -\lab2barnestr\lab2barnestr.bin -\lab2barnestr\lab2barnestr.elf +\**\lab2barnestr.bin +\**\lab2barnestr.elf \lab2barnestr\output.map \ No newline at end of file diff --git a/.metadata/.log b/.metadata/.log index 9a8afc5..61a95a5 100644 --- a/.metadata/.log +++ b/.metadata/.log @@ -2241,3 +2241,6 @@ Error erasing flash with vFlashErase packet java.lang.Exception: Error erasing flash with vFlashErase packet at org.eclipse.cdt.dsf.mi.service.command.AbstractMIControl$RxThread.processMIOutput(AbstractMIControl.java:941) at org.eclipse.cdt.dsf.mi.service.command.AbstractMIControl$RxThread.run(AbstractMIControl.java:770) + +!ENTRY org.eclipse.cdt.core 1 0 2019-10-01 15:49:10.425 +!MESSAGE Indexed 'lab3subroutines' (1 sources, 33 headers) in 0.605 sec: 1,056 declarations; 1,872 references; 0 unresolved inclusions; 0 syntax errors; 0 unresolved names (0%) diff --git a/.metadata/.plugins/org.eclipse.cdt.ui/global-build.log b/.metadata/.plugins/org.eclipse.cdt.ui/global-build.log index 96fd844..a1b259c 100644 --- a/.metadata/.plugins/org.eclipse.cdt.ui/global-build.log +++ b/.metadata/.plugins/org.eclipse.cdt.ui/global-build.log @@ -899,3 +899,66 @@ arm-none-eabi-size "lab2barnestr.elf" text data bss dec hex filename 1104 1080 1092 3276 ccc lab2barnestr.elf +15:45:01 **** Incremental Build of configuration Debug for project lab2barnestr **** +make all +make: Nothing to be done for 'all'. +16:03:06 **** Build of configuration Debug for project lab3subroutines **** +make all +Building file: ../startup/startup_stm32.s +Invoking: MCU GCC Assembler +C:\Users\barnestr\Documents\CE2801\workspace\lab3subroutines\Debug +arm-none-eabi-as -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -g -o "startup/startup_stm32.o" "../startup/startup_stm32.s" +Finished building: ../startup/startup_stm32.s + +Building file: ../startup/sysmem.c +Invoking: MCU GCC Compiler +C:\Users\barnestr\Documents\CE2801\workspace\lab3subroutines\Debug +arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DSTM32 -DSTM32F4 -DSTM32F446RETx -DNUCLEO_F446RE -DDEBUG -O0 -g3 -Wall -fmessage-length=0 -ffunction-sections -c -MMD -MP -MF"startup/sysmem.d" -MT"startup/sysmem.o" -o "startup/sysmem.o" "../startup/sysmem.c" +Finished building: ../startup/sysmem.c + +Building file: ../src/gpio.s +Invoking: MCU GCC Assembler +C:\Users\barnestr\Documents\CE2801\workspace\lab3subroutines\Debug +arm-none-eabi-as -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -g -o "src/gpio.o" "../src/gpio.s" +Finished building: ../src/gpio.s + +Building file: ../src/led.s +Invoking: MCU GCC Assembler +C:\Users\barnestr\Documents\CE2801\workspace\lab3subroutines\Debug +arm-none-eabi-as -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -g -o "src/led.o" "../src/led.s" +Finished building: ../src/led.s + +Building file: ../src/main.s +Invoking: MCU GCC Assembler +C:\Users\barnestr\Documents\CE2801\workspace\lab3subroutines\Debug +arm-none-eabi-as -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -g -o "src/main.o" "../src/main.s" +Finished building: ../src/main.s + +Building target: lab3subroutines.elf +Invoking: MCU GCC Linker +arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -T"C:\Users\barnestr\Documents\CE2801\workspace\lab3subroutines\LinkerScript.ld" -Wl,-Map=output.map -Wl,--gc-sections -o "lab3subroutines.elf" @"objects.list" -lm +startup/startup_stm32.o: In function `LoopFillZerobss': +C:\Users\barnestr\Documents\CE2801\workspace\lab3subroutines\Debug/../startup/startup_stm32.s:78: undefined reference to `main' +collect2.exe: error: ld returned 1 exit status +make: *** [lab3subroutines.elf] Error 1 +makefile:34: recipe for target 'lab3subroutines.elf' failed +16:03:55 **** Incremental Build of configuration Debug for project lab3subroutines **** +make all +Building file: ../src/main.s +Invoking: MCU GCC Assembler +C:\Users\barnestr\Documents\CE2801\workspace\lab3subroutines\Debug +arm-none-eabi-as -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -g -o "src/main.o" "../src/main.s" +Finished building: ../src/main.s + +Building target: lab3subroutines.elf +Invoking: MCU GCC Linker +arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -T"C:\Users\barnestr\Documents\CE2801\workspace\lab3subroutines\LinkerScript.ld" -Wl,-Map=output.map -Wl,--gc-sections -o "lab3subroutines.elf" @"objects.list" -lm +Finished building target: lab3subroutines.elf + +make --no-print-directory post-build +Generating binary and Printing size information: +arm-none-eabi-objcopy -O binary "lab3subroutines.elf" "lab3subroutines.bin" +arm-none-eabi-size "lab3subroutines.elf" + text data bss dec hex filename + 972 1080 1092 3144 c48 lab3subroutines.elf + diff --git a/.metadata/.plugins/org.eclipse.cdt.ui/lab2barnestr.build.log b/.metadata/.plugins/org.eclipse.cdt.ui/lab2barnestr.build.log index a6d40c7..4db7a68 100644 --- a/.metadata/.plugins/org.eclipse.cdt.ui/lab2barnestr.build.log +++ b/.metadata/.plugins/org.eclipse.cdt.ui/lab2barnestr.build.log @@ -1,23 +1,6 @@ -15:20:49 **** Incremental Build of configuration Debug for project lab2barnestr **** +15:45:01 **** Incremental Build of configuration Debug for project lab2barnestr **** make all -Building file: ../src/main.s -Invoking: MCU GCC Assembler -C:\Users\barnestr\Documents\CE2801\workspace\lab2barnestr\Debug -arm-none-eabi-as -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -g -o "src/main.o" "../src/main.s" -Finished building: ../src/main.s - -Building target: lab2barnestr.elf -Invoking: MCU GCC Linker -arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -T"C:\Users\barnestr\Documents\CE2801\workspace\lab2barnestr\LinkerScript.ld" -Wl,-Map=output.map -Wl,--gc-sections -o "lab2barnestr.elf" @"objects.list" -lm -Finished building target: lab2barnestr.elf - -make --no-print-directory post-build -Generating binary and Printing size information: -arm-none-eabi-objcopy -O binary "lab2barnestr.elf" "lab2barnestr.bin" -arm-none-eabi-size "lab2barnestr.elf" - text data bss dec hex filename - 1104 1080 1092 3276 ccc lab2barnestr.elf - +make: Nothing to be done for 'all'. -15:20:51 Build Finished (took 2s.165ms) +15:45:02 Build Finished (took 1s.110ms) diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.markers.snap b/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.markers.snap index 1253ec8..a7ddbe1 100644 Binary files a/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.markers.snap and b/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.markers.snap differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.syncinfo.snap b/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.syncinfo.snap index 1253ec8..a7ddbe1 100644 Binary files a/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.syncinfo.snap and b/.metadata/.plugins/org.eclipse.core.resources/.projects/RemoteSystemsTempFiles/.syncinfo.snap differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/lab2barnestr/.markers.snap b/.metadata/.plugins/org.eclipse.core.resources/.projects/lab2barnestr/.markers.snap deleted file mode 100644 index 907700d..0000000 Binary files a/.metadata/.plugins/org.eclipse.core.resources/.projects/lab2barnestr/.markers.snap and /dev/null differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.projects/lab2barnestr/.syncinfo.snap b/.metadata/.plugins/org.eclipse.core.resources/.projects/lab2barnestr/.syncinfo.snap deleted file mode 100644 index 1253ec8..0000000 Binary files a/.metadata/.plugins/org.eclipse.core.resources/.projects/lab2barnestr/.syncinfo.snap and /dev/null differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap b/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap index 1253ec8..a7ddbe1 100644 Binary files a/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap and b/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap differ diff --git a/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources b/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources index 250d954..ba3f513 100644 Binary files a/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources and b/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources differ diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.cdt.managedbuilder.core.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.cdt.managedbuilder.core.prefs index dc3c685..269ef7c 100644 --- a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.cdt.managedbuilder.core.prefs +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.cdt.managedbuilder.core.prefs @@ -3,3 +3,5 @@ properties/lab1.fr.ac6.managedbuild.target.gnu.cross.exe.1192971440/fr.ac6.manag properties/lab1.fr.ac6.managedbuild.target.gnu.cross.exe.1192971440/fr.ac6.managedbuild.config.gnu.cross.exe.release.925933083=fr.ac6.managedbuild.tool.gnu.archiver.1025348339\=rebuildState\\\=true\\r\\n\r\nfr.ac6.managedbuild.tool.gnu.cross.c.compiler.835265781\=rebuildState\\\=true\\r\\n\r\nfr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.498742630\=rebuildState\\\=true\\r\\n\r\nfr.ac6.managedbuild.tool.gnu.cross.assembler.exe.release.1772758848\=rebuildState\\\=true\\n\r\nfr.ac6.managedbuild.tool.gnu.cross.assembler.576856215\=rebuildState\\\=true\\r\\n\r\nfr.ac6.managedbuild.tool.gnu.cross.cpp.linker.95359918\=rebuildState\\\=true\\r\\n\r\nfr.ac6.managedbuild.tool.gnu.cross.c.linker.844916587\=rebuildState\\\=true\\r\\n\r\nfr.ac6.managedbuild.toolchain.gnu.cross.exe.release.564071875\=rebuildState\\\=true\\r\\n\r\n properties/lab2barnestr.fr.ac6.managedbuild.target.gnu.cross.exe.1174025590/fr.ac6.managedbuild.config.gnu.cross.exe.debug.11763558=fr.ac6.managedbuild.config.gnu.cross.exe.debug.11763558\=rcState\\\=0\\r\\nrebuildState\\\=false\\r\\n\r\nfr.ac6.managedbuild.tool.gnu.cross.assembler.1746477406\=rebuildState\\\=false\\r\\n\r\nfr.ac6.managedbuild.toolchain.gnu.cross.exe.debug.631093406\=rebuildState\\\=false\\r\\n\r\nfr.ac6.managedbuild.tool.gnu.cross.cpp.linker.128116748\=rebuildState\\\=false\\r\\n\r\nfr.ac6.managedbuild.tool.gnu.cross.c.linker.298219195\=rebuildState\\\=false\\r\\n\r\nfr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.690883611\=rebuildState\\\=false\\r\\n\r\nfr.ac6.managedbuild.tool.gnu.archiver.686065332\=rebuildState\\\=false\\r\\n\r\nfr.ac6.managedbuild.tool.gnu.cross.c.compiler.2058797713\=rebuildState\\\=false\\r\\n\r\n properties/lab2barnestr.fr.ac6.managedbuild.target.gnu.cross.exe.1174025590/fr.ac6.managedbuild.config.gnu.cross.exe.release.140736848=fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.307366098\=rebuildState\\\=true\\r\\n\r\nfr.ac6.managedbuild.tool.gnu.cross.c.linker.1951970545\=rebuildState\\\=true\\r\\n\r\nfr.ac6.managedbuild.tool.gnu.cross.assembler.99227971\=rebuildState\\\=true\\r\\n\r\nfr.ac6.managedbuild.tool.gnu.archiver.601562494\=rebuildState\\\=true\\r\\n\r\nfr.ac6.managedbuild.toolchain.gnu.cross.exe.release.1293047718\=rebuildState\\\=true\\r\\n\r\nfr.ac6.managedbuild.tool.gnu.cross.c.compiler.1483905831\=rebuildState\\\=true\\r\\n\r\nfr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.1958708202\=rebuildState\\\=true\\r\\n\r\n +properties/lab3subroutines.fr.ac6.managedbuild.target.gnu.cross.exe.1768735855/fr.ac6.managedbuild.config.gnu.cross.exe.debug.768449004=fr.ac6.managedbuild.tool.gnu.archiver.1417545457\=rebuildState\\\=false\\r\\n\r\nfr.ac6.managedbuild.tool.gnu.cross.assembler.692591045\=rebuildState\\\=false\\r\\n\r\nfr.ac6.managedbuild.tool.gnu.cross.c.linker.2095043366\=rebuildState\\\=false\\r\\n\r\nfr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.481196454\=rebuildState\\\=false\\r\\n\r\nfr.ac6.managedbuild.tool.gnu.cross.c.compiler.475685930\=rebuildState\\\=false\\r\\n\r\nfr.ac6.managedbuild.config.gnu.cross.exe.debug.768449004\=rcState\\\=0\\r\\nrebuildState\\\=false\\r\\n\r\nfr.ac6.managedbuild.toolchain.gnu.cross.exe.debug.1653233822\=rebuildState\\\=false\\r\\n\r\nfr.ac6.managedbuild.tool.gnu.cross.cpp.linker.932312095\=rebuildState\\\=false\\r\\n\r\n +properties/lab3subroutines.fr.ac6.managedbuild.target.gnu.cross.exe.1768735855/fr.ac6.managedbuild.config.gnu.cross.exe.release.1249662564=fr.ac6.managedbuild.tool.gnu.cross.cpp.linker.1663753544\=rebuildState\\\=true\\r\\n\r\nfr.ac6.managedbuild.tool.gnu.cross.assembler.1496240951\=rebuildState\\\=true\\r\\n\r\nfr.ac6.managedbuild.tool.gnu.cross.c.compiler.299769065\=rebuildState\\\=true\\r\\n\r\nfr.ac6.managedbuild.toolchain.gnu.cross.exe.release.568133727\=rebuildState\\\=true\\r\\n\r\nfr.ac6.managedbuild.tool.gnu.cross.c.linker.1835544768\=rebuildState\\\=true\\r\\n\r\nfr.ac6.managedbuild.tool.gnu.archiver.534290351\=rebuildState\\\=true\\r\\n\r\nfr.ac6.managedbuild.tool.gnu.cross.cpp.compiler.1801216189\=rebuildState\\\=true\\r\\n\r\n diff --git a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.launchbar.core.prefs b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.launchbar.core.prefs index 58c8796..3be0243 100644 --- a/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.launchbar.core.prefs +++ b/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.launchbar.core.prefs @@ -4,4 +4,4 @@ configDescList=org.eclipse.launchbar.core.descriptorType.default\:lab1 Debug,org eclipse.preferences.version=1 org.eclipse.launchbar.core.descriptorType.default\:lab1\ Debug/activeLaunchMode=run org.eclipse.launchbar.core.descriptorType.default\:lab1\ Debug/activeLaunchTarget=org.eclipse.launchbar.core.launchTargetType.local\:Local -org.eclipse.launchbar.core.descriptorType.default\:lab2barnestr\ Debug/activeLaunchMode=debug +org.eclipse.launchbar.core.descriptorType.default\:lab2barnestr\ Debug/activeLaunchMode=run diff --git a/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi b/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi index 20577a6..0852ad8 100644 --- a/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi +++ b/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi @@ -1,9 +1,9 @@ - - + + activeSchemeId:org.eclipse.ui.defaultAcceleratorConfiguration ModelMigrationProcessor.001 - + @@ -11,9 +11,9 @@ topLevel - - - + + + persp.actionSet:org.eclipse.mylyn.doc.actionSet persp.actionSet:org.eclipse.mylyn.tasks.ui.navigation @@ -70,36 +70,35 @@ persp.actionSet:org.eclipse.debug.ui.profileActionSet persp.viewSC:org.eclipse.mylyn.tasks.ui.views.tasks persp.newWizSC:org.eclipse.mylyn.tasks.ui.wizards.new.repository.task - - - - - - + + + noFocus + + + + - - - - - - - + + + + + + + - + Debug - active - noFocus - - - - - + + + + + - + persp.actionSet:org.eclipse.mylyn.doc.actionSet persp.actionSet:org.eclipse.mylyn.tasks.ui.navigation @@ -139,2947 +138,2975 @@ persp.viewSC:org.eclipse.pde.runtime.LogView persp.showIn:org.eclipse.egit.ui.RepositoriesView persp.perspSC:org.eclipse.wst.xml.ui.perspective - - - - - + + + + + org.eclipse.e4.primaryNavigationStack - - + + - - + + - - - - - - - - + + + + + + + + - - - + + + org.eclipse.e4.secondaryNavigationStack - - + + - + org.eclipse.e4.secondaryDataStack Debug - - - - - - - - - + + + + + + + + + - - - - + + + + - + View categoryTag:Help - + View categoryTag:General - + ViewMenu menuContribution:menu - + - + View categoryTag:Help - - + + org.eclipse.e4.primaryDataStack EditorStack - - + active + noFocus + + Editor org.eclipse.cdt.ui.editor.asm.AsmEditor removeOnHide - + active + menuContribution:popup popup:#ASMEditorContext popup:org.eclipse.cdt.ui.editor.asm.AsmEditor.EditorContext popup:#AbstractTextEditorContext - + menuContribution:popup popup:#ASMEditorRulerContext popup:org.eclipse.cdt.ui.editor.asm.AsmEditor.RulerContext popup:#AbstractTextEditorRulerContext - + menuContribution:popup popup:#OverviewRulerContext - - + + Editor org.eclipse.cdt.ui.editor.asm.AsmEditor removeOnHide - + menuContribution:popup popup:#ASMEditorContext popup:org.eclipse.cdt.ui.editor.asm.AsmEditor.EditorContext popup:#AbstractTextEditorContext - + menuContribution:popup popup:#ASMEditorRulerContext popup:org.eclipse.cdt.ui.editor.asm.AsmEditor.RulerContext popup:#AbstractTextEditorRulerContext - + + menuContribution:popup + popup:#OverviewRulerContext + + + + + Editor + org.eclipse.cdt.ui.editor.asm.AsmEditor + removeOnHide + + menuContribution:popup + popup:#ASMEditorContext + popup:org.eclipse.cdt.ui.editor.asm.AsmEditor.EditorContext + popup:#AbstractTextEditorContext + + + menuContribution:popup + popup:#ASMEditorRulerContext + popup:org.eclipse.cdt.ui.editor.asm.AsmEditor.RulerContext + popup:#AbstractTextEditorRulerContext + + menuContribution:popup popup:#OverviewRulerContext - + View categoryTag:General - + ViewMenu menuContribution:menu - + menuContribution:popup popup:org.eclipse.ui.navigator.ProjectExplorer#PopupMenu - + menuContribution:popup popup:org.eclipse.ui.navigator.ProjectExplorer#PopupMenu - + menuContribution:popup popup:org.eclipse.ui.navigator.ProjectExplorer#PopupMenu - + - + View categoryTag:C/C++ - + View categoryTag:General - + View categoryTag:General - + - + View categoryTag:General - + ViewMenu menuContribution:menu - + menuContribution:popup popup:org.eclipse.ui.views.ProblemView popup:org.eclipse.ui.ide.MarkersView - + menuContribution:popup popup:org.eclipse.ui.views.ProblemView popup:org.eclipse.ui.ide.MarkersView - + menuContribution:popup popup:org.eclipse.ui.views.ProblemView popup:org.eclipse.ui.ide.MarkersView - + - + View categoryTag:General - + ViewMenu menuContribution:menu - + - + View categoryTag:General - active - + ViewMenu menuContribution:menu - + menuContribution:popup popup:org.eclipse.cdt.ui.CDTGlobalBuildConsole - + menuContribution:popup popup:org.eclipse.cdt.ui.CDTBuildConsole - + menuContribution:popup popup:org.eclipse.cdt.ui.CDTGlobalBuildConsole - + menuContribution:popup popup:org.eclipse.cdt.ui.CDTBuildConsole - + - + View categoryTag:General - + View categoryTag:General - + ViewMenu menuContribution:menu - + menuContribution:popup popup:#ASMOutlineContext - + menuContribution:popup popup:#ASMOutlineContext - + menuContribution:popup popup:#ASMOutlineContext - + + menuContribution:popup + popup:#ASMOutlineContext + + - + View categoryTag:Make - + View categoryTag:Mylyn - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + menuContribution:popup popup:org.eclipse.debug.ui.DebugView - + menuContribution:popup popup:org.eclipse.debug.ui.DebugView - + menuContribution:popup popup:org.eclipse.debug.ui.DebugView - + menuContribution:popup popup:org.eclipse.debug.ui.DebugView - + - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + menuContribution:popup popup:org.eclipse.debug.ui.VariableView.detail - + menuContribution:popup popup:org.eclipse.debug.ui.VariableView - + menuContribution:popup popup:org.eclipse.debug.ui.VariableView.detail - + menuContribution:popup popup:org.eclipse.debug.ui.VariableView - + - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + menuContribution:popup popup:org.eclipse.debug.ui.VariableView.detail - + menuContribution:popup popup:org.eclipse.debug.ui.BreakpointView - + menuContribution:popup popup:org.eclipse.debug.ui.VariableView.detail - + menuContribution:popup popup:org.eclipse.debug.ui.BreakpointView - + - + View categoryTag:Debug - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + menuContribution:popup popup:org.eclipse.debug.ui.VariableView.detail - + menuContribution:popup popup:org.eclipse.debug.ui.RegisterView - + - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + - + View categoryTag:Debug - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + menuContribution:popup popup:org.eclipse.debug.ui.VariableView.detail - + menuContribution:popup popup:org.eclipse.debug.ui.ModuleView - + - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + ViewMenu menuContribution:menu - + menuContribution:popup popup:org.eclipse.debug.ui.MemoryView.MemoryBlocksTreeViewPane - + - - + + toolbarSeparator - + - + Draggable - + Opaque - + Opaque - + Opaque - + Opaque - + Opaque - + Opaque - + Opaque - - + + Opaque - + Opaque - + Opaque - + Opaque - + Opaque - + Opaque - + Opaque - + toolbarSeparator - + - + Draggable - + Opaque - + Opaque - + Opaque - + Opaque - + Opaque - + Draggable - + Opaque - + Opaque - + Opaque - + Opaque - + Opaque - + Draggable - + Opaque - + Opaque - + Opaque - + Opaque - + Draggable - + Opaque - + Opaque - + Opaque - + Opaque - + Opaque - + toolbarSeparator - + - + Draggable - + Opaque - + Opaque - + Opaque - + Opaque - + Opaque - - + + Opaque - + Opaque - + Opaque - + Draggable - + toolbarSeparator - + - + toolbarSeparator - + - + Draggable - + Opaque - + Opaque - + stretch SHOW_RESTORE_MENU - + Draggable HIDEABLE SHOW_RESTORE_MENU - - + + stretch - + Draggable - + Draggable - - + + TrimStack Draggable - + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + platform:cocoa - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + platform:win32 - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - + + + - - + + - - - - + + + + - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + platform:cocoa - + platform:cocoa - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + - - - - - + + + + + platform:cocoa - + platform:cocoa - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - + + + - - - - - - - + + + + + + + - - - - + + + + - - - - - - - - + + + + + + + + - - - - + + + + platform:cocoa - - - - - - + + + + + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - - + + + - - - + + + - - - - - - + + + + + + - - - - - - + + + + + + - - + + - - + + platform:win32 - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - + - - - - - - - - - + + + + + + + + + - - - - - + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Editor - + View categoryTag:Debug - + View categoryTag:C/C++ - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Make - + View categoryTag:C/C++ - + View categoryTag:C/C++ - + View categoryTag:C/C++ - + View categoryTag:C/C++ - + View categoryTag:C/C++ - + View categoryTag:General - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Debug - + View categoryTag:Git - + View categoryTag:Git - + View categoryTag:Git - + View categoryTag:Git - + View categoryTag:Git - + View categoryTag:General - + View categoryTag:Help - + View categoryTag:Charts - + View categoryTag:Profiling - + View categoryTag:Profiling - + View categoryTag:Profiling - + View categoryTag:Maven - + View categoryTag:Maven - + View categoryTag:Mylyn - + View categoryTag:Mylyn - + View categoryTag:Mylyn - + View categoryTag:Oomph - + View categoryTag:Connections - + View categoryTag:Remote Systems - + View categoryTag:Remote Systems - + View categoryTag:Remote Systems - + View categoryTag:Remote Systems - + View categoryTag:Remote Systems - + View categoryTag:Remote Systems - + View categoryTag:Remote Systems - + View categoryTag:General - + View categoryTag:General - + View categoryTag:SVN - + View categoryTag:SVN - + View categoryTag:SVN - + View categoryTag:SVN - + View categoryTag:SVN - + View categoryTag:Team - + View categoryTag:Team - + View categoryTag:LTTng - + View categoryTag:Tracing - + View categoryTag:LTTng - + View categoryTag:LTTng - + View categoryTag:LTTng - + View categoryTag:LTTng - + View categoryTag:LTTng - + View categoryTag:LTTng - + View categoryTag:LTTng - + View categoryTag:LTTng - + View categoryTag:LTTng - + View categoryTag:Tracing - + View categoryTag:Tracing - + View categoryTag:Tracing - + View categoryTag:LTTng - + View categoryTag:Tracing - + View categoryTag:LTTng - + View categoryTag:LTTng - + View categoryTag:LTTng - + View categoryTag:Tracing - + View categoryTag:Tracing - + View categoryTag:Tracing - + View categoryTag:Tracing - + View categoryTag:Tracing - + View categoryTag:Tracing - + View categoryTag:Tracing - + View categoryTag:Tracing - + View categoryTag:Tracing - + View categoryTag:Tracing - + View categoryTag:Tracing - + View categoryTag:Tracing - + View categoryTag:Tracing - + View categoryTag:General - + View categoryTag:General - + View categoryTag:Help - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:General - + View categoryTag:XML - + View categoryTag:XML - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - + + + + + - - + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.metadata/.plugins/org.eclipse.wst.sse.core/task-tags.properties b/.metadata/.plugins/org.eclipse.wst.sse.core/task-tags.properties index fb50ea9..ce466a3 100644 --- a/.metadata/.plugins/org.eclipse.wst.sse.core/task-tags.properties +++ b/.metadata/.plugins/org.eclipse.wst.sse.core/task-tags.properties @@ -1,3 +1,3 @@ # -#Wed Sep 25 14:59:33 CDT 2019 -task-tag-projects-already-scanned=lab2barnestr,RemoteSystemsTempFiles +#Tue Oct 01 15:50:39 CDT 2019 +task-tag-projects-already-scanned=lab3subroutines,RemoteSystemsTempFiles diff --git a/lab3subroutines/.cproject b/lab3subroutines/.cproject new file mode 100644 index 0000000..3b85412 --- /dev/null +++ b/lab3subroutines/.cproject @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lab3subroutines/.gitignore b/lab3subroutines/.gitignore new file mode 100644 index 0000000..3df573f --- /dev/null +++ b/lab3subroutines/.gitignore @@ -0,0 +1 @@ +/Debug/ diff --git a/lab3subroutines/.project b/lab3subroutines/.project new file mode 100644 index 0000000..b097401 --- /dev/null +++ b/lab3subroutines/.project @@ -0,0 +1,28 @@ + + + lab3subroutines + + + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + fr.ac6.mcu.ide.core.MCUProjectNature + fr.ac6.mcu.ide.core.MCUSingleCoreProjectNature + + diff --git a/lab3subroutines/.settings/language.settings.xml b/lab3subroutines/.settings/language.settings.xml new file mode 100644 index 0000000..1216802 --- /dev/null +++ b/lab3subroutines/.settings/language.settings.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lab3subroutines/LinkerScript.ld b/lab3subroutines/LinkerScript.ld new file mode 100644 index 0000000..bf8b04d --- /dev/null +++ b/lab3subroutines/LinkerScript.ld @@ -0,0 +1,202 @@ +/* +****************************************************************************** +** +** File : LinkerScript.ld +** +** Author : Auto-generated by Ac6 System Workbench +** +** Abstract : Linker script for STM32F446RETx Device from STM32F4 series +** 128Kbytes RAM +** 512Kbytes ROM +** +** Set heap size, stack size and stack location according +** to application requirements. +** +** Set memory bank area and size if external memory is used. +** +** Target : STMicroelectronics STM32 +** +** Distribution: The file is distributed “as is,” without any warranty +** of any kind. +** +***************************************************************************** +** @attention +** +**

© COPYRIGHT(c) 2019 Ac6

+** +** Redistribution and use in source and binary forms, with or without modification, +** are permitted provided that the following conditions are met: +** 1. Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** 2. Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** 3. Neither the name of Ac6 nor the names of its contributors +** may be used to endorse or promote products derived from this software +** without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +** +***************************************************************************** +*/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = 0x20020000; /* end of RAM */ + +_Min_Heap_Size = 0; /* required amount of heap */ +_Min_Stack_Size = 0x400; /* required amount of stack */ + +/* Memories definition */ +MEMORY +{ + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K + ROM (rx) : ORIGIN = 0x8000000, LENGTH = 512K +} + +/* Sections */ +SECTIONS +{ + /* The startup code into ROM memory */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >ROM + + /* The program code and other data into ROM memory */ + .text : + { + . = ALIGN(4); + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* define a global symbols at end of code */ + } >ROM + + /* Constant data into ROM memory*/ + .rodata : + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >ROM + + .ARM.extab : { + . = ALIGN(4); + *(.ARM.extab* .gnu.linkonce.armextab.*) + . = ALIGN(4); + } >ROM + + .ARM : { + . = ALIGN(4); + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + . = ALIGN(4); + } >ROM + + .preinit_array : + { + . = ALIGN(4); + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + . = ALIGN(4); + } >ROM + + .init_array : + { + . = ALIGN(4); + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + . = ALIGN(4); + } >ROM + + .fini_array : + { + . = ALIGN(4); + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + . = ALIGN(4); + } >ROM + + /* Used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections into RAM memory */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + } >RAM AT> ROM + + + /* Uninitialized data section into RAM memory */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss secion */ + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } >RAM + + /* User_heap_stack section, used to check that there is enough RAM left */ + ._user_heap_stack : + { + . = ALIGN(8); + PROVIDE ( end = . ); + PROVIDE ( _end = . ); + . = . + _Min_Heap_Size; + . = . + _Min_Stack_Size; + . = ALIGN(8); + } >RAM + + + + /* Remove information from the compiler libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } +} diff --git a/lab3subroutines/NUCLEO-F446RE.xml b/lab3subroutines/NUCLEO-F446RE.xml new file mode 100644 index 0000000..66d192e --- /dev/null +++ b/lab3subroutines/NUCLEO-F446RE.xml @@ -0,0 +1,20 @@ + + + + + + + + +]> + + + + NUCLEO-F446RE + JTAG + SWD + ST-Link + stm32f446retx + + diff --git a/lab3subroutines/src/gpio.s b/lab3subroutines/src/gpio.s new file mode 100644 index 0000000..c7ed670 --- /dev/null +++ b/lab3subroutines/src/gpio.s @@ -0,0 +1,9 @@ +# gpio.s +# Trevor Barnes +# CE2801-031 +# Description: A file to handle the GPIO behavior of the Dev Board + +.syntax unified +.cpu cortex-m4 +.thumb +.section .text diff --git a/lab3subroutines/src/led.s b/lab3subroutines/src/led.s new file mode 100644 index 0000000..bd2dc62 --- /dev/null +++ b/lab3subroutines/src/led.s @@ -0,0 +1,25 @@ +# led.s +# Trevor Barnes +# CE2801-031 +# Description: A file for handling the LED pins on the Dev Board + +# Lights are on PB5-PB15 except PB11 + +.syntax unified +.cpu cortex-m4 +.thumb +.section .text + + # Base RCC + .equ RCC_BASE, 0x40023800 + # GPIOB Enable Register + .equ RCC_AHB1ENR, 0x30 + # GPIOB Enable + .equ RCC_GPIOBEN, 1<<1 + + # Base GPIOB Location + .equ GPIOB_BASE, 0x40020400 + # GPIO Mode Register + .equ GPIO_MODER, 0x00 + # GPIO Output Data Register + .equ GPIO_ODR, 0x14 diff --git a/lab3subroutines/src/main.s b/lab3subroutines/src/main.s new file mode 100644 index 0000000..9efa845 --- /dev/null +++ b/lab3subroutines/src/main.s @@ -0,0 +1,15 @@ +# main.s +# Trevor Barnes +# CE2801-031 +# Lab 3: Subroutines +# Description: + +.syntax unified +.cpu cortex-m4 +.thumb +.section .text + +.global main + +main: + diff --git a/lab3subroutines/startup/startup_stm32.s b/lab3subroutines/startup/startup_stm32.s new file mode 100644 index 0000000..5059db2 --- /dev/null +++ b/lab3subroutines/startup/startup_stm32.s @@ -0,0 +1,246 @@ +/** + ****************************************************************************** + * @file startup_stm32.s + * @author Ac6 + * @version V1.0.0 + * @date 12-June-2014 + ****************************************************************************** + */ + + .syntax unified + .cpu cortex-m4 + .thumb + +.global g_pfnVectors +.global Default_Handler + +/* start address for the initialization values of the .data section. +defined in linker script */ +.word _sidata +/* start address for the .data section. defined in linker script */ +.word _sdata +/* end address for the .data section. defined in linker script */ +.word _edata +/* start address for the .bss section. defined in linker script */ +.word _sbss +/* end address for the .bss section. defined in linker script */ +.word _ebss + +.equ BootRAM, 0xF1E0F85F +/** + * @brief This is the code that gets called when the processor first + * starts execution following a reset event. Only the absolutely + * necessary set is performed, after which the application + * supplied main() routine is called. + * @param None + * @retval : None +*/ + + .section .text.Reset_Handler + .weak Reset_Handler + .type Reset_Handler, %function +Reset_Handler: + +/* Copy the data segment initializers from flash to SRAM */ + movs r1, #0 + b LoopCopyDataInit + +CopyDataInit: + ldr r3, =_sidata + ldr r3, [r3, r1] + str r3, [r0, r1] + adds r1, r1, #4 + +LoopCopyDataInit: + ldr r0, =_sdata + ldr r3, =_edata + adds r2, r0, r1 + cmp r2, r3 + bcc CopyDataInit + ldr r2, =_sbss + b LoopFillZerobss +/* Zero fill the bss segment. */ +FillZerobss: + movs r3, #0 + str r3, [r2] + adds r2, r2, #4 + +LoopFillZerobss: + ldr r3, = _ebss + cmp r2, r3 + bcc FillZerobss + +/* Call the clock system intitialization function.*/ + bl SystemInit +/* Call static constructors */ + bl __libc_init_array +/* Call the application's entry point.*/ + bl main + +LoopForever: + b LoopForever + +.size Reset_Handler, .-Reset_Handler + +/** + * @brief This is the code that gets called when the processor receives an + * unexpected interrupt. This simply enters an infinite loop, preserving + * the system state for examination by a debugger. + * + * @param None + * @retval : None +*/ + .section .text.Default_Handler,"ax",%progbits +Default_Handler: +Infinite_Loop: + b Infinite_Loop + .size Default_Handler, .-Default_Handler +/****************************************************************************** +* +* The minimal vector table for a Cortex-M. Note that the proper constructs +* must be placed on this to ensure that it ends up at physical address +* 0x0000.0000. +* +******************************************************************************/ + .section .isr_vector,"a",%progbits + .type g_pfnVectors, %object + .size g_pfnVectors, .-g_pfnVectors + +g_pfnVectors: + .word _estack + .word Reset_Handler + .word NMI_Handler + .word HardFault_Handler + .word MemManage_Handler + .word BusFault_Handler + .word UsageFault_Handler + .word 0 + .word 0 + .word 0 + .word 0 + .word SVC_Handler + .word DebugMon_Handler + .word 0 + .word PendSV_Handler + .word SysTick_Handler + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + .word 0 + +/******************************************************************************* +* +* Provide weak aliases for each Exception handler to the Default_Handler. +* As they are weak aliases, any function with the same name will override +* this definition. +* +*******************************************************************************/ + + .weak NMI_Handler + .thumb_set NMI_Handler,Default_Handler + + .weak HardFault_Handler + .thumb_set HardFault_Handler,Default_Handler + + .weak MemManage_Handler + .thumb_set MemManage_Handler,Default_Handler + + .weak BusFault_Handler + .thumb_set BusFault_Handler,Default_Handler + + .weak UsageFault_Handler + .thumb_set UsageFault_Handler,Default_Handler + + .weak SVC_Handler + .thumb_set SVC_Handler,Default_Handler + + .weak DebugMon_Handler + .thumb_set DebugMon_Handler,Default_Handler + + .weak PendSV_Handler + .thumb_set PendSV_Handler,Default_Handler + + .weak SysTick_Handler + .thumb_set SysTick_Handler,Default_Handler + + .weak SystemInit + +/************************ (C) COPYRIGHT Ac6 *****END OF FILE****/ diff --git a/lab3subroutines/startup/sysmem.c b/lab3subroutines/startup/sysmem.c new file mode 100644 index 0000000..f81d74c --- /dev/null +++ b/lab3subroutines/startup/sysmem.c @@ -0,0 +1,82 @@ +/** +***************************************************************************** +** +** File : sysmem.c +** +** Author : Ac6 +** +** Abstract : System Workbench Minimal System Memory calls file +** +** For more information about which c-functions +** need which of these lowlevel functions +** please consult the Newlib libc-manual +** +** Environment : System Workbench for MCU +** +** Distribution: The file is distributed “as is,” without any warranty +** of any kind. +** +***************************************************************************** +** +**

© COPYRIGHT(c) 2014 Ac6

+** +** Redistribution and use in source and binary forms, with or without modification, +** are permitted provided that the following conditions are met: +** 1. Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** 2. Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** 3. Neither the name of Ac6 nor the names of its contributors +** may be used to endorse or promote products derived from this software +** without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +** +***************************************************************************** +*/ + +/* Includes */ +#include +#include + +/* Variables */ +extern int errno; +register char * stack_ptr asm("sp"); + +/* Functions */ + +/** + _sbrk + Increase program data space. Malloc and related functions depend on this +**/ +caddr_t _sbrk(int incr) +{ + extern char end asm("end"); + static char *heap_end; + char *prev_heap_end; + + if (heap_end == 0) + heap_end = &end; + + prev_heap_end = heap_end; + if (heap_end + incr > stack_ptr) + { + errno = ENOMEM; + return (caddr_t) -1; + } + + heap_end += incr; + + return (caddr_t) prev_heap_end; +} +