You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by Tim <Ti...@JTi.uk.com.INVALID> on 2021/05/07 16:48:07 UTC
CAN example crashes
Hi,
SAMA5D27 (custom board) - trying to complete the port and also check that
the CAN interface works on the board, so I'm trying to use the CAN example
app.
The drivers appear to be registered (I see /dev/can0 and /dev/can1) but the
CAN example app crashes when trying to open /dev/can0 and I can't see why.
I am hindered in debugging this fully as yet since:
a. I am new to Nuttx and haven't yet sussed how to enable any low level
debug-type stuff (I have used menuconfig to enable anything that seems to be
related but I'm sure I missed stuff)
b. I haven't yet coerced my Eclipse IDE (under Windows 10, but code
configured and compiled using Windows WSL) to "see" the source code properly
to enable me to insert breakpoints (Segger J-link). Not wedded to Eclipse,
but it is a known entity for me and at least downloads/runs/debugs the
board!)
Can anyone point me in the direction of why, or a way to find out why, the
call to open the device would crash the board rather than return an error?
Other devices (such as Flexcom USARTs open OK and work - well, after I fixed
some arch issues for Flexcoms on the SAMA5 anyway!!). The board-specific
code (sam_can.c) I am using is based on the code for the sama5d2-xult board
and seems pretty trivial, and largely similar to many other architectures
and boards.
Many thanks,
Tim.
Re: CAN example crashes
Posted by Grr <ge...@gmail.com>.
>
> Are we still talking about apps/examples/can?
No, we're talking now about Disruptive Solutions' setup as he described it
in the message before my question
apps/examples/can is a
> low-level driver test that does not use any intervening protocol and
> only operates in loopback mode. It just verifies the loopback in its
> "normal" configuration... What comes in must be the same as what was
> sent out... but can be used in non-loopback mode with reduced
> functionality.
>
Re: CAN example crashes
Posted by Alan Carvalho de Assis <ac...@gmail.com>.
Roger that!
On 5/8/21, Miguel Wisintainer <tc...@hotmail.com> wrote:
> Just a test
>
> Enviado do meu iPhone
>
>> Em 8 de mai. de 2021, à(s) 15:47, Gregory Nutt <sp...@gmail.com>
>> escreveu:
>>
>>
>>> No, I mean on top of that: CANopen, UAVCAN, other?
>>>
>> Are we still talking about apps/examples/can? apps/examples/can is a
>> low-level driver test that does not use any intervening protocol and only
>> operates in loopback mode. It just verifies the loopback in its "normal"
>> configuration... What comes in must be the same as what was sent out...
>> but can be used in non-loopback mode with reduced functionality.
>
Re: CAN example crashes
Posted by Miguel Wisintainer <tc...@hotmail.com>.
Just a test
Enviado do meu iPhone
> Em 8 de mai. de 2021, à(s) 15:47, Gregory Nutt <sp...@gmail.com> escreveu:
>
>
>> No, I mean on top of that: CANopen, UAVCAN, other?
>>
> Are we still talking about apps/examples/can? apps/examples/can is a low-level driver test that does not use any intervening protocol and only operates in loopback mode. It just verifies the loopback in its "normal" configuration... What comes in must be the same as what was sent out... but can be used in non-loopback mode with reduced functionality.
Re: CAN example crashes
Posted by Gregory Nutt <sp...@gmail.com>.
> No, I mean on top of that: CANopen, UAVCAN, other?
>
Are we still talking about apps/examples/can? apps/examples/can is a
low-level driver test that does not use any intervening protocol and
only operates in loopback mode. It just verifies the loopback in its
"normal" configuration... What comes in must be the same as what was
sent out... but can be used in non-loopback mode with reduced functionality.
RE: CAN example crashes
Posted by di...@gmail.com.
Non of these. I do not need this overhead?
Ben
-----Oorspronkelijk bericht-----
Van: Grr <ge...@gmail.com>
Verzonden: zaterdag 8 mei 2021 19:57
Aan: dev@nuttx.apache.org
Onderwerp: Re: CAN example crashes
No, I mean on top of that: CANopen, UAVCAN, other?
El sáb., 8 de may. de 2021 12:44 PM, <di...@gmail.com>
escribió:
> You mean CAN FD or the CAN V2.0B? I use the standard with Extended ID's.
> (MCP2515 / SPI) for automotive interaction.
>
>
> https://ww1.microchip.com/downloads/en/DeviceDoc/MCP2515-Stand-Alone-C
> AN-Controller-with-SPI-20001801J.pdf
>
> Ben
>
> -----Oorspronkelijk bericht-----
> Van: Grr <ge...@gmail.com>
> Verzonden: zaterdag 8 mei 2021 19:09
> Aan: dev@nuttx.apache.org
> Onderwerp: Re: CAN example crashes
>
> Hello.
>
> What protocol do you use on top of CAN?
>
> El sáb., 8 de may. de 2021 12:03 PM, Disruptive Solutions <
> disruptivesolutionsnl@gmail.com> escribió:
>
> > I use the CAN solution from NuttX with the SPI MCP2515. Made my own
> > referenceboard for it. Is doing miliions of messages with multiple nodes.
> > Works like a charm!
> >
> > Ben
> >
> > Op za 8 mei 2021 6:30 p.m. schreef murat tologlu <mt...@hotmail.com>:
> >
> > > Thanks for all the answers. I look forward to try Alan's next
> > > tutorial :) BR,
> > >
> > > On 2021/05/08 16:24:51, Tim Hardisty <Ti...@JTi.uk.com.INVALID> wrote:
> > > > >> Is there any description somewhere about this example ?
> > > > >>
> > > > >There is some in apps/examples/README.md, but not a lot of info.
> > > >
> > > > Not much, no, but the example code is pretty self-explanatory!
> > > >
> > > >
> > > >
> > >
> >
>
>
Re: CAN example crashes
Posted by Grr <ge...@gmail.com>.
No, I mean on top of that: CANopen, UAVCAN, other?
El sáb., 8 de may. de 2021 12:44 PM, <di...@gmail.com>
escribió:
> You mean CAN FD or the CAN V2.0B? I use the standard with Extended ID's.
> (MCP2515 / SPI) for automotive interaction.
>
>
> https://ww1.microchip.com/downloads/en/DeviceDoc/MCP2515-Stand-Alone-CAN-Controller-with-SPI-20001801J.pdf
>
> Ben
>
> -----Oorspronkelijk bericht-----
> Van: Grr <ge...@gmail.com>
> Verzonden: zaterdag 8 mei 2021 19:09
> Aan: dev@nuttx.apache.org
> Onderwerp: Re: CAN example crashes
>
> Hello.
>
> What protocol do you use on top of CAN?
>
> El sáb., 8 de may. de 2021 12:03 PM, Disruptive Solutions <
> disruptivesolutionsnl@gmail.com> escribió:
>
> > I use the CAN solution from NuttX with the SPI MCP2515. Made my own
> > referenceboard for it. Is doing miliions of messages with multiple nodes.
> > Works like a charm!
> >
> > Ben
> >
> > Op za 8 mei 2021 6:30 p.m. schreef murat tologlu <mt...@hotmail.com>:
> >
> > > Thanks for all the answers. I look forward to try Alan's next
> > > tutorial :) BR,
> > >
> > > On 2021/05/08 16:24:51, Tim Hardisty <Ti...@JTi.uk.com.INVALID> wrote:
> > > > >> Is there any description somewhere about this example ?
> > > > >>
> > > > >There is some in apps/examples/README.md, but not a lot of info.
> > > >
> > > > Not much, no, but the example code is pretty self-explanatory!
> > > >
> > > >
> > > >
> > >
> >
>
>
RE: CAN example crashes
Posted by di...@gmail.com.
You mean CAN FD or the CAN V2.0B? I use the standard with Extended ID's. (MCP2515 / SPI) for automotive interaction.
https://ww1.microchip.com/downloads/en/DeviceDoc/MCP2515-Stand-Alone-CAN-Controller-with-SPI-20001801J.pdf
Ben
-----Oorspronkelijk bericht-----
Van: Grr <ge...@gmail.com>
Verzonden: zaterdag 8 mei 2021 19:09
Aan: dev@nuttx.apache.org
Onderwerp: Re: CAN example crashes
Hello.
What protocol do you use on top of CAN?
El sáb., 8 de may. de 2021 12:03 PM, Disruptive Solutions < disruptivesolutionsnl@gmail.com> escribió:
> I use the CAN solution from NuttX with the SPI MCP2515. Made my own
> referenceboard for it. Is doing miliions of messages with multiple nodes.
> Works like a charm!
>
> Ben
>
> Op za 8 mei 2021 6:30 p.m. schreef murat tologlu <mt...@hotmail.com>:
>
> > Thanks for all the answers. I look forward to try Alan's next
> > tutorial :) BR,
> >
> > On 2021/05/08 16:24:51, Tim Hardisty <Ti...@JTi.uk.com.INVALID> wrote:
> > > >> Is there any description somewhere about this example ?
> > > >>
> > > >There is some in apps/examples/README.md, but not a lot of info.
> > >
> > > Not much, no, but the example code is pretty self-explanatory!
> > >
> > >
> > >
> >
>
RE: CAN example crashes
Posted by di...@gmail.com.
Maybe my video from some while ago CAN help ?
https://www.youtube.com/watch?v=sSpNrP0DUI4
Ben
-----Oorspronkelijk bericht-----
Van: Grr <ge...@gmail.com>
Verzonden: zaterdag 8 mei 2021 19:09
Aan: dev@nuttx.apache.org
Onderwerp: Re: CAN example crashes
Hello.
What protocol do you use on top of CAN?
El sáb., 8 de may. de 2021 12:03 PM, Disruptive Solutions < disruptivesolutionsnl@gmail.com> escribió:
> I use the CAN solution from NuttX with the SPI MCP2515. Made my own
> referenceboard for it. Is doing miliions of messages with multiple nodes.
> Works like a charm!
>
> Ben
>
> Op za 8 mei 2021 6:30 p.m. schreef murat tologlu <mt...@hotmail.com>:
>
> > Thanks for all the answers. I look forward to try Alan's next
> > tutorial :) BR,
> >
> > On 2021/05/08 16:24:51, Tim Hardisty <Ti...@JTi.uk.com.INVALID> wrote:
> > > >> Is there any description somewhere about this example ?
> > > >>
> > > >There is some in apps/examples/README.md, but not a lot of info.
> > >
> > > Not much, no, but the example code is pretty self-explanatory!
> > >
> > >
> > >
> >
>
Re: CAN example crashes
Posted by Grr <ge...@gmail.com>.
Hello.
What protocol do you use on top of CAN?
El sáb., 8 de may. de 2021 12:03 PM, Disruptive Solutions <
disruptivesolutionsnl@gmail.com> escribió:
> I use the CAN solution from NuttX with the SPI MCP2515. Made my own
> referenceboard for it. Is doing miliions of messages with multiple nodes.
> Works like a charm!
>
> Ben
>
> Op za 8 mei 2021 6:30 p.m. schreef murat tologlu <mt...@hotmail.com>:
>
> > Thanks for all the answers. I look forward to try Alan's next tutorial :)
> > BR,
> >
> > On 2021/05/08 16:24:51, Tim Hardisty <Ti...@JTi.uk.com.INVALID> wrote:
> > > >> Is there any description somewhere about this example ?
> > > >>
> > > >There is some in apps/examples/README.md, but not a lot of info.
> > >
> > > Not much, no, but the example code is pretty self-explanatory!
> > >
> > >
> > >
> >
>
Re: CAN example crashes
Posted by Disruptive Solutions <di...@gmail.com>.
I use the CAN solution from NuttX with the SPI MCP2515. Made my own
referenceboard for it. Is doing miliions of messages with multiple nodes.
Works like a charm!
Ben
Op za 8 mei 2021 6:30 p.m. schreef murat tologlu <mt...@hotmail.com>:
> Thanks for all the answers. I look forward to try Alan's next tutorial :)
> BR,
>
> On 2021/05/08 16:24:51, Tim Hardisty <Ti...@JTi.uk.com.INVALID> wrote:
> > >> Is there any description somewhere about this example ?
> > >>
> > >There is some in apps/examples/README.md, but not a lot of info.
> >
> > Not much, no, but the example code is pretty self-explanatory!
> >
> >
> >
>
Re: CAN example crashes
Posted by murat tologlu <mt...@hotmail.com>.
Thanks for all the answers. I look forward to try Alan's next tutorial :)
BR,
On 2021/05/08 16:24:51, Tim Hardisty <Ti...@JTi.uk.com.INVALID> wrote:
> >> Is there any description somewhere about this example ?
> >>
> >There is some in apps/examples/README.md, but not a lot of info.
>
> Not much, no, but the example code is pretty self-explanatory!
>
>
>
Re: CAN example crashes
Posted by Tim Hardisty <Ti...@JTi.uk.com.INVALID>.
>> Is there any description somewhere about this example ?
>>
>There is some in apps/examples/README.md, but not a lot of info.
Not much, no, but the example code is pretty self-explanatory!
Re: CAN example crashes
Posted by Gregory Nutt <sp...@gmail.com>.
> Is there any description somewhere about this example ?
>
There is some in apps/examples/README.md, but not a lot of info.
Re: CAN example crashes
Posted by murat tologlu <mt...@hotmail.com>.
Hi,
Is there any description somewhere about this example ?
Thanks,
Murat
On 2021/05/07 17:49:05, Alan Carvalho de Assis <ac...@gmail.com> wrote:
> Hi Tim,
>
> Try to enable the debug in the menuconfig:
>
> Build Setup --->
> Debug Options --->
> [*] Enable Debug Features
> [*] Enable Error Output
> [*] Enable Warnings Output
> [*] Enable Informational Debug Output
>
> [*] CAN Debug Features
> [*] CAN Error Output
> [*] CAN Warnings Output
> [*] CAN Informational Output
>
> BR,
>
> Alan
>
> On 5/7/21, Tim <Ti...@jti.uk.com.invalid> wrote:
> > Hi,
> >
> >
> >
> > SAMA5D27 (custom board) - trying to complete the port and also check that
> > the CAN interface works on the board, so I'm trying to use the CAN example
> > app.
> >
> >
> >
> > The drivers appear to be registered (I see /dev/can0 and /dev/can1) but the
> > CAN example app crashes when trying to open /dev/can0 and I can't see why.
> >
> >
> >
> > I am hindered in debugging this fully as yet since:
> >
> >
> >
> > a. I am new to Nuttx and haven't yet sussed how to enable any low level
> > debug-type stuff (I have used menuconfig to enable anything that seems to
> > be
> > related but I'm sure I missed stuff)
> > b. I haven't yet coerced my Eclipse IDE (under Windows 10, but code
> > configured and compiled using Windows WSL) to "see" the source code
> > properly
> > to enable me to insert breakpoints (Segger J-link). Not wedded to Eclipse,
> > but it is a known entity for me and at least downloads/runs/debugs the
> > board!)
> >
> >
> >
> > Can anyone point me in the direction of why, or a way to find out why, the
> > call to open the device would crash the board rather than return an error?
> > Other devices (such as Flexcom USARTs open OK and work - well, after I
> > fixed
> > some arch issues for Flexcoms on the SAMA5 anyway!!). The board-specific
> > code (sam_can.c) I am using is based on the code for the sama5d2-xult board
> > and seems pretty trivial, and largely similar to many other architectures
> > and boards.
> >
> >
> >
> > Many thanks,
> >
> >
> >
> > Tim.
> >
> >
> >
> >
>
Re: CAN example crashes
Posted by Tim Hardisty <Ti...@JTi.uk.com.INVALID>.
Thanks Alan - those are already set but don't seem to produce any output on the console so may be the error output itself isn't configured right. I'll take a look.
On 07/05/2021, 18:49, "Alan Carvalho de Assis" <ac...@gmail.com> wrote:
> Hi Tim,
> Try to enable the debug in the menuconfig:
> Build Setup --->
> Debug Options --->
> [*] Enable Debug Features
> [*] Enable Error Output
> [*] Enable Warnings Output
> [*] Enable Informational Debug Output
>
> [*] CAN Debug Features
> [*] CAN Error Output
> [*] CAN Warnings Output
> [*] CAN Informational Output
>> On 5/7/21, Tim <Ti...@jti.uk.com.invalid> wrote:
>> Hi,
>>
>>
>>
>> SAMA5D27 (custom board) - trying to complete the port and also check that
>> the CAN interface works on the board, so I'm trying to use the CAN example
>> app.
>>
>>
>>
>> The drivers appear to be registered (I see /dev/can0 and /dev/can1) but
>> the
>> CAN example app crashes when trying to open /dev/can0 and I can't see why.
>>
>
>>
>> I am hindered in debugging this fully as yet since:
>>
>>
>>
>> a. I am new to Nuttx and haven't yet sussed how to enable any low level
>> debug-type stuff (I have used menuconfig to enable anything that seems to
>> be
>> related but I'm sure I missed stuff)
>> b. I haven't yet coerced my Eclipse IDE (under Windows 10, but code
>> configured and compiled using Windows WSL) to "see" the source code
>> properly
>> to enable me to insert breakpoints (Segger J-link). Not wedded to Eclipse,
>> but it is a known entity for me and at least downloads/runs/debugs the
>> board!)
>>
>>
>>
>> Can anyone point me in the direction of why, or a way to find out why, the
>> call to open the device would crash the board rather than return an error?
>> Other devices (such as Flexcom USARTs open OK and work - well, after I
>> fixed
>> some arch issues for Flexcoms on the SAMA5 anyway!!). The board-specific
>> code (sam_can.c) I am using is based on the code for the sama5d2-xult
>> board
>> and seems pretty trivial, and largely similar to many other architectures
>> and boards.
Re: CAN example crashes
Posted by Alan Carvalho de Assis <ac...@gmail.com>.
Hi Tim,
Try to enable the debug in the menuconfig:
Build Setup --->
Debug Options --->
[*] Enable Debug Features
[*] Enable Error Output
[*] Enable Warnings Output
[*] Enable Informational Debug Output
[*] CAN Debug Features
[*] CAN Error Output
[*] CAN Warnings Output
[*] CAN Informational Output
BR,
Alan
On 5/7/21, Tim <Ti...@jti.uk.com.invalid> wrote:
> Hi,
>
>
>
> SAMA5D27 (custom board) - trying to complete the port and also check that
> the CAN interface works on the board, so I'm trying to use the CAN example
> app.
>
>
>
> The drivers appear to be registered (I see /dev/can0 and /dev/can1) but the
> CAN example app crashes when trying to open /dev/can0 and I can't see why.
>
>
>
> I am hindered in debugging this fully as yet since:
>
>
>
> a. I am new to Nuttx and haven't yet sussed how to enable any low level
> debug-type stuff (I have used menuconfig to enable anything that seems to
> be
> related but I'm sure I missed stuff)
> b. I haven't yet coerced my Eclipse IDE (under Windows 10, but code
> configured and compiled using Windows WSL) to "see" the source code
> properly
> to enable me to insert breakpoints (Segger J-link). Not wedded to Eclipse,
> but it is a known entity for me and at least downloads/runs/debugs the
> board!)
>
>
>
> Can anyone point me in the direction of why, or a way to find out why, the
> call to open the device would crash the board rather than return an error?
> Other devices (such as Flexcom USARTs open OK and work - well, after I
> fixed
> some arch issues for Flexcoms on the SAMA5 anyway!!). The board-specific
> code (sam_can.c) I am using is based on the code for the sama5d2-xult board
> and seems pretty trivial, and largely similar to many other architectures
> and boards.
>
>
>
> Many thanks,
>
>
>
> Tim.
>
>
>
>
Re: CAN example crashes
Posted by Tim Hardisty <Ti...@JTi.uk.com.INVALID>.
On 07/05/2021 17:48, Tim wrote:
> Hi,
>
>
>
> SAMA5D27 (custom board) - trying to complete the port and also check that
> the CAN interface works on the board, so I'm trying to use the CAN example
> app....
>
>
>
As per my other thread, Linux+VS Code+Segger all up and running so I can
see what's going on now.
Found an error in sam_can.c for sama5 which was why it was crashing -
have fixed and will do the necessary PR in due course.
However, the main problem is that the sama5 board files all use "can"
but it should be "mcan"...so all the register addresses and possibly
functions/methods are wrong :(
Before I attempt to rework it to use mcan, has anyone actually got
Nuttx+CAN working on a sama5? It could save me loads if work if so!!??