SAMA5D3x Xplained - Getting-started Example

Moderator: nferre

Altivo
Posts: 3
Joined: Thu May 01, 2014 8:40 pm

SAMA5D3x Xplained - Getting-started Example

Thu May 01, 2014 9:05 pm

Hello all,
i have this:

Hardware:
- SAMA5D3 Xplained board
- ATMEL SAM-ICE

Software:
- ARM DS-5 (30 day evaluation)
- SEGGER JLink
- SAM-BA v2.12
- SAMA5D3 GNU Software Package 1.4 for Xplained Board


I build getting-started example:
..\sama5d3x-xplained\examples\getting-started
and i have this files:
getting-started_sama5d3x_ek_sama5d3x-ddram.bin
getting-started_sama5d3x_ek_sama5d3x-ddram.elf
getting-started_sama5d3x_ek_sama5d3x-ddram.map

and
getting-started_sama5d3x_ek_sama5d3x-sram.bin
getting-started_sama5d3x_ek_sama5d3x-sram.elf
getting-started_sama5d3x_ek_sama5d3x-sram.map


I have some simple questions:
1. How can i upload "getting-started" to board ?
2. How can i run it ?
3. How can i debug it ?


I'm begginer with ARM.
Is someone patient man, who can explain me step-by-step how can i upload and debug this existing example ?

Thanks very much.
jacko
Contact:
Location: Rousset
Posts: 12
Joined: Mon May 21, 2007 9:21 am

Re: SAMA5D3x Xplained - Getting-started Example

Fri May 02, 2014 1:22 am

Did you go through the steps mentioned on the following page linux4sam/bin/view/Linux4SAM/GettingStarted

You should select the SAMA5D3 Xplained downloadables and not the EK versions
Altivo
Posts: 3
Joined: Thu May 01, 2014 8:40 pm

Re: SAMA5D3x Xplained - Getting-started Example

Fri May 02, 2014 3:38 pm

jacko wrote:Did you go through the steps mentioned on the following page linux4sam/bin/view/Linux4SAM/GettingStarted
I will read this carefully again ...
You should select the SAMA5D3 Xplained downloadables and not the EK versions
I downloaded samples for SAMA5D3 Xplained not for SAMA5D3 EK.

1. I open this: http://www.atmel.com/tools/atsama5d3-xp ... ab=related
2. click on "SAMA5D3 Software Package" (http://www.atmel.com/tools/SAMA5D3SOFTWAREPACKAGE.aspx)
3. download "SAMA5D3 GNU Software Package 1.4 for Xplained Board" (http://www.atmel.com/images/sama5d3x_xplained_softpack_1.4_for_CodeSourcery_201309.zip)

I must say - i don't want make application for Linux/Android or other OS. I want make C/C++ application (program) for MCU (SAMA5D36) and upload it to NAND flash or SDCard. Run it and debug it.

I think so, that sama5d3x_xplained_softpack_1.4_for_CodeSourcery_201309.zip is samples for SAMA5D3 Xplained, for MCU. I know, how make .bin/.elf file, but i don't how to put it to board and debug it.
xA0
Posts: 5
Joined: Thu Jun 12, 2014 8:30 pm

Re: SAMA5D3x Xplained - Getting-started Example

Sun Jun 15, 2014 7:37 pm

Altivo,

Have you had any luck with the Getting Started example?

John
Altivo
Posts: 3
Joined: Thu May 01, 2014 8:40 pm

Re: SAMA5D3x Xplained - Getting-started Example

Tue Jun 17, 2014 1:05 pm

xA0 wrote:Altivo,

Have you had any luck with the Getting Started example?

John
Partially yes.

I was successful with:
- building own C program (or getting-started example)
- uploading program into SRAM
- run it in SRAM
- debug it in SRAM

I was not successful (for now) with:
- upload into flash
- boot it from flash

SAM-ICE and compiler/linker does not support SAMA5D36 - i used D35 instead.
Atmel Studio does not support SAMA5D36.

I must read "half of internet" until i make "hello world!". :-D :-D :-D
Examples are not user-friendly like: "compile, upload and run". :-D
I had read a lot of hours and lot of materials before I successful with a trivial program like "hello world.". :-)
olav.schwartz
Posts: 2
Joined: Tue Jun 17, 2014 2:58 pm

Re: SAMA5D3x Xplained - Getting-started Example

Tue Jun 17, 2014 3:00 pm

Hi!
Do you mind telling us how exactly you have come so far?


Best regards!
xA0
Posts: 5
Joined: Thu Jun 12, 2014 8:30 pm

Re: SAMA5D3x Xplained - Getting-started Example

Tue Jun 17, 2014 6:28 pm

Here's my procedure for flashing the SAMA5D3x Xplained on Linux:

:idea: Note to Atmel: Include this in the product documentation please. It's not explicit in any documentation.

Prerequisites:
  • P1. SAM-BA 2.12 patch 7 is installed and operational.
    P2. Your program has been compiled (XXX-sram.bin and XXX-ddram.bin files are available).
    P3. Symlink from /dev/ttyUSB1 to /dev/ttyACM0 has been created.
Procedure:
  • Boot SAMA5D36 using ROM
    1. Apply power to SAMA5D36.
    2. Remove jumper from JP5 (NAND Flash)
    3. Press and release reset button (BP2) on board. Wait two seconds.
    4. Replace jumper at JP5.

    Start SAM-BA
    5. Make sure 'Select the connection' is set to '/dev/ttyUSB1'. If it's not, it probably won't work.
    6. Set 'Select your board' to 'at91sama5d3x-xplained'.
    7. Press the 'Connect' button.

    Writing DDRAM
    8. Navigate over to the 'DDRAM' tab.
    9. Under 'Scripts', select 'Enable DDRAM' and press the 'Execute' button.
    10. Press the open file picture button to the right of the 'Send File Name' textbox.
    11. Select your program's XXX-ddram.bin file.
    12. Press the 'Open' button in the 'Open' dialog.
    13. Press the 'Send File' button to write the file to DDRAM.
    14. Press the Compare sent file with memory to validate the operation.

    Writing NAND Flash
    15. Navigate to the 'NandFlash' tab.
    16. Select 'Enable NandFlash' under 'Scripts' and press the 'Execute' button.
    17. Select 'Erase All' under 'Scripts' and press the 'Execute' button.
    18. Press the open file picture button to the right of the 'Send File Name' textbox.
    19. Select your program's XXX-sram.bin file.
    20. Press the 'Open' button in the 'Open' dialog.
    21. Press the 'Send File' button to write the file to NAND Flash.
    22. Press the Compare sent file with memory to validate the operation.

    Writing Boot Block to NAND Flash
    23. Select 'Send Boot File' under 'Scripts' and press the 'Execute' button.
    24. Select your program's XXX-sram.bin file.
    25. Press the 'Open' button in the 'Open' dialog.

    Restart SAMA5D3x Xplained board
    26. Press the RESET button on the board (BP2).
Your program should start running. Connect a 3.3 V logic-level USB-to-serial cable to the debug port (J23) to view stdout, which should enumerate as /dev/ttyUSB0.

Viewing stdout from board
> cu -l /dev/ttyUSB0 -s 115200

Viewing and logging stdout from board
> cu -l /dev/ttyUSB0 -s 115200 | tee log.out

Good luck,
John
Last edited by xA0 on Wed Jun 18, 2014 4:51 am, edited 1 time in total.
enigma42
Posts: 3
Joined: Wed Jun 11, 2014 3:36 pm

Re: SAMA5D3x Xplained - Getting-started Example

Wed Jun 18, 2014 3:29 am

THANK-YOU!

This is exactly what I was looking for in terms of how to run the "bare-metal" examples.
blue_z
Location: USA
Posts: 1761
Joined: Thu Apr 19, 2007 10:15 pm

Re: SAMA5D3x Xplained - Getting-started Example

Wed Jun 18, 2014 4:40 am

xA0 wrote:Here's my procedure for flashing the SAMA5D3x Xplained on Linux:
Well done!  
Nicely formatted too.

Some nits:
xA0 wrote:Connect a TTY-level USB-to-serial cable to the debug port (J23) to view stdout, which should enumerate as /dev/ttyUSB0.
Replace "TTY" with "3.3V TTL".
xA0 wrote:Viewing stdout from board
> cu -l /dev/ttyUSB0 -s 115200
Using a conventional terminal emulator program such as minicom may be a better choice than cu.  
I find the terminal capture a helpful feature to record & document the testing sessions.  

Regards
xA0
Posts: 5
Joined: Thu Jun 12, 2014 8:30 pm

Re: SAMA5D3x Xplained - Getting-started Example

Wed Jun 18, 2014 4:54 am

blue_z,

Thanks for the feedback. The procedure has been updated.

Cheers,
John
olav.schwartz
Posts: 2
Joined: Tue Jun 17, 2014 2:58 pm

Re: SAMA5D3x Xplained - Getting-started Example

Thu Jun 19, 2014 4:19 pm

Wow, thank you for the very detailed walkthrough!

But how do you cope with firmwares, which are too big for the Nand and therefore can only be built with the ddram flag? (e.g. every USB example)

So there should be some kind of bootloader, which is loaded into the flash and then starts the real firmware from somewhere else.
I haven't found anything like that yet.

Maybe someone of you had more success, if I find it, I will definitely post it here.


Best regards!
help_needed
Posts: 1
Joined: Thu Jun 26, 2014 9:03 pm

Re: SAMA5D3x Xplained - Getting-started Example

Thu Jun 26, 2014 9:06 pm

That is exactly my problem. How can I run the the bigger examples on the board?
alessio
Posts: 1
Joined: Wed Jul 09, 2014 4:06 pm

Re: SAMA5D3x Xplained - Getting-started Example

Wed Jul 09, 2014 4:11 pm

Hi all,
I've tried to compile and flash the getting-start example in sram and all is ok.
But if I try to flash the usb-cdc-serial demo in ddram it doesn't work.
Why? Any suggestion?

thanks 

Return to “SAMA5-based”

Who is online

Users browsing this forum: No registered users and 3 guests