Visual Studio Ide for Arduino
https://www.visualmicro.com/forums/YaBB.pl
Visual Micro >> GDB Debugging >> ATMEL ICE - USB SERIAL MONITOR
https://www.visualmicro.com/forums/YaBB.pl?num=1568359560

Message started by MARCO_ITALY on Sep 13th, 2019 at 8:26am

Title: ATMEL ICE - USB SERIAL MONITOR
Post by MARCO_ITALY on Sep 13th, 2019 at 8:26am
Hi.
I would like to highlight two possible problems or improvements.

1) with SAM3X8E (arduino DUE), when I use Atmel ICE as debugger and upploader and I want to use the USB(native) serial as a normal serial connected to the PC for data exchange, visualmicro keeps telling me that the monitor is not active. I tried to make this change too - I removed the hardware debugger and used only the usb (native)  the debugger works and the COM (identical) opens and displays the received data. In case of use with hardware debugging I suspect that VM only uses the USB port connected to the debugger or that there is a problem on selecting a 2nd COM to use for a normal serial monitor.

2)2) I don't know if this is really a problem, but I'm working on ten boards, all these boards are Arduino DUE clones. The Atmel processor has never been programmed, they are all boards just arrived from the factory. When I connect for the first time the debugger Atmel ICE (JTAG), VM loads the program without errors, the board enter an undefined state, does not execute the program, if I launch the debugger (press START) VM enters in to  debugger, but does not stop at any breakpoint, even at the breakpoint on SETUP. So I tried to remove the ATMEL debugger, and I set VM again with ATMEL and magically it worked all, including breakpoint. I tried this procedure on 3 other cards and all of them show this same behavior. What can we think of?
:o


Title: Re: ATMEL ICE - USB SERIAL MONITOR
Post by Simon Hopkinson on Sep 13th, 2019 at 10:56am
1)

This all works fine on the programming port (debug with ICE + Serial output), is there a reason not to use this?

When you uploaded with the hardware debug disabled, did you upload via the Atmel ICE as programmer?

Can you provide the logs for the working / non working scenarios?

After upload with ICE, check the port hasn't changed as well as this may happen.

2)

If you tap reset on the board after the debugger has attached this should then land on the break point, and continue to debug as expected.

3)

Make sure the baud rate of the serial monitor matches the baud rate you have used for serial.begin(baud) in your code.

Title: Re: ATMEL ICE - USB SERIAL MONITOR
Post by MARCO_ITALY on Sep 14th, 2019 at 7:57am
Hi updartes:

point 1) Now work fine, is necessary re-opened the monitor alway before use. If monitor is already open dosen't work,

point 2): after 10 boards the problem is alway the same: is not possibile lunch the debug if before you do not upload via USB. No erros occours. Below the output window on NO working condition.

:o
Debugger: Atmel ICE
Compiling 'MT2040-1909.01ETH' for 'Arduino Due (Native USB Port)'
Program size: 40.264 bytes (used 8% of a 524.288 byte maximum) (0,72 secs)

Uploading 'MT2040-1909.01ETH' to 'Arduino Due (Native USB Port)' using 'ATMEL-ICE'
Uploader started for board Arduino Due (Native USB Port)
Uploader will use programmer name: openocd_atmelice
C:\ProgramData\vmicro\tools\openocd-0.10.0.1\bin\openocd.exe -d2 -s "C:\ProgramData\vmicro\tools\openocd-0.10.0.1/share/openocd/scripts/" -c "interface cmsis-dap" -c "cmsis_dap_vid_pid 0x03eb 0x2141" -c "set CHIPNAME at91sam3X8E" -c "source [find target/at91sam3ax_8x.cfg]" -c "echo -n {****[vMicro]**** Uploading ELF :}" -c "telnet_port disabled; program {{C:\Users\marco\AppData\Local\Temp\VMBuilds\MT2040-1909.01ETH\arduino_due_x\Debug/MT2040-1909.01ETH.ino.elf}} reset; shutdown"
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
     http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
at91sam3X8E
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
adapter speed: 500 kHz
adapter_nsrst_delay: 100
cortex_m reset_config sysresetreq
****[vMicro]**** Uploading ELF :Info : CMSIS-DAP: SWD  Supported
Info : CMSIS-DAP: JTAG Supported
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : CMSIS-DAP: FW Version = 01.27.0082
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 500 kHz
Info : SWD DPIDR 0x2ba01477
Info : at91sam3X8E.cpu: hardware has 6 breakpoints, 4 watchpoints
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0010004c msp: 0x20001000
** Programming Started **
auto erase enabled
Info : sam3 auto-erases while programming (request ignored)
wrote 49152 bytes from file C:\Users\marco\AppData\Local\Temp\VMBuilds\MT2040-1909.01ETH\arduino_due_x\Debug/MT2040-1909.01ETH.ino.elf in 6.327702s (7.586 KiB/s)
** Programming Finished **
** Resetting Target **
shutdown command invoked
     The upload process has finished.


Visual Studio Ide for Arduino » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2019. All Rights Reserved.