Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
labs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Emil Kitti
labs
Commits
3c6aef08
Commit
3c6aef08
authored
7 years ago
by
Per
Browse files
Options
Downloads
Patches
Plain Diff
bare1
parent
0ec969ef
No related branches found
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
.settings/com.github.rustdt.ide.core.prefs
+1
-1
1 addition, 1 deletion
.settings/com.github.rustdt.ide.core.prefs
examples/bare1.rs
+60
-6
60 additions, 6 deletions
examples/bare1.rs
l
+1
-0
1 addition, 0 deletions
l
r
+3
-1
3 additions, 1 deletion
r
rtfm-app Debug.launch
+0
-52
0 additions, 52 deletions
rtfm-app Debug.launch
with
65 additions
and
60 deletions
.settings/com.github.rustdt.ide.core.prefs
+
1
−
1
View file @
3c6aef08
build_targets=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\n<build_targets xmlns\="com.github.rustdt.ide.core">\n<target auto_enabled\="false" config\="build" n_enabled\="false" version2\="true">\n<command_invocation append_env\="true" command_arguments\=" xargo build --example bare0&\#10;">\n<env_vars/>\n</command_invocation>\n</target>\n<target auto_enabled\="
tru
e" config\="check" n_enabled\="false" version2\="true">\n<command_invocation append_env\="true" command_arguments\="xargo build --example bare0&\#10;">\n<env_vars/>\n</command_invocation>\n</target>\n<target auto_enabled\="false" config\="clean" n_enabled\="false" version2\="true"/>\n</build_targets>\n
build_targets=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\n<build_targets xmlns\="com.github.rustdt.ide.core">\n<target auto_enabled\="false" config\="build" n_enabled\="false" version2\="true">\n<command_invocation append_env\="true" command_arguments\=" xargo build --example bare0&\#10;">\n<env_vars/>\n</command_invocation>\n</target>\n<target auto_enabled\="
fals
e" config\="check" n_enabled\="false" version2\="true">\n<command_invocation append_env\="true" command_arguments\="xargo build --example bare0&\#10;">\n<env_vars/>\n</command_invocation>\n</target>\n<target auto_enabled\="false" config\="clean" n_enabled\="false" version2\="true"/>\n</build_targets>\n
eclipse.preferences.version=1
eclipse.preferences.version=1
format_onSave=true
format_onSave=true
racer_path=/home/pln/.cargo/bin/racer
racer_path=/home/pln/.cargo/bin/racer
...
...
This diff is collapsed.
Click to expand it.
examples/bare1.rs
+
60
−
6
View file @
3c6aef08
//! bare1.rs
//! bare1.rs
//! Simple bare metal
application
//! Simple bare metal
tracing
// feature to ensure symbols to be linked
// feature to ensure symbols to be linked
#![feature(used)]
#![feature(used)]
...
@@ -7,30 +7,84 @@
...
@@ -7,30 +7,84 @@
#![no_std]
#![no_std]
// API to the ARM Cortex M Peripherals
// API to the ARM Cortex M Peripherals
//
extern crate cortex_m;
extern
crate
cortex_m
;
// Minimal runtime / startup for Cortex-M microcontrollers
// Minimal runtime / startup for Cortex-M microcontrollers
extern
crate
cortex_m_rt
;
extern
crate
cortex_m_rt
;
// Convenient tracing over semihosting and ITM
// Convenient tracing over semihosting and ITM
//
#[macro_use]
#[macro_use]
//
extern crate cortex_m_debug;
extern
crate
cortex_m_debug
;
#[inline(never)]
#[inline(never)]
fn
main
()
{
fn
main
()
{
// ITM trace (fast)
// ITM trace (fast)
// start `itmdump` before `openocd`
// start `itmdump` before `openocd`
//
ipln!("ITM: Hello World");
ipln!
(
"ITM: Hello World"
);
// semihosting trace (slow)
// semihosting trace (slow)
//
sprintln!("SEMIHOSTING: Hello World");
sprintln!
(
"SEMIHOSTING: Hello World"
);
// to prevent returning
// to prevent returning
loop
{
loop
{
// cortex_m::asm::nop();
// cortex_m::asm::nop();
// cortex_m::asm::bkpt();
}
}
}
}
// 1. build and run the application
// start ITM tracing to console
// > itmdump /tmp/itm.log
// start openocd (in my case...)
// > openocd -f interface/stlink.cfg -f target/stm32f4x.cfg
//
// when debugging the application it should get stuck in the
// loop, (press pause/suspend to verify this).
// what is the output in the ITM console
// ** your answer here **
//
// what is the output in the semihosting (openocd) console
// ** your answer here **
//
// commit your answers (bare1_1)
//
// 2. inspecting the assembly
// what is shown in the Dissasmbly view, what instruction is executing
// (if you are NOT under eclipse, then give the command in gdb console
// (gdb) disassemble
// ** your answer here **
//
// commit your answers (bare1_2)
//
// 3. now remove the comment line 30.
// rebuild and debug, pause the program.
// what is shown in the Dissasmbly view, what instruction is executing
// ** your answer here **
//
// commit your answers (bare1_3)
//
// 4. now remeve the comment line 31
// what is shown in the Dissasmbly view, what instruction is executing
// ** your answer here **
//
// commit your answers (bare1_4)
//
// 5. release mode (optimized builds)
// rebuild bare1 in release (optimized mode)
// compare the generated assembly for the loop
// between the dev (unoptimized) and release (optimized) build
// in Atollic/eclipse the easiest way is to build the target using
// > xargo build --release --examples
// in gdb console
// > file target/thumbv7em-none-eabihf/release/examples/bare1
// so l
// (which sources/executes the gbd script l, which loads the file)
// c
// (to continue executing)
// ** your answer here **
//
// commit your answers (bare1_5)
// As we are not using interrupts, we just register a dummy catch all handler
// As we are not using interrupts, we just register a dummy catch all handler
#[link_section
=
".vector_table.interrupts"
]
#[link_section
=
".vector_table.interrupts"
]
#[used]
#[used]
...
...
This diff is collapsed.
Click to expand it.
l
0 → 100644
+
1
−
0
View file @
3c6aef08
monitor reset init
\ No newline at end of file
This diff is collapsed.
Click to expand it.
r
+
3
−
1
View file @
3c6aef08
monitor reset init
monitor reset init
load
monitor reset init
This diff is collapsed.
Click to expand it.
rtfm-app Debug.launch
deleted
100644 → 0
+
0
−
52
View file @
0ec969ef
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration
type=
"com.atollic.hardwaredebug.launch.launchConfigurationType"
>
<stringAttribute
key=
"com.atollic.hardwaredebug.jlink_common.cpu_core"
value=
"Cortex-M"
/>
<stringAttribute
key=
"com.atollic.hardwaredebug.jlink_common.device"
value=
"STM32F401RE"
/>
<stringAttribute
key=
"com.atollic.hardwaredebug.jlink_common.endian"
value=
"little"
/>
<stringAttribute
key=
"com.atollic.hardwaredebug.jlink_common.init_speed"
value=
"4000"
/>
<booleanAttribute
key=
"com.atollic.hardwaredebug.jlink_common.jlink_check_serial_number"
value=
"false"
/>
<stringAttribute
key=
"com.atollic.hardwaredebug.jlink_common.jlink_script_path"
value=
""
/>
<booleanAttribute
key=
"com.atollic.hardwaredebug.jlink_common.jlink_script_used"
value=
"false"
/>
<stringAttribute
key=
"com.atollic.hardwaredebug.jlink_common.jlink_trace_port_cfg_path"
value=
"/opt/truestudio/ide/plugins/com.atollic.truestudio.tsp.stm32_1.0.0.20171023-2304/tsp/etm/stm32f4xx.init"
/>
<stringAttribute
key=
"com.atollic.hardwaredebug.jlink_common.jlink_txt_serial_number"
value=
""
/>
<booleanAttribute
key=
"com.atollic.hardwaredebug.jlink_common.scan_chain_auto"
value=
"true"
/>
<intAttribute
key=
"com.atollic.hardwaredebug.jlink_common.scan_chain_irpre"
value=
"0"
/>
<intAttribute
key=
"com.atollic.hardwaredebug.jlink_common.scan_chain_pos"
value=
"0"
/>
<stringAttribute
key=
"com.atollic.hardwaredebug.jlink_common.selected_rtos"
value=
"No RTOS"
/>
<intAttribute
key=
"com.atollic.hardwaredebug.launch.formatVersion"
value=
"2"
/>
<stringAttribute
key=
"com.atollic.hardwaredebug.launch.hwinitCommands"
value=
"# Initialize your hardware here "
/>
<stringAttribute
key=
"com.atollic.hardwaredebug.launch.ipAddress"
value=
"localhost"
/>
<stringAttribute
key=
"com.atollic.hardwaredebug.launch.jtagDevice"
value=
"OpenOCD"
/>
<intAttribute
key=
"com.atollic.hardwaredebug.launch.portNumber"
value=
"3333"
/>
<stringAttribute
key=
"com.atollic.hardwaredebug.launch.remoteCommand"
value=
"target remote"
/>
<stringAttribute
key=
"com.atollic.hardwaredebug.launch.runCommands"
value=
"# Load the program executable load # Set a breakpoint at main(). #tbreak main # Run to the breakpoint. continue"
/>
<stringAttribute
key=
"com.atollic.hardwaredebug.launch.serverParam"
value=
""
/>
<booleanAttribute
key=
"com.atollic.hardwaredebug.launch.startServer"
value=
"false"
/>
<booleanAttribute
key=
"com.atollic.hardwaredebug.launch.swd_mode"
value=
"false"
/>
<stringAttribute
key=
"com.atollic.hardwaredebug.launch.swv_port"
value=
"2332"
/>
<stringAttribute
key=
"com.atollic.hardwaredebug.launch.swv_trace_div"
value=
"0"
/>
<stringAttribute
key=
"com.atollic.hardwaredebug.launch.swv_trace_hclk"
value=
"16000000"
/>
<intAttribute
key=
"com.atollic.hardwaredebug.launch.trace_system"
value=
"0"
/>
<booleanAttribute
key=
"com.atollic.hardwaredebug.launch.useRemoteTarget"
value=
"true"
/>
<stringAttribute
key=
"com.atollic.hardwaredebug.openocd.server_target"
value=
"remote"
/>
<stringAttribute
key=
"org.eclipse.cdt.dsf.gdb.DEBUG_NAME"
value=
"${TOOLCHAIN_PATH}/arm-atollic-eabi-gdb"
/>
<booleanAttribute
key=
"org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND"
value=
"false"
/>
<intAttribute
key=
"org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR"
value=
"2"
/>
<stringAttribute
key=
"org.eclipse.cdt.launch.COREFILE_PATH"
value=
""
/>
<stringAttribute
key=
"org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS"
value=
""
/>
<stringAttribute
key=
"org.eclipse.cdt.launch.PROGRAM_NAME"
value=
"/home/pln/Atollic/TrueSTUDIO/ARM_workspace_8.1/rtfm-app/target/thumbv7em-none-eabihf/debug/examples/bare0.elf"
/>
<stringAttribute
key=
"org.eclipse.cdt.launch.PROJECT_ATTR"
value=
"rtfm-app"
/>
<booleanAttribute
key=
"org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR"
value=
"false"
/>
<stringAttribute
key=
"org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR"
value=
""
/>
<listAttribute
key=
"org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"
>
<listEntry
value=
"/rtfm-app"
/>
</listAttribute>
<listAttribute
key=
"org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"
>
<listEntry
value=
"4"
/>
</listAttribute>
<listAttribute
key=
"org.eclipse.debug.ui.favoriteGroups"
>
<listEntry
value=
"org.eclipse.debug.ui.launchGroup.debug"
/>
</listAttribute>
<stringAttribute
key=
"org.eclipse.dsf.launch.MEMORY_BLOCKS"
value=
"<?xml version="1.0" encoding="UTF-8" standalone="no"?> <memoryBlockExpressionList context="reserved-for-future-use"/> "
/>
<stringAttribute
key=
"process_factory_id"
value=
"org.eclipse.cdt.dsf.gdb.GdbProcessFactory"
/>
</launchConfiguration>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment