Skip to content
Snippets Groups Projects
Commit 87a48ef2 authored by Per Lindgren's avatar Per Lindgren
Browse files

dma tx kind of works

parent 89fd1c77
No related branches found
No related tags found
No related merge requests found
target remote :3333 # target remote :3333
# monitor reset init # monitor reset init
monitor arm semihosting enable # monitor arm semihosting enable
# send captured ITM to the file /tmp/itm.log # send captured ITM to the file /tmp/itm.log
# (the microcontroller SWO pin must be connected to the programmer SWO pin) # (the microcontroller SWO pin must be connected to the programmer SWO pin)
...@@ -13,4 +13,4 @@ monitor itm port 0 on ...@@ -13,4 +13,4 @@ monitor itm port 0 on
#load #load
#step #step
# monitor reset halt # monitor reset halt
detach # detach
...@@ -82,5 +82,29 @@ ...@@ -82,5 +82,29 @@
], ],
"cwd": "${workspaceRoot}" "cwd": "${workspaceRoot}"
}, },
{
"type": "cortex-debug",
"request": "launch",
"servertype": "openocd",
"name": "Debug Microcontroller",
"executable": "./target/thumbv7em-none-eabihf/debug/examples/serial-dma-tx",
"configFiles": [
"interface/stlink.cfg",
"target/stm32f4x.cfg"
],
"swoConfig": [
"enabled": "true",
"swoFrequency": "0",
"cpuFrequency": "0",
"ports": [
[
"number": "0",
"label": "0",
"format": "console",
]
]
],
"cwd": "${workspaceRoot}"
}
] ]
} }
\ No newline at end of file
...@@ -309,7 +309,7 @@ pub mod dma1 { ...@@ -309,7 +309,7 @@ pub mod dma1 {
} }
asm::bkpt(); asm::bkpt();
dma.hifcr.write(|w| w.ctcif6().set_bit()); dma.hifcr.write(|w| w.ctcif6().set_bit());
dma.s2cr.modify(|_, w| w.en().clear_bit()); dma.s6cr.modify(|_, w| w.en().clear_bit());
// TODO can we weaken this compiler barrier? // TODO can we weaken this compiler barrier?
// NOTE(compiler_fence) operations on `buffer` should not be reordered // NOTE(compiler_fence) operations on `buffer` should not be reordered
......
...@@ -137,6 +137,20 @@ macro_rules! hal { ...@@ -137,6 +137,20 @@ macro_rules! hal {
.cr1 .cr1
.write(|w| w.ue().set_bit().re().set_bit().te().set_bit()); .write(|w| w.ue().set_bit().re().set_bit().te().set_bit());
// disable hardware flow control
// enable DMA TX and RX transfers
usart.cr3.write(|w| {
w.rtse()
.clear_bit()
.ctse()
.clear_bit()
.dmat()
.set_bit()
.dmar()
.set_bit()
});
Serial { usart, pins } Serial { usart, pins }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment