This repository was archived by the owner on Jul 29, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +42
-4
lines changed Expand file tree Collapse file tree 3 files changed +42
-4
lines changed Original file line number Diff line number Diff line change @@ -9,11 +9,13 @@ repository = "https://github.com/japaric/cortex-m-quickstart"
9
9
version = " 0.2.7"
10
10
11
11
[dependencies ]
12
- cortex-m = " 0.4.0"
13
- cortex-m-rt = " 0.4.0"
14
- cortex-m-semihosting = " 0.2.0"
12
+ # cortex-m = "0.4.0"
13
+ # cortex-m-rt = "0.4.0"
14
+ cortex-m-rt = { git = " https://github.com/japaric/cortex-m-rt" , branch = " stable" }
15
+ # cortex-m-semihosting = "0.2.0"
16
+ # panic-loop = { path = "../panic-loop" }
15
17
panic-abort = " 0.1.1"
16
- panic-semihosting = " 0.1.0"
18
+ # panic-semihosting = "0.1.0"
17
19
# Uncomment for the allocator example.
18
20
# alloc-cortex-m = "0.3.3"
19
21
Original file line number Diff line number Diff line change
1
+ #![ no_main] // <- IMPORTANT!
2
+ #![ no_std]
3
+
4
+ #[ macro_use]
5
+ extern crate cortex_m_rt;
6
+ extern crate panic_abort;
7
+
8
+ use core:: ptr;
9
+
10
+ // user entry point
11
+ main ! ( main) ;
12
+
13
+ fn main ( ) -> ! {
14
+ loop {
15
+ unsafe {
16
+ // NOTE side affect to avoid UB
17
+ ptr:: read_volatile ( 0x2000_0000 as * const u32 ) ;
18
+ }
19
+ }
20
+ }
21
+
22
+ // define the default exception handler
23
+ exception ! ( DefaultHandler , deh) ;
24
+
25
+ fn deh ( _nr : u8 ) -> ! {
26
+ loop {
27
+ unsafe {
28
+ // NOTE side affect to avoid UB
29
+ ptr:: read_volatile ( 0x2000_0004 as * const u32 ) ;
30
+ }
31
+ }
32
+ }
33
+
34
+ // bind all interrupts to the default exception handler
35
+ interrupts ! ( DefaultHandler ) ;
Original file line number Diff line number Diff line change
1
+ /* Remove this file if you are linking to a device crate that provides this file */
You can’t perform that action at this time.
0 commit comments