SAMA5D3x Xplained - Getting-started - how to

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

Hello all !

I bought SAMA5D3 Xplained board and SAM-ICE JTAG tool.

I need some instructions (step-by-step for stupid people like me):
- how can i make c/c++ application
- how can i flash it to board
- and how can i debug it.

I don't want use Linux system.
I want make c/c++ application for MCU, NOT for Linux.
I need debug it.

I downloaded softpack for board SAMA5D3 Xplained, read instruction to build library and examples - and build getting-started example sucessful. I have .bin and .elf files, but i don't know how can i flash it to board; to which memory (NAND flash, SD card, ...); how can i do flash and how can i debug it, ...

I need someone, who can describe and explain me, how can i use getting-started project, flash it, run it on board and debug it.

I read many documents about SAMA5D3 Xplained board, but
no one describe flashing and debugging or this informactions are insufficient for me.

I'm not interrested in Linux or other operating system and application for op. system. I want program MCU SAMA5D36 and hardware around it on this board.

Thanks all for any help with it.

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

And here I thought it was just me showing my age. Atmel didn't 'xplain' anything.

I don't think AtmelStudio can be used nor can the mkII ISP I have for the 8 bit parts. I suspect I need to purchase the SAM-ICE and use Eclipse. Did you ever get it working and can shed some light?

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

It is expected that most people using SAMA5D3 are going to run Linux. And that is what 'Xpalined' by the development board.

MPUs are much more complicated than MCUs. There is no embedded flash to program, so programming depends on the type of the external flash installed on the board. Same goes for SDRAM.

I have not tried to compile applications from the softpack, but I have used it to get ideas on how to use peripherals.

I'm attaching results of my experiments with the board. This code uses internal RAM, so it has to be re-uploaded every time. The code is very simple, but it uses UART, GPIOs and timer.

There is also sam_run.py script that uses embedded ROM bootloader (SAM-BA) to run the application.

You need to remove a jumper from the NAND CS signal (JP5). This way SAM-BA will fail to find a bootable media and will stay in the bootloader mode. In this mode script mentioned above will be able to program the RAM.

For more advanced uses you need to read about SAM-BA PC utility.

Attachment(s): 

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

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

Aktivo wrote:
I'm not interrested in Linux or other operating system and application for op. system.
An application processor is complex enough that it's quicker to use an operating system (OS) or a real-time operating system (RTOS).
NuttX RTOS was found by SAMA5D3 - Partners (Atmel).
NuttX has a POSIX interface; this makes reuse easier and eases porting of runtimes.
http://www.nuttx.org/Documentation/NuttX.html#at91sama5d3
Scroll down to see the in-progress for SAMA5D4 .
attigeek wrote:
I suspect I need to purchase the SAM-ICE and use Eclipse.
J-Link and Eclipse are mentioned in nuttx / configs / sama5d3-xplained / README.txt (Sourceforge)

"Dare to be naïve." - Buckminster Fuller

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

attigeek wrote:
I suspect I need to purchase the SAM-ICE and use Eclipse.
And to clarify this - you can reprogram everything on the board using SAM-BA bootloader that resided in the ROM.

So you don't really need SAM-ICE. If you want to do more advanced debugging, then yes, you will need SAM-ICE.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

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

For NuttX a better reference, of course, is the SAMA5D3 Xplained port itself. There is a lot of detail about how I used the Xplained board. Look at the README here: https://sourceforge.net/p/nuttx/...

The SAMA5D3x-EK has NOR FLASH, but the SAMA5D3 Xplained and SAMA5D4-EK do not so you either have to boot from NAND somehow complying with the U-Boot device tree interfaces. On the SAMA5D3 Xplained I booted from an SD card like this:

U-Boot> fatload mmc 0 0x20008000 nuttx.bin
U-Boot> go 0x20008040

For the SAMA5D4-EK, I developed a a tiny boot loader that runs out of SDRAM and loads code from serial to SRAM. I put this little bootloader in Serial FLASH or on an SD card as boot.bin. The the ROM bootloader will automatically run it. See the README file here for more information: https://sourceforge.net/p/nuttx/...

Greg

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

Thanks for your replies.

Having previously worked with AtmelStudio and the code snipets from Atmel app notes for the 8 bit microcontrollers, I was usually able to get up and running very quickly. Migrating to the SAMA5D3x is a big leap as there is nothing that seems to connect the dots.

The response to my support post on Atmel's website indicates I should use IAR's compiler or arm-none-eabi-gcc (www.codesourcery.com). Apparently Codesourcery was bought out by Mentor Graphics almost 4 years ago. "Sourcery G++ Lite 2011-03" is referred to in release notes and arm-none-eabi-gcc (referred to in response) are now Mentor Graphics Sourcery CodeBench Lite Edition which has separate installs for GNU and EABI. Which package would be appropriate?

Atmel's document doc6310.pdf refers to 'AT91SAM Microcontrollers' which I think is applicable but I am not sure. If I go to Products under Atmel's website, the AT91 is not listed directly; it is listed under 'Legacy Product'. As alexru pointed out "MPUs are much more complicated than MCUs". Are the instructions contained in this document applicable?

The documentation includes a text document on migration from Codesourcery to Eclipse. Is that to imply Eclipse is the preferred alternative to the paid IAR environment? Eclipse has multiple different packages available - is there any one in particular that should be utilized with YAGARTO specified in document doc6310.pdf?

Do I need Linux installed (natively, dual boot or virtualized) to compile or can code be compiled on a Windows OS system?

For such a capable part, the documentation is HORRIBLY lacking, vague, or in a state of flux. Having worked with Atmel 8 bit parts for over seven years (using WinAVR initially), I still maintain that Atmel has done an extremely poor job of 'xplaining' how to USE this evaluation board. How about walking the individual through setting up a compile environment (since a native solution is apparently still in the works) and a few 'Hello World' examples?

I now have a SAM-ICE along with a serial USB cable. Does anyone have suggestions on setting up the best (free) compile environment to get up and running?

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

attigeek wrote:
... I still maintain that Atmel has done an extremely poor job of 'xplaining' how to USE this evaluation board.
Distributors want to sell these so the distributors' application engineers add value.
attigeek wrote:
How about walking the individual through setting up a compile environment ...
Linux on ARM, ATSAMA5D3 Xplained by Robert Nelson (eewiki, Digi-Key)
http://www.element14.com/community/community/designcenter/sama5d3xplained/blog/2014/04/25/debian-on-the-sama5d3-xplained

"Dare to be naïve." - Buckminster Fuller

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

attigeek wrote:
The response to my support post on Atmel's website indicates I should use IAR's compiler or arm-none-eabi-gcc (www.codesourcery.com).
http://www.iar.com/Products/IAR-Embedded-Workbench/ARM/Supported-devices/Atmel/
http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/platforms/arm-eabi
Bare board?
RTOS?
Is a real-time enhanced Linux OK?
Though dated the following states some latency measurements on a SAM9 (pre-cursor to SAMA5) running Linux:
Real Time solutions on AT91SAM SoC (Linux4SAM)

"Dare to be naïve." - Buckminster Fuller

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

I understand what you want, but I think you are missing the point. The board is here to explain how Atmel MPU works, not how MPUs work in general. Certain level of knowledge is assumed.

It is like saying, I'm a beginner and have successfully used resistors, but now I moved on to transistors and NXP documentation does not explain how to use their transistor.

Also, Atmel provides toolchain (arm-none-eabi-gcc), it can be downloaded here.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

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

Quote:

doc6310.pdf refers to 'AT91SAM Microcontrollers' which I think is applicable but I am not sure.

Well it was written for the older ARM7/ARM9 but most of what it says is probably still applicable to Cortex A5.
Quote:

The documentation includes a text document on migration from Codesourcery to Eclipse.

But that does not make sense. Codesourcery is a build of the GCC compiler for ARM. Eclipse is an IDE that can be used to isolate the user from the command line of many compilers including arm GCC. So you don't "migrate" from one to the other. You use one wrapped around the other to give an easier to use user interface. (though for my money Eclipse is perhaps a bit overwhelming in itself for someone starting out - other ID choices are available but I think the age of the document perhaps reflects a time when Eclipse was the main/only choice).
Quote:

YAGARTO

Yargato (Yet another ARM toolchain) was an early attempt to package together tools for ARm development. These days people tend to get their arm GCC from CodeSourcery or one of the following:

http://elinux.org/Toolchains#Pre...

(Linaro also popular). However as Alex says:

Quote:

Also, Atmel provides toolchain (arm-none-eabi-gcc), it can be downloaded here.

As that's build by Atmel for Atmel then in the case of Atmel ARM chips it may well be the best choice. The compiler and tools themselves are generic across all ARMs but to build for a particular ARM you need things like the C Run Time and library code built for the variant - you may not get that for a particular Atmel ARM in all toolchains but it's a pretty fair bet that one built by Atmel themselves will have what you require.
Quote:

Do I need Linux installed (natively, dual boot or virtualized) to compile or can code be compiled on a Windows OS system?

That's your choice. You can get arm-whatever-gcc built in both Linux and Windows variants so you can choose to build your ARM code in which ever environment you prefer. If, however, you ultimately plan to run Linux on the ARM target it makes quite a lot more sense to also do the development in Linux on the host PC where you do the cross compilation too. To achieve that it's quite common to use VmWare/Virtualbox on the Windows PC to also run a Linux PC within it then do the Linux work in that.
Quote:

For such a capable part, the documentation is HORRIBLY lacking, vague, or in a state of flux.

It's true there's a bit of a learning curve. It's generally assumed that people developing with ARM are experienced developers and already have experience of a lot of stuff (like how to setup Eclipse for a particular compiler or whatever).
Quote:

I now have a SAM-ICE along with a serial USB cable. Does anyone have suggestions on setting up the best (free) compile environment to get up and running?

It is a shame that Atmel have only added SAMD/3/4 support to Studio 6.2 so far. They could do with adding the Cortex A's to it too.

In the meantime a lot of people have a lot of fun with CooCox which, like Eclipse, is an IDE you can wrap around arm-whatever-gcc for ARM development. Personally I like Code::Blocks as a generic IDE though it's truie I've never explored it's use for an A5. In fact if I had an A5 I'd probably just run Linux on it and I'd just be doing normal ARM Linux application cross development on a Linux PC.

If you just wanted to trade up from AVR to ARM then can I ask what on earth made you choose an A5. You said:

Quote:

I don't want use Linux system.

In which case I kind of wonder what the appeal of an A5 was? As you may know in Cortex M and Cortex A the M basically means "eMbedded" and and A means "Application processor". It seems to me you wanted embedded but bought application - why? If you wanted embedded with a bit of power/resource the Cortex M4 would have been a better choice.

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

clawson wrote:

Aktivo wrote:
I don't want use Linux system.

In which case I kind of wonder what the appeal of an A5 was?

Likewise!
Quote:
As you may know in Cortex M and Cortex A the M basically means "eMbedded" ...

Or "Microcontroller" - amounts to much the same thing.
Quote:
... and and A means "Application processor". It seems to me you wanted embedded but bought application - why?

Likewise!
Quote:
If you wanted embedded with a bit of power/resource the Cortex M4 would have been a better choice.

Indeed.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

patacongo wrote:
For the SAMA5D4-EK, ...

ARM TechCon: Atmel announces ARM Cortex-A5-based MPUs

October 02, 2014

http://www.embedded.com/electronics-products/electronic-product-reviews/mcus-processors-and-socs/4435478/ARM-TechCon--Atmel-announces-ARM-Cortex-A5-based-MPUs-

Atmel Announces ARM Cortex-A5-based MPUs Optimized for 720p Video Playback and Advanced Security Functions

San Jose, Calif., October 1, 2014

http://www.atmel.com/about/news/release.aspx?reference=tcm:26-63482

http://www.atmel.com/products/microcontrollers/arm/sama5.aspx#SAMA5D4_series 

One of the BGA packages has fewer pins but is still 0.8mm pitch (easier to design a 6-layer PCB).

"Dare to be naïve." - Buckminster Fuller

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

patacongo wrote:
For the SAMA5D4-EK, ...

LinuxGizmos

Atmel revs up Cortex-A5 SoC with video decode, security

by Eric Brown

Oct 2, 2014

http://linuxgizmos.com/atmel-revs-up-cortex-a5-soc-with-video-decode-security/

  • ... it adds ARM’s NEON Media Processing Engine (MPE), which provides support for the ARM v7 Advanced SIMD v2 and Vector Floating-Point v4 (VFPv4) instruction sets, ...
  • All four SAMA5D4 models add security features compared to the SAMA5D3.
  1. ARM TrustZone technology protects the system against counterfeiting, and enables secure remote firmware updates.
  2. The SAMA5D4 can run authentication software, and provides on-the-fly execution of encrypted code stored in external memory, says Atmel.
  3. Other security features include tamper detection with erasure of critical data, ...
  4. ... plus hardware encryption engines that support private and public key algorithms.
  • The SAMA5D4 adds dual gigabit Ethernet support compared to a 10/100 and 10/100/1000 combo on the SAMA5D3.
  • However, it loses some features found on the earlier model, including industrial temperature support and the dual CAN controller.
  • ... for $695 (order code ATSAMA5D4-EK).

"Dare to be naïve." - Buckminster Fuller