SAMG55 Xplained, can't write to the EDBG UART

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

I'm new to Atmel SAM, so I got a SAMG55 Xplained board as a first intro. Now I am having trouble with the 'getting started' example from ASF.

I can compile & flash it ok, but the SAM gets stuck in 'usart_write()', particularly the check 'if (!(p_usart->US_CSR & US_CSR_TXRDY))' always evaluates to false. Removing all prints, the processor does go to the led-blinking part of the 'getting started' program, and does work just fine.

I have opened a terminal on the '/dev/ttyACM0' that shows up when I connect an USB cable to the EDBG port on the board. I double-checked the settings, 115200 8N1, no HW/SW flow control. I tried with both minicom and cutecom.

Now, thinking the ASF example could be buggy, I tried with the "ASF-free" version hinted to on these forums: https://github.com/ataradov/mcu-.... Exact same problem happens with its samg55-example project (which tries to write to the UART attached to the EDBG)

Am I missing something? I'm using OpenOCD (which needed a small fix to work with SAMG55, this could be the cause too, but what exactly goes wrong?), and the arm-none-eabi-gcc from Ubuntu 16.04 packages. The processor wants to boot by default from its ROM (which I assume has SAM-BA stuff on it). Does this ROM initialize the hardware peripherals in some way the 'getting started' project on ASF doesn't? OpenOCD just makes the device boot from flash directly. How does Atmel Studio program the chip: directly or over SAM-BA? Is there something more to be done with EDBG than the documented "connect to it with a terminal application"? What is the preferred way of programming SAM processors with the GCC/Makefile apporoach in ASF? I'd try with Atmel Studio, but I don't have easy access to a Windows machine.

Any suggestions appreciated & thanks in advance,

kalle

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I switched the compiler chain to the gcc Atmel provides (5.3.1, Linux) - no change.

I tried another example from ASF (common/services/usb/class/hid/host/mouse/example/samg55j19_samg_xplained_pro), that one ended up in an endless loop because PLL-B would not lock. (I didn't look into why - it is an ASF example, so probably it is tested to work, right?)

I tried to port the two 'hello world' examples to use USART0 instead of the EDBG-connected USART7. Exact same behaviour.

I also noticed that the timers would not work with the samg55 example in https://github.com/ataradov/mcu-.... Timers do work with the ASF examples.

So, Atmel provided device, Atmel provided example source code, Atmel provided compiler, and it doesn't work. I tried flashing both via the EDBG and via the solderable SWD port and external flasher, and flashing seems to work (I can step and run the code via gdb).

I tried BOSSA (http://shumatech.com/web/product...), but that would not even find the device (timeout reading from the serial port).

Is there anything more I can try, except to go find a Windows-computer?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sending Data to EDBG from Linux shell ( DTR needs to be High, done by socat ,hupcl=1 )

 

sleep 1; while true; do echo -en "\x01\x02"; sleep 0.1; done | socat -T1 -t1 - /dev/ttyUSB0,hupcl=1,raw,b1000000,cs8,echo=0