Skip to content

Commit

Permalink
Mutex CNT
Browse files Browse the repository at this point in the history
  • Loading branch information
Guoping Wang committed Mar 29, 2025
0 parents commit 3aadfe8
Show file tree
Hide file tree
Showing 371 changed files with 22,839 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# default runner starts a GDB sesssion, which requires OpenOCD to be
# running, e.g.,
## openocd -s C:\OpenOCD\openocd\scripts -f board/ti_ek-tm4c123gxl.cfg
# depending on your local GDB, pick one of the following
[target.thumbv7em-none-eabihf]
runner = "arm-none-eabi-gdb -q -x openocd.gdb"
rustflags = [
"-C", "link-arg=-Tlink.x",
]
[build]
target = "thumbv7em-none-eabihf"
183 changes: 183 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "tivatest"
version = "0.1.0"
edition = "2021"
build="build.rs"

[dependencies]
cortex-m = "0.7"
cortex-m-rt = {version="0.7",features=["device"]}
tm4c123x = {version="0.9.2", features=["rt"]}
embedded-hal = "0.2"

[dependencies.panic-halt]
version = "0.2"
Binary file added aes.o
Binary file not shown.
34 changes: 34 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
use std::env;
use std::fs::File;
use std::io::Write;
use std::path::PathBuf;

fn main() {
// Put the linker script somewhere the linker can find it
let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap());
File::create(out.join("memory.x"))
.unwrap()
.write_all(include_bytes!("memory.x"))
.unwrap();
println!("cargo:rustc-link-search={}", out.display());

println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-changed=memory.x");
// tell rustc to link with some driverlib library
println!("cargo:rustc-link=gpio");
println!("cargo:rustc-link=uart");
println!("cargo:rustc-link=sysctl");
println!("cargo:rustc-link=systick");
println!("cargo:rustc-link=timer");
println!("cargo:rustc-link=i2c");
println!("cargo:rustc-link=interrupt");
println!("cargo:rustc-link=adc");
println!("cargo:rustc-link=ssi");



// and it should search the Cargo.toml directory for that library
println!("cargo:rustc-link-search={}", std::env::var("CARGO_MANIFEST_DIR").unwrap());
}


Binary file added can.o
Binary file not shown.
Binary file added comp.o
Binary file not shown.
Binary file added cpu.o
Binary file not shown.
Binary file added crc.o
Binary file not shown.
Binary file added des.o
Binary file not shown.
79 changes: 79 additions & 0 deletions device.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
PROVIDE(GPIOA = DefaultHandler);
PROVIDE(GPIOB = DefaultHandler);
PROVIDE(GPIOC = DefaultHandler);
PROVIDE(GPIOD = DefaultHandler);
PROVIDE(GPIOE = DefaultHandler);
PROVIDE(UART0 = DefaultHandler);
PROVIDE(UART1 = DefaultHandler);
PROVIDE(SSI0 = DefaultHandler);
PROVIDE(I2C0 = DefaultHandler);
PROVIDE(PWM0_FAULT = DefaultHandler);
PROVIDE(PWM0_0 = DefaultHandler);
PROVIDE(PWM0_1 = DefaultHandler);
PROVIDE(PWM0_2 = DefaultHandler);
PROVIDE(QEI0 = DefaultHandler);
PROVIDE(ADC0SS0 = DefaultHandler);
PROVIDE(ADC0SS1 = DefaultHandler);
PROVIDE(ADC0SS2 = DefaultHandler);
PROVIDE(ADC0SS3 = DefaultHandler);
PROVIDE(WATCHDOG = DefaultHandler);
PROVIDE(TIMER0A = DefaultHandler);
PROVIDE(TIMER0B = DefaultHandler);
PROVIDE(TIMER1A = DefaultHandler);
PROVIDE(TIMER1B = DefaultHandler);
PROVIDE(TIMER2A = DefaultHandler);
PROVIDE(TIMER2B = DefaultHandler);
PROVIDE(COMP0 = DefaultHandler);
PROVIDE(COMP1 = DefaultHandler);
PROVIDE(SYSCTL = DefaultHandler);
PROVIDE(FLASH = DefaultHandler);
PROVIDE(GPIOF = DefaultHandler);
PROVIDE(UART2 = DefaultHandler);
PROVIDE(SSI1 = DefaultHandler);
PROVIDE(TIMER3A = DefaultHandler);
PROVIDE(TIMER3B = DefaultHandler);
PROVIDE(I2C1 = DefaultHandler);
PROVIDE(QEI1 = DefaultHandler);
PROVIDE(CAN0 = DefaultHandler);
PROVIDE(CAN1 = DefaultHandler);
PROVIDE(HIBERNATE = DefaultHandler);
PROVIDE(USB0 = DefaultHandler);
PROVIDE(PWM0_3 = DefaultHandler);
PROVIDE(UDMA = DefaultHandler);
PROVIDE(UDMAERR = DefaultHandler);
PROVIDE(ADC1SS0 = DefaultHandler);
PROVIDE(ADC1SS1 = DefaultHandler);
PROVIDE(ADC1SS2 = DefaultHandler);
PROVIDE(ADC1SS3 = DefaultHandler);
PROVIDE(SSI2 = DefaultHandler);
PROVIDE(SSI3 = DefaultHandler);
PROVIDE(UART3 = DefaultHandler);
PROVIDE(UART4 = DefaultHandler);
PROVIDE(UART5 = DefaultHandler);
PROVIDE(UART6 = DefaultHandler);
PROVIDE(UART7 = DefaultHandler);
PROVIDE(I2C2 = DefaultHandler);
PROVIDE(I2C3 = DefaultHandler);
PROVIDE(TIMER4A = DefaultHandler);
PROVIDE(TIMER4B = DefaultHandler);
PROVIDE(TIMER5A = DefaultHandler);
PROVIDE(TIMER5B = DefaultHandler);
PROVIDE(WTIMER0A = DefaultHandler);
PROVIDE(WTIMER0B = DefaultHandler);
PROVIDE(WTIMER1A = DefaultHandler);
PROVIDE(WTIMER1B = DefaultHandler);
PROVIDE(WTIMER2A = DefaultHandler);
PROVIDE(WTIMER2B = DefaultHandler);
PROVIDE(WTIMER3A = DefaultHandler);
PROVIDE(WTIMER3B = DefaultHandler);
PROVIDE(WTIMER4A = DefaultHandler);
PROVIDE(WTIMER4B = DefaultHandler);
PROVIDE(WTIMER5A = DefaultHandler);
PROVIDE(WTIMER5B = DefaultHandler);
PROVIDE(SYSEXC = DefaultHandler);
PROVIDE(PWM1_0 = DefaultHandler);
PROVIDE(PWM1_1 = DefaultHandler);
PROVIDE(PWM1_2 = DefaultHandler);
PROVIDE(PWM1_3 = DefaultHandler);
PROVIDE(PWM1_FAULT = DefaultHandler);

Binary file added eeprom.o
Binary file not shown.
Binary file added emac.o
Binary file not shown.
Binary file added epi.o
Binary file not shown.
Binary file added flash.o
Binary file not shown.
Binary file added fpu.o
Binary file not shown.
Binary file added hibernate.o
Binary file not shown.
Binary file added lcd.o
Binary file not shown.
Binary file added libadc.a
Binary file not shown.
Binary file added libaes.a
Binary file not shown.
Binary file added libcan.a
Binary file not shown.
Binary file added libcomp.a
Binary file not shown.
Binary file added libcpu.a
Binary file not shown.
Binary file added libcrc.a
Binary file not shown.
Binary file added libdes.a
Binary file not shown.
Binary file added libeeprom.a
Binary file not shown.
Binary file added libemac.a
Binary file not shown.
Binary file added libepi.a
Binary file not shown.
Binary file added libflash.a
Binary file not shown.
Binary file added libfpu.a
Binary file not shown.
Binary file added libgpio.a
Binary file not shown.
Binary file added libhibernate.a
Binary file not shown.
Binary file added libi2c.a
Binary file not shown.
Binary file added libinterrupt.a
Binary file not shown.
Binary file added liblcd.a
Binary file not shown.
Binary file added libmpu.a
Binary file not shown.
Binary file added libonewire.a
Binary file not shown.
Binary file added libpwm.a
Binary file not shown.
Binary file added libqei.a
Binary file not shown.
Binary file added libshamd5.a
Binary file not shown.
Binary file added libssi.a
Binary file not shown.
Binary file added libsw_crc.a
Binary file not shown.
Binary file added libsysctl.a
Binary file not shown.
Binary file added libsysexc.a
Binary file not shown.
Binary file added libsystick.a
Binary file not shown.
Binary file added libtimer.a
Binary file not shown.
Binary file added libuart.a
Binary file not shown.
Binary file added libudma.a
Binary file not shown.
Binary file added libusb.a
Binary file not shown.
Binary file added libwatchdog.a
Binary file not shown.
16 changes: 16 additions & 0 deletions memory.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
MEMORY
{
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
}

/* Sections */
SECTIONS
{
/* Stack section (placed at the top of RAM) */
.stack : ALIGN(4){
_stack_top = ORIGIN(RAM) + LENGTH(RAM); /* Top of the stack */
. = _stack_top - 0x400; /* Allocate 1 KB for stack */
_stack_bottom = .; /* Bottom of the stack */
} > RAM
}
Binary file added mpu.o
Binary file not shown.
Binary file added onewire.o
Binary file not shown.
35 changes: 35 additions & 0 deletions openocd.gdb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
target extended-remote :3333

# print demangled symbols
set print asm-demangle on

# Reset and halt the target
monitor reset halt

# detect unhandled exceptions, hard faults and panics
break DefaultHandler
break UserHardFault
break rust_begin_unwind

# *try* to stop at the user entry point (it might be gone due to inlining)
break main

#monitor arm semihosting enable

# # send captured ITM to the file itm.fifo
# # (the microcontroller SWO pin must be connected to the programmer SWO pin)
# # 8000000 must match the core clock frequency
# monitor tpiu config internal itm.txt uart off 8000000

# # OR: make the microcontroller SWO pin output compatible with UART (8N1)
# # 8000000 must match the core clock frequency
# # 2000000 is the frequency of the SWO pin
# monitor tpiu config external uart off 8000000 2000000

# # enable ITM port 0
# monitor itm port 0 on

load

# start the process but immediately halt the processor
#stepi
Binary file added pwm.o
Binary file not shown.
Binary file added qei.o
Binary file not shown.
Loading

0 comments on commit 3aadfe8

Please sign in to comment.