SAMA7G54-EK – Booting Demo Linux® Image
Contents
Introduction
This training lists step-by-step instructions for booting a demonstration Linux image to the SAMA7G54-EK Evaluation Kit.
There are two methods, the first is to boot from a SD memory card and the second from the onboard e.MMC Flash memory. There are several pre-compiled demonstration Linux images available from the Linux4sam website.
What you will need:
- SAMA7G54-EK Evaluation Kit
- Two micro-B USB cables (included in the SAMA7G54-EK box)
- Personal computer (Windows®, macOS®, Linux®) running a terminal emulation program
- SD memory card (1 GB or larger)
Prerequisites
- Familiarity with the features of the SAMA7G54-EK Evaluation Kit
- Knowledgeable of the SAMA7G5 Series Boot Process
- If booting from onboard e.MMC Flash memory, knowledgeable of SAM-BA In-System Programmer (ISP)
Hardware
For this training, you will use the SAMA7G54-EK Evaluation Kit.
SAMA7G54-EK Evaluation Kit
Setup the SAMA7G54-EK as listed below:
Jumpers
Set the jumpers to their default positions as shown in the “Jumper Summary” section on the “SAMA7G54-EK – Features” page.
Power
- Apply power as shown in the “Power Options” section on the “SAMA7G54-EK – Features” page.
Download a Demonstration Image
The latest demonstration images for the SAMA7G54-EK are available on the Linux4sam website. There you will find three sets of images created from the following build systems:
Note that there is one image that can boot from e.MMC Flash Memory and there are three that can boot from SD Memory Card. Download the image of your choice and follow the steps below according to the boot method you have chosen.
Load image onto SD Memory Card
To boot Linux from an SD memory card, perform the following steps.
You will write the image to the SD memory card using the balenEtcher utility program. balenEtcher is a cross-platform utility program used for writing image files onto storage media.
Select Image
Locate the directory where the image has been stored. There is no need to un-compress the image file. The balenEtcher utility program can handle compressed image files.
Select Target
Select the SD memory card.
Flash!
Finally, write the image to the SD memory card. This will take some time, be patient.
Load Image Into e.MMC Flash Memory
Setup Console Serial Communications
To view the target console, connect to the host computer running a terminal emulation program in accordance with the “SAMA7G54-EK – Console Serial Communications" page.
Setup SAM-BA Host to Monitor Communications
In this section, you will establish SAM-BA host application communications with the target’s (SAMA7G54) SAM-BA Monitor.
To communicate with the SAM-BA monitor on the target, you must
- Installed the SAM-BA Host on a Host Computer, and
- Connect a micro-B USB cable to the USB-A port (J7) on the SAMA7G54-EK.
Ensure jumper the DISABLE_BOOT (J22) jumper is open.
This will allow booting from the onboard memories.
Press the nSTART (SW3) push button to wake up the MPU.
The SAMA7G54-EK will boot to the SAM-BA monitor. This action will also activate the USB-A port (J7).
Write Image to e.MMC Flash Memory
In this next section, you will write the Linux demonstration image (microchip-headless-image-sama7g5ek-emmc.img) to e.MMC Flash Memory using the SAM-BA In-System Programmer.
Write microchip-headless-image-sama7g5ek-emmc.img to e.MMC Flash Memory using the following SAM-BA host applet command:
$ sam-ba -p serial -b sama7g5-ek -a sdmmc -c write: microchip-headless-image-sama7g5ek-emmc.img
Enable OTPC Emulation Mode
When prototyping, the One-Time Programmable Memory Controller (OTPC) can be placed into Emulation Mode. Emulation Mode. This allows you to customize the Boot Configuration Packet without having to commit it to One-Time Programmable (OTP) Memory. In this mode, the one-time programmable memory is emulated by OTPC Emulation Memory.
The OTPC Emulation Memory uses a portion of Secure backup SRAM (SECURAM) located inside the Security Module (SECUMOD) and is powered by VDDBU. Therefore, if the power is removed from the MPU, and VDDBU is available, data will remain.
To place the SAMA7G54 into Emulation Mode, you will use the SAM-BA applet bootconfig’s writecfg command to program the Boot Sequence Control Register (BSCR) to configure the first-stage bootloader (ROM code) to enable the emulation mode before reading the Boot Configuration Packet (BCP).
To enable Emulation Mode, perform the following steps:
Set the Boot Sequence Configuration Register (BSC_CR), Emulation Enable (EMUL_EN) bit to 1:
$ sam-ba -p serial -b sama7g5-ek -a bootconfig -c writecfg:bscr:EMULATION_ENABLED
Reset Emulation Memory in SECURAM to zero.
$ sam-ba -p serial -b sama7g5-ek -a bootconfig -c resetemul
The resetemul command must be called once before any other command accessing SECURAM.
Refresh the Emulation Mode.
sam-ba -p serial -b sama7g5-ek -a bootconfig -c refreshcfg:emul
The refreshcfg:emul command tells the OTPC to enable its emulation mode before scanning all packets in the User Area.
Set Boot Configuration Packet to boot from e.MMC Flash Memory
In this section, you will configure the Boot Configuration Packet to boot from e.MMC Flash Memory.
Write boot configuration to boot from e.MMC Flash Memory.
$ sam-ba -p serial -b sama7g5-ek -a bootconfig -c writecfg:bcp-emul:SDMMC0_IOSET1
Boot
Press the nRST (Reset) push button (SW2). Observe the boot log scrolling on the Console. At the end, the command line will prompt the user to log in. Log in as ‘root.’ There is no password required.
Log in for the sama7g5ek-emmc headless image:
Observe the RGB LED flashing blue (heartbeat).
Summary
In this training, you booted a demonstration Linux image to the SAMA7G54-EK Evaluation Kit using one of two methods, SD memory card or onboard e.MMC Flash Memory.