In article <cfcjng$5qf$> 1@inn.qnx.com> >, > anthad@foi.se > says…
setupReadDMA() only writes two values to the framegrabber hardware
(start
address of DMA and length) and a register command to start transfering.
The only reason i write (offset_t *) &mMemOffset is actually because
mMemOffset is declared as: volatile offset_t mMemOffset so i just want
to
avoid compile warnings.
Huh? What is sizeof(offset_t)? Does your hardware really work with 64-
bit addresses. Might be you need some address aligment? You can try to
add MAP_NOX64K and MAP_BELOW16M flags to mmap(). But it worth only to
try, actually they don’t need to be for PCI master device.
About the mCurrentDmaOffset the answer is yes it can only be 0 or 1, and
yes
the DMA increments the address during transaction…
It looks like mCurrentDmaOffset in ISR is the same variable as
mCurrentReadOffset in interrupt thread. A bit confusing > 
What is the magic offset 0xA0000 in calculation of mImage pointer?
Do you know why it is always the network (i think io-net) that crashes
and
nothing else?
I have observed that the network only crashes if i start the
framegrabber
process when the network card is recieving or sending something (a red
or
blue indication in photon). Otherwise the framegrabbing and the network
works fine. If i unplugg the network cable during the framegrabbing and
the
plugg it in again when finished, the network and everything else would
still
work fine.
Might be, the framegrabber, as a master PCI device, just grabs the PCI
bus for very long time? That could be cause for all kinds of problem
with NIC. Some of them (every that I saw), if got overrun, needs to be
completely reinitialized.
I want to point out that the data rate from the framegrabber is about
4MB a
second. The images i get back are also ok, the data is not corrupted, no
lost frames or anything like that.
I am beginning to suspect a problem with the network driver on QNX.
Whenever
i try to copy a file through the network or trying to access the
computer
through the network, during the framegrabbing process, the network
(io-net
or something else) dies. The only thing i can do is reboot.
Well, it sounds definetely wrong. It shouldn’t hang up the system, even
if framegrabber takes over the bus for prolong time. But I leave it to
comment for someone from QSS. I’d advise you to read the documentation
on framegrabber or contact the manufacturer of that hardware. Ought to
be different DMA options or something like.
Regards,
Eduard.
Regards,
Antoine.
“ed1k” <> ed1k@fake.address> > wrote in message
news:> MPG.1b83507b50a19dfa98969b@inn.qnx.com> …
In article <cfail6$j53$> 1@inn.qnx.com> >, > anthad@foi.se > says…
Hello Mario,
Here is the most important code regarding the DMA setup and
handling.
Please if there is anything you see is wrong, let me know.
Most important code is a function which you called
setupReadDMA(), it could do something really hazardous > 
Currently, what I see from your snippet
cedip->setupReadDma((unsigned long)(cedip->mMemOffset)
+cedip->mCurrentDmaOffset*FG9800_DMA_CUMMON_BUFFER_LENGTH,
FG9800_DMA_CUMMON_BUFFER_LENGTH);
It is unclear which values can get mCurrentDmaOffset variable. If it
can
be only 0 and 1 (I assume you programmed DMA hardware to increment
address during transactions), it’s OK as you got place for two
buffers.
Big concern is also type of mMemOffset variable. It’s completely
unclear, and you use kinda odd casting
if(mem_offset64(mMem, NOFD, 1, (off64_t *)&mMemOffset, 0) == -1)
It should be like:
off64_t mMemOffset;
…
if(mem_offset64(mMem, NOFD, 1, &mMemOffset, 0) == -1)
And last, I don’t think you have to initialize event in interrupt
service routine. You should init it once, before InterruptAttach().
Regards,
Eduard.
Thanks,
Antoine.
“Mario Charest” <> nowheretobefound@8thdimension.com> > wrote in message
news:cfa9t3$da0$> 1@inn.qnx.com> …
“Antoine Haddad” <> anthad@foi.se> > wrote in message
news:cf9t6v$4al$> 1@inn.qnx.com> …
Hello Mario,
Yes, i am pretty sure there must be something wrong with the DMA
setup,
but
i can’t find what. I will try to use a different transfer
address
and
check
if that helps.
Can you post the code you use to create the share memory and setup
the
hardware?
Thanks,
Antoine.
“Mario Charest” <> nowheretobefound@8thdimension.com> > wrote in
message
news:cf7url$jmb$> 1@inn.qnx.com> …
“Antoine Haddad” <> anthad@foi.se> > wrote in message
news:cf7sre$ib4$> 1@inn.qnx.com> …
Hi,
I have a litle problem with the network. I am writing a
driver
for a
framegrabber that uses DMA for data transfer (i am using QNX
6.1
and
6.2).
When I start the framegrabber after some seconds and sometime
minutes,
the
network connection to/from QNX craches (actually everything
that
has
to
do
with TCPIP) but everything else on the computer works fine. I
have
checked
that the network card and the framegrabber does not share the
same
interrupts.
Does anyone know what is causing this kind of problem?
Are there any settings that can be changed on io-net, for
example
to
change
the stack size, protocol size, or anything on the network
card or
driver,
that can solve this kind of problem?
It’s possible something is wrong with setup of DMA and you are
overwritting
some memory own by io-net. On each startup io-net is probably
loaded
in
the
same memory area, which explains why it’s io-net that gets
trashed.
I am open to any suggestions.
Thanks,
Antoine.
begin 666 question.cpp
M+R@06QL(‘1H92!V87)I86)L97,@=7-E9"!B971W965N(‘1H92!I;G1E<G)U
M<‘0@&%N9"!)4U(I(&9U;F-T:6]N<R!A;F0@8VQA<W-E<R!A<F4@9&5C;&%R
M960@87,@=F]L871I;&4A#0H-"G9O:60@<V]M97!L86-E(&EN(&UA:6XH0T*
M>PT*(" @;4UE;2 ](“AU;G-I9VYE9”!C:&%R(“HI;6UA<”@@,“P@$9’.3@P
M,%]$34%?0U5-34].7T)51D9%4E],14Y’5$@IC(L(%!23U1?4D5!1’Q04D]4
M7U=2251%?%!23U1?3D]#04-(12P@34%07U!(65-\34%07T%.3TXL($Y/1D0L
M(# I.PH@(”!I9B H;4UE;2 ]/2!-05!?1D%)3$5$2 (" @>PH@(" @("!F
M<’)I;G1F’-T9&5R<BP@(FU-96T@9F%I;&5D(#H@)7-<;B(L(’-T<F5R<F]R
M&5R<FYO2D[“B @(” @(&5X:70H,2D["B @('T"B @(&UE;7-E=“AM365M
M+” P+" H1D<Y.# P7T1-05]#54U-3TY?0E5&1D527TQ%3D=42"DJ,BD["@H@
M("!I9BAM96U?;V9F<V5T-C0H;4UE;2P@3D]&1"P@,2P@&]F9C8T7W0@BDF
M;4UE;4]F9G-E="P@,"D@/3T@+3$I"B @('L(" @(" @8V]U=" /" B7&Y
M;D5R<F]R(&EN(&=E='1I;F<@=&AE(&]F9G-E="$B(#P(&5N9&P[“B @(” @
M(&5X:70H,2D["B @('T-“GT-”@T#0H-“B\J(0T*(“H@(” @(” @(" @5&AI
M<R!I<R!T:&4@:6YT97)R=7!T(’-E<G9I8V4@<F]U=&EN92!T:’)E860N($ET
M(&ES(‘5S960@=&@8VQE87(@=&AE(&EN=&5R<G5P="!G96YE<F%T960@8GD@
M=&AE( T*(“H@(” @(" @(" @9G)A;65G<F%B8F5R(&%N9"!S=&%R="!T:&4@
M1$U!(‘1R86YS9F5R+@T*("H-"B J#0H@B!<<’)E(" @("!.;VYE+@T(“H-
M"B J(%QP;W-T(” @($YO;F4N#0H@@T("H@7’!A<F%M(" @87)E82 @:7,@
M82!U<V5R(&1E9FEN960@<&]I;G1E<BP@:6X@=&AI<R!C87-E(&$@<&]I;G1E
M<B!T;R!T:&4@0T5$25!&1T-A<F0@;V)J96-T+@T*("H@7’!A<F%M(" @:60@
M(" @3F]T(‘5S960A#0H@@T("H@7’)E=‘5R;B @06X@979E;G0@:68@=&AE
M(&EN=&5R<G5P="!W87,@9V5N97)A=&5D(&)Y(‘1H92!F<F%M96=R86)B97(@
M;W(@3E5,3"!O=&AE<G=I<V4N#0H@B*8V]N<W0@<VEG979E;G0J(&EN=&5R
M<G5P=%-E<G9I8V52;W5T:6YE’9O:60@F%R96$L(&EN="!I9"D>PH)<W1A
M=&EC(’-I9V5V96YT(&5V96YT.PH*(" @0T5$25!&1T-A<F0@F-E9&EP(#T@
M$-%1$E01D=#87)D(“HI87)E83L*(” @:68H(6-E9&EP0H@(" @("!R971U
M<FX@3E5,3#L"B @(‘5N<VEG;F5D(&-H87(@=&UP(#T@8V5D:7 M/FEN<$(H
M1D<Y.# P7T–1"D[“B @( H):68H(2AT;7 @)B P>$4P2D@+R@27,@:70@
M;W5R(&EN=&5R<G5P=#*"0ER971U<FX@3E5,3#L"0H)4TE’159?24Y44E])
M3DE4*” F979E;G0@3L"6-E9&EP+3YM26YT5F%L=64@/2!T;7 [“B @( H)
M+R@1&%T82!&<F%M93H@0VQE87(@=&AE(&EN=&5R<G5P=”!A;F0@<W1A<G0@
M=’)A;G-F97)I;F<@=&AE(&EM86=E(&9R;VT@=&AE(&-A;65R82!T;R!T:&4@
M9G)A;65G<F%B8F5R(&-A<F0N"@EI9B@H=&UP("8@,’@X,2D@/3T@,’@X,2D*
M"7L*“2 @(&-E9&EP+3YO=71P0BA&1SDX,#!?0TU$+” H=&UP(“8@,’@P-2D@
M?” P># R3L(" @(" @8V5D:7 M/FU);G1E<B ](#$[“B @(” @(’)E=‘5R
M;B F979E;G0["@E]"@H)+R@16YD($%C<75I<VET:6]N.B!);6%G92!T<F%N
M<V9E<F5D+"!S=&%R="!T:&4@1$U!(‘1R86YS9F5R(&)E=’=E96X@=&AE(&9R
M86UE9W)A8F)E<B!C87)D(&%N9"!T:&4@4$,N"@EI9B@H=&UP("8@,’@R-“D]
M/2 P>#(T0H)>PH)"6-E9&EP+3YS971U<%)E861$;6$H’5N<VEG;F5D(&QO
M;F<I*&-E9&EP+3YM365M3V9F<V5T2MC961I<"T^;4-U<G)E;G1$;6%/9F9S
M970J1D<Y.# P7T1-05]#54U-3TY?0E5&1D527TQ%3D=42"P@1D<Y.# P7T1-
M05]#54U-3TY?0E5&1D527TQ%3D=42"D[“B @(” @( H)“6-E9&EP+3YO=71P
M0BA&1SDX,#!?0TU$+” H=&UP(“8@,’@P-2D@?” P># X3L*(” @(" @8V5D
M:7 M/FU);G1E<B ](#([“B @(” @(’)E='5R;B F979E;G0["@E]"@D*“2\O
M($5N9”!$34$Z(%1H92!F<F%M92!H87,@8F5E;B!T<F%N<V9E<F5D+B!!<FT@
M=&AE(&9R86UE9W)A8F)E<B!C87)D(&9O<B!S96YD:6YG(&$@;F5W(&EN=&5R
M<G5P="!W:&5N('1H92!N97AT(&9R86UE(&%R<FEV97,N"@EI9B@@'1M<" F
M(#!X-# I("8F("AC961I<"T^:6YP0BA&1SDX,#!?1$U!7T–1"D@)B P># X
M2 I"B @('L*“0EC961I<“T^;W5T<$(H1D<Y.# P7T1-05]#340L(#!X,3 I
M.PH@(” @(” (" @(" @8V5D:7 M/FU)<U)E861Y5&]296%D1&%T82 ]('1R
M=64[“B @(” @(&-E9&EP+3YM26YT97(@/2 P.PH@(" @(" "0ER971U<FX@
M)F5V96YT.PD"7T)"@D"7)E=‘5R;B!.54Q,.PI]"@HOB$-“B J(” @(" @
M(" @(%1H:7,@:7,@=&AE(&EN=&5R<G5P="!T:’)E860N($ET(’-T87)T<R!T
M:&4@:6YT97)R=7!T(’-E<G9I8V4@<F]U=&EN92!T:’)E860@86YD(’=A:70@
M9F]R(&ET(‘1O(’-I9VYA;" -“B J(” @(" @(" @(’=H96X@:6YT97)R=7!T
M<R!F<F]M('1H92!F<F%M96=R86)B97(@;V-C=7)S+B!)="!T:&5N(&-L96%R
M<R!D:69F97)E;G0@<F5G:7-T97)S(&]N('1H92!00TDM8V%R9"!A;F0@8V]L
M;&5C=" -“B J(” @(" @(" @('1H92!D871A(‘1R86YS9F5R960@8GD@=&AE
M($1-02X@5VAE;B!A(&9R86UE("AI;6%G92D@:7,@<F5A9’DL(&ET(’!O<W1S
M(&$@<V5M87!H;W)E('1O(&5N86)L92!T:&4@9V5T26UA9V4@#0H@B @(" @
M(" @("!M971H;V0@=&@8V]P>2!T:&4@;&%S="!C;VQL96-T960@9G)A;64@
M&EM86=E2X-"B J#0H@@T("H@7’!R92 @(" @3F]N92X-“B J#0H@B!
M<&]S=" @("!.;VYE+@T(“H-“B J(%QP87)A;2 @(‘1Y<&4@(&ES(&$@=7-E
M<B!D969I;F5D(’!O:6YT97(L(&EN(‘1H:7,@8V%S92!A(’!O:6YT97(@=&@
M=&AE($-%1$E01D=#87)D(&]B:F5C=“X-“B J#0H@B!<<F5T=7)N("!.54Q,
M+@T(“HO"G9O:60J(&EN=&5R<G5P=%1H<F5A9"AV;VED(“IT>7!E0I["@E4
M:’)E861#=&PH7TY43U]40U1,7TE/+"!.54Q,3L"B @($-%1$E01D=#87)D
M(“IC961I<” ](“A#141)4$9’0V%R9” J71Y<&4[“B @(&EF*”%C961I<“D*
M(” @>PH@(” @(”!C;W5T(#P(”)<;D524D]2(2!#86X@;F]T(&-O;G9E<G0@
M='EP92!T;R!#141)4$9’0V%R9”$@17AI=&EN9R!I;G1E<G)U<'0@=&AR96%D
M(2!.;R!I;G1E<G)U<'0@871T86-H960A(B /”!E;F1L.PH@(” @(”!R971U
M<FX@3E5,3#L*(" @?0H*(" @8V5D:7 M/FU);G1E<G)U<'1(86YD;&4@/2!)
M;G1E<G)U<'1!='1A8V@H8V5D:7 M/FU)4E$L(“9I;G1E<G)U<'1397)V:6-E
M4F]U=&EN92P@='EP92P@<VEZ96]F*'1Y<&4I+” P3L(" @:68H8V5D:7 M
M/FU);G1E<G)U<'1(86YD;&4@/3T@+3$I"@E["@D)<W=I=&-H*&5R<FYO0H)
M"7L"0D)8V%S92!%04=!24XZ(&-O=70@/#P@(EQN15)23U(A($5!1T%)3B(@
M/#P@96YD;#L@8G)E86L["@D)“6-A<V4@149!54Q4.B!C;W5T(#P(”)<;D52
M4D]2(2!%1D%53%0B(#P(&5N9&P[(&)R96%K.PH)“0EC87-E($5)3E9!3#H@
M8V]U=” /" B7&Y%4E)/4B$@14E.5D%,(B /"!E;F1L.R!B<F5A:SL*“0D)
M8V%S92!%4$5233H@8V]U=” /" B7&Y%4E)/4B$@15!%4DTB(#P(&5N9&P[
M(&)R96%K.PH*“0D)9&5F875L=#H@8V]U=” /" B7&Y%4E)/4B$@1$].)U0@
M2TY/5R$A(2(@/#P@96YD;#L@8G)E86L["@D)?0H)“0H)“7)E='5R;B!.54Q,
M.PH)?0H)”@EC961I<“T^;4EN=&5R(#T@,#L*(” @”@EW:&EL92AT<G5E0H)
M>PH)“4EN=&5R<G5P=%=A:70H3E5,3"P@3E5,3"D[”@D)"@D):68H8V5D:7 M
M/FU);G1E<B ]/2 Q2 O+R!.97<@1&%T82!F<F%M92!I;G1E<G)U<'0*(" @
M(" @>PH)“0EI;G0@:6YD97@[”@D)“69O<BAI;F1E>” ](# [(&EN9&5X(#P@
M-3 [(&EN9&5XRLI"@D)"7L"0D)“6EF*” H8V5D:7 M/FEN<$(H1D<Y.# P
M7T–1"D@)B P>#@P2 ]/2 P("D"0D)“0EB<F5A:SL*“0D)“0D*“0D)“6-E
M9&EP+3YO=71P0BA&1SDX,#!?0TU$+” H8V5D:7 M/FU);G1686QU92 F(#!X
M,#4I(‘P@,’@P,BD[”@D)“7T*“0E]”@D)96QS92!I9BAC961I<“T^;4EN=&5R
M(#T](#(I(”\O($5N9”!A8W%U:7-I=&EO;B!I;G1E<G)U<'0*(” @(” @>PD)
M(” @( H)“0EF;W(H:6YT(&EN9&5X(#T@,#L@:6YD97@@/” U,#L@:6YD97@K
MRD"0D)>PH)“0D):68H(“AC961I<“T^:6YP0BA&1SDX,#!?0TU$2 F(#!X
M,C I(#T](# I"@D)“0D)8G)E86L[”@D)“0D)”@D)"0EC961I<"T^;W5T<$(H
M1D<Y.# P7T–1"P@&-E9&EP+3YM26YT5F%L=64@)B P># U2!(#!X,#@I
M.PH)“0E]”@D)?0H)"65L<V4@:68H8V5D:7 M/FU)<U)E861Y5&]296%D1&%T
M82D@+R@16YD($1-02!I;G1E<G)U<'0(” @(” @>PH@(” @(" @("!C961I
M<“T^;4ES4F5A9’E4;U)E861$871A(#T@9F%L<V4[“B @(” @(” @( H@(" @
M(" @("!C961I<“T^;4EM86=E(#T@‘5N<VEG;F5D(’-H;W)T("HI&-E9&EP
M+3YM365MR@P>$$P,# P2IC961I<“T^;4-U<G)E;G1296%D3V9F<V5T3L
M(” @(” @(" @<V5M7W!O<W0H)BAC961I<“T^;5-E;6%P:&]R92DI.PH*(” @
M(" @(" @8V5D:7 M/FU#=7)R96YT4F5A9$]F9G-E=“LK.PH@(” @(" @("!I
M9BAC961I<“T^;4-U<G)E;G1296%D3V9F<V5T(#X](#(I"B @(” @(" @(" @
M(&-E9&EP+3YM0W5R<F5N=%)E861/9F9S970@/2 P.PH@(" @("!]“B @(” @
M(&5L<V4*(" @(" @>PH@(" @(" )(" O+R!$;R!N;W1H:6YG(0H@(" @("!]
7"B @('T*"0H)<F5T=7)N($Y53$P["GT
end
\