Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
f4grx
NuttX RTOS
Commits
bda62b05
Commit
bda62b05
authored
11 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
SAM3/4: Fix debug logic in DMAC that was causing the loss of interrupts
parent
e2ab7d8a
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
arch/arm/src/sam34/sam_dmac.c
+12
-4
12 additions, 4 deletions
arch/arm/src/sam34/sam_dmac.c
arch/arm/src/sam34/sam_dmac.h
+0
-1
0 additions, 1 deletion
arch/arm/src/sam34/sam_dmac.h
arch/arm/src/sam34/sam_spi.c
+1
-1
1 addition, 1 deletion
arch/arm/src/sam34/sam_spi.c
with
13 additions
and
6 deletions
arch/arm/src/sam34/sam_dmac.c
+
12
−
4
View file @
bda62b05
...
...
@@ -1119,6 +1119,9 @@ static inline int sam_single(struct sam_dma_s *dmach)
/* Clear any pending interrupts from any previous DMAC transfer by reading
* the interrupt status register.
*
* REVISIT: If DMAC interrupts are disabled at the NVIKC, then reading the
* EBCISR register could cause a loss of interrupts!
*/
(
void
)
getreg32
(
SAM_DMAC_EBCISR
);
...
...
@@ -1190,6 +1193,9 @@ static inline int sam_multiple(struct sam_dma_s *dmach)
/* Clear any pending interrupts from any previous DMAC transfer by reading the
* status register
*
* REVISIT: If DMAC interrupts are disabled at the NVIKC, then reading the
* EBCISR register could cause a loss of interrupts!
*/
(
void
)
getreg32
(
SAM_DMAC_EBCISR
);
...
...
@@ -1285,7 +1291,7 @@ static int sam_dmainterrupt(int irq, void *context)
/* Check if the any transfer has completed or any errors have occurred */
if
(
regval
&
DMAC_EBC_ALLINTS
)
if
(
(
regval
&
DMAC_EBC_ALLINTS
)
!=
0
)
{
/* Yes.. Check each bit to see which channel has interrupted */
...
...
@@ -1315,7 +1321,7 @@ static int sam_dmainterrupt(int irq, void *context)
sam_dmaterminate
(
dmach
,
OK
);
}
/* Otherwise, this must be a Buff
f
er Transfer Complete (BTC)
/* Otherwise, this must be a Buffer Transfer Complete (BTC)
* interrupt as part of a multiple buffer transfer.
*/
...
...
@@ -1328,6 +1334,7 @@ static int sam_dmainterrupt(int irq, void *context)
}
}
}
return
OK
;
}
...
...
@@ -1428,6 +1435,9 @@ DMA_HANDLE sam_dmachannel(uint32_t chflags)
/* Read the status register to clear any pending interrupts on the
* channel
*
* REVISIT: If DMAC interrupts are disabled at the NVIKC, then
* reading the EBCISR register could cause a loss of interrupts!
*/
(
void
)
getreg32
(
SAM_DMAC_EBCISR
);
...
...
@@ -1740,7 +1750,6 @@ void sam_dmasample(DMA_HANDLE handle, struct sam_dmaregs_s *regs)
regs
->
creq
=
getreg32
(
SAM_DMAC_CREQ
);
regs
->
last
=
getreg32
(
SAM_DMAC_LAST
);
regs
->
ebcimr
=
getreg32
(
SAM_DMAC_EBCIMR
);
regs
->
ebcisr
=
getreg32
(
SAM_DMAC_EBCISR
);
regs
->
chsr
=
getreg32
(
SAM_DMAC_CHSR
);
/* Sample channel registers */
...
...
@@ -1780,7 +1789,6 @@ void sam_dmadump(DMA_HANDLE handle, const struct sam_dmaregs_s *regs,
dmadbg
(
" CREQ[%08x]: %08x
\n
"
,
SAM_DMAC_CREQ
,
regs
->
creq
);
dmadbg
(
" LAST[%08x]: %08x
\n
"
,
SAM_DMAC_LAST
,
regs
->
last
);
dmadbg
(
" EBCIMR[%08x]: %08x
\n
"
,
SAM_DMAC_EBCIMR
,
regs
->
ebcimr
);
dmadbg
(
" EBCISR[%08x]: %08x
\n
"
,
SAM_DMAC_EBCISR
,
regs
->
ebcisr
);
dmadbg
(
" CHSR[%08x]: %08x
\n
"
,
SAM_DMAC_CHSR
,
regs
->
chsr
);
dmadbg
(
" DMA Channel Registers:
\n
"
);
dmadbg
(
" SADDR[%08x]: %08x
\n
"
,
dmach
->
base
+
SAM_DMACHAN_SADDR_OFFSET
,
regs
->
saddr
);
...
...
This diff is collapsed.
Click to expand it.
arch/arm/src/sam34/sam_dmac.h
+
0
−
1
View file @
bda62b05
...
...
@@ -136,7 +136,6 @@ struct sam_dmaregs_s
uint32_t
creq
;
/* DMAC Software Chunk Transfer Request Register */
uint32_t
last
;
/* DMAC Software Last Transfer Flag Register */
uint32_t
ebcimr
;
/* DMAC Error Mask */
uint32_t
ebcisr
;
/* DMAC Error Status */
uint32_t
chsr
;
/* DMAC Channel Handler Status Register */
/* Channel Registers */
...
...
This diff is collapsed.
Click to expand it.
arch/arm/src/sam34/sam_spi.c
+
1
−
1
View file @
bda62b05
...
...
@@ -822,7 +822,7 @@ static void spi_rxcallback(DMA_HANDLE handle, void *arg, int result)
*
* Input Parameters:
* handle - The DMA handler
* arg - A pointer to the chip select struct
ion
* arg - A pointer to the chip select struct
ure
* result - The result of the DMA transfer
*
* Returned Value:
...
...
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