With thanks to Flavio's suggestion (and .json file to point me in the right direction) I now have VS Code running under Ubuntu as a full IDE - edit/build/debug with Segger jlink all from within VS Code

Had to create custom scripts in the launch.json file to ensure no reset on download of nuttx to my sama5d27 otherwise it messed with the bootstrap+Uboot config of the processor. Also a bit of faffing to get the arm-none-eabi tools from ARM to work (lots of symbolic links needed).

Is this worth documenting and sharing anything anywhere? I know the processor is perhaps a bit obscure, but it might help someone - if so, please let me know where/how to best share my information, otherwise I will simply document as part of my own project.

Tomorrow will see the start of actually debugging the cause of the CANbus driver crashes, but I can now actually do this with proper tools at my disposal. And once fixed and proven I will then work out how to do pull requests to get the fixes made available...I'm nearly coding in the 21st century now lol.

On 21/05/2021 20:51, Flavio Castro Alves Filho wrote:
Hello Tim,

I use VSCode with GDB and Segger.

But Ubuntu does not come with GDB. So I use x-pack toolchain to build and debug.

It works well.

Best regards,

Flavio


Em sex., 21 de mai. de 2021 às 13:28, Tim <t...@jti.uk.com.invalid> escreveu:
Eventually got a Linux dev environment up and running (first PC purchased 
failed after a few hours...grrr...now have an Intel i5 NUC for this).  Amazed 
how darn fast compilation is compared to WSL (even on my 3.3GHz Zeon-based 
workstation with the -j6 make option) so that in itself means it was a great 
move! Always liked Linux anyway lol.

Eclipse (latest version) still not playing ball - just won't debug. So I'm 
assuming a platform independent setup issue with it; aka finger trouble :(

I am temporarily using Segger Ozone - worked first time and can finally debug. 
Not sure I like it but hey ho.

As an aside, has anyone got a recommendation of a good, graphical, GDB debugger for 
Linux, that place nicely with NuttX? Not bothered about an IDE as such, and I'm 100% 
happy with building via terminal, but a feature rich and easy to use debugger that looks 
up the source code "thoroughly" is an essential.

But, now I can set breakpoints, I found that lack of debug messages on the 
console was because the .config was sending them to RAM not CONSOLE, because 
that's what is in the sama5d2-xult defconfig file I based my custom config on.

Simple explanation, but is this documented anywhere? Can't find that level of 
syslog stuff using make menuconfig?

Also now, at least, I know that the board is crashing in can_hwinitialize when 
it calls can_putreg(priv, SAM_PMC_PCR, regval)...so next week's task is to find 
out what's up with this (it's not my code).

On 5/12/21, Tim Hardisty <t...@hardisty.co.uk> wrote:
From: Alan Carvalho de Assis <acas...@gmail.com>

Did you enable CONFIG_DEBUG_CAN_INFO in your menuconfig?

  │     -> Build Setup
               │
  │       -> Debug Options
               │
  │         -> Enable Debug Features (DEBUG_FEATURES [=y])
               │
  │           -> CAN Debug Features (DEBUG_CAN [=y])

Indeed I did. And, anyway, even if I hadn't my debug message might
appear but the system would keep running, but it doesn't: it crashes.
I have inserted the while(1) to narrow it down to where it
crashes....it is the call to that debug message that does it :(

Try to put a sam_piowrite(PIO_LED_YOURLED, true/false); to between the
caninfo() and the while(1); just for a double check ;-)

By PIO_LED_YOURLED I mean the LED that is turning ON when your board
initializes.

Talking about LEDs... other important thing: normally when NuttX
crashes the board LED start to blink to indicate an issue, is it blinking on 
your
board?

This is a custom board, and no LED such as that. I have removed any LED-
related stuff from the board.h file...is that the issue? Maybe NuttX absolutely
depends on some kind of LED?

Reply via email to