I am attempting to migrate a project currently running with makefiles in Atmel Studio to CLion, with an Atmel SAM-ICE branded J-Link device.
With the "Embedded GDB Server" configuration in CLion I can start the server and connect to the device and debug a device programmed through Atmel Studio. However I have limited success programming the device from CLion, since I need to flash two elf files: A bootloader (Debug information not required) and the main application (Debug information required), where CLion only wants to program the main application. I expect I can circumvent this through the use of a gdbinit/script file, but I run into issues.
I attempt to pass a init script to the GDB server through the -xc command:
This results in errors, as if "monitor" is prepended to all commands. Attempting with a reduced example:
results in
Display All
Any insight into:
With the "Embedded GDB Server" configuration in CLion I can start the server and connect to the device and debug a device programmed through Atmel Studio. However I have limited success programming the device from CLion, since I need to flash two elf files: A bootloader (Debug information not required) and the main application (Debug information required), where CLion only wants to program the main application. I expect I can circumvent this through the use of a gdbinit/script file, but I run into issues.
I attempt to pass a init script to the GDB server through the -xc command:
This results in errors, as if "monitor" is prepended to all commands. Attempting with a reduced example:
results in
Source Code
- SEGGER J-Link GDB Server V6.86a Command Line Version
- JLinkARM.dll V6.86a (DLL compiled Sep 28 2020 15:02:50)
- Command line: -select USB -device ATSAMV70N20 -endian little -if SWD -speed 4000 -ir -halt -LocalhostOnly -xc REDACTED
- -----GDB Server start settings-----
- GDBInit file: REDACTED
- GDB Server Listening port: 2331
- SWO raw output listening port: 2332
- Terminal I/O port: 2333
- Accept remote connection: localhost only
- Generate logfile: off
- Verify download: off
- Init regs on start: on
- Silent mode: off
- Single run mode: off
- Target connection timeout: 0 ms
- ------J-Link related settings------
- J-Link Host interface: USB
- J-Link script: none
- J-Link settings file: none
- ------Target related settings------
- Target device: ATSAMV70N20
- Target interface: SWD
- Target interface speed: 4000kHz
- Target endian: little
- Connecting to J-Link...
- J-Link is connected.
- Firmware: J-Link V10 compiled Sep 21 2020 16:57:59
- Hardware: V10.10
- SAM-ICE found !
- S/N: REDACTED
- OEM: SAM-ICE
- Feature(s): RDI, GDB
- Checking target voltage...
- Target voltage: 3.35 V
- Listening on TCP/IP port 2331
- Connecting to target...
- Connected to target
- Waiting for GDB connection...Error during pretty printers setup: Undefined info command: "pretty-printer". Try "help info".
- Some features and performance optimizations will not be available.
- Connected to 127.0.0.1
- Executing script file [REDACTED] .
- ..
- Received monitor command: reset
- Resetting target
- Received monitor command: flash erase
- Erasing flash (may take a while)...
- ERROR: Failed to prepare RAMCode using RAM
- Error while determining flash info (Bank @ 0x80000000)
- Flash erase: Failed
- Flash erase: Failed
Any insight into:
- The flash erase error
- How to program multiple binaries (Only require debug information in one elf) or selectively erase and program part of the embedded flash