Jump to main content

# 1.3.4 SAMA7D65-Curiosity Board: Building and Running the CAN Bootloader With SD/eMMC Media Applications

Downloading and Building the Application

To clone or download this application from Github,go to the main page of this repository and then click Clone button to clone this repo or download as zip file.

Path of the application within the repository is apps/mpu_can_bootloader/.

To build the application, refer to the following table and open the project using its IDE.

Bootloader Application

Project Name | Description
--- | ---
bootloader_sd_emmc/sama7d65/sam_a7d65_curiosity.X | MPLABX Project for SAMA7D65-Curiosity Board

Test Application

Project Name | Description
--- | ---
test_app/sama7d65/sam_a7d65_curiosity.X | MPLABX Project for SAMA7D65-Curiosity Board

Setting up SAMA7D65-Curiosity Board

- SAMA7D65-Curiosity Board is used for both Host curiosity board and Target curiosity board

- Connect two SAMA7D65 Curiosity Board to each other as per the pin connections shown below:

SAMA7D65 Curiosity Board-1 | SAMA7D65 Curiosity Board-2
--- | ---
PIN 1, J28 (CAN1) | PIN 1, J28 (CAN1)
PIN 2, J28 (CAN1) | PIN 2, J28 (CAN1)
PIN 3, J28 (CAN1) | PIN 3, J28 (CAN1)

- Connect the UART Debug port (J35) on the host curiosity board to the computer using a FTDI-USB cable
- Connect the UART Debug port (J35) on the target curiosity board to the computer using a FTDI-USB cable
- Connect the USBA port J3 on the host curiosity board to the computer using a Type-C USB cable (to power the board)
- Connect the USBA port J3 on the target curiosity board to the computer using a Type-C USB cable (to power the board)
- Close Jumper J32 (CAN1) on the host curiosity board
- Close Jumper J32 (CAN1) on the target curiosity board
- SD Card with FAT32 file system for Host curiosity board
- SD Card with FAT32 file system for Target curiosity board

Using CAN SDCARD Host Application to Send the Application Binary to Target Curiosity Board

1. Open the SDCARD host application project host_app_sdcard/sama7d65/sam_a7d65_curiosity.X in the IDE.
2. Build the project to generate the harmony.bin binary (Do not program the binary).
3. Open the test application project test_app/sama7d65/sam_a7d65_curiosity.X in the IDE.
4. Build the project to generate the binary (Do not program the binary) and then rename the test application binary from harmony.bin to image.bin.
5. Copy the MPU bootstrap application loader binary (boot.bin) from <harmony3_path>/bootloader_apps_can/deps/at91bootstrap_binaries_sam_a7d65_curiosity/application/sd_card/boot.bin onto the SD Card.
6. Copy the harmony Host application binary (harmony.bin) from <harmony3_path>/bootloader_apps_can/apps/mpu_can_bootloader/host_app_sdcard/sama7d65/sam_a7d65_curiosity.X/dist/default/production/harmony.bin onto the SD Card.
7. Copy the harmony Test application binary (image.bin) from <harmony3_path>/bootloader_apps_can/apps/mpu_can_bootloader/test_app/sama7d65/sam_a7d65_curiosity.X/dist/default/production/image.bin (renamed binary) onto the SD Card.
8. Insert the SD card into SD CARD connector on the Host board.
9. Reset or Power cycle the device.
10. Jump to Running The Application.

Running the Application

1. Open the Terminal application (Ex.:Tera Term) on the computer.

2. Configure the serial port settings as follows:

   - Baud: 115200
   - Data: 8 Bits
   - Parity: None
   - Stop: 1 Bit
   - Flow Control: None

3. Open the bootloader project bootloader_sd_emmc/sama7d65/sam_a7d65_curiosity.X in the IDE.

4. Build the project to generate the harmony_bootloader.bin binary (Do not program the binary).

5. Copy the MPU bootstrap loader binary (boot.bin) from <harmony3_path>/bootloader_apps_can/deps/at91bootstrap_binaries_sam_a7d65_curiosity/bootloader/sd_card/boot.bin onto the SD Card.

6. Copy the harmony bootloader binary (harmony_bootloader.bin) from <harmony3_path>/bootloader_apps_can/apps/mpu_can_bootloader/bootloader_sd_emmc/sama7d65/sam_a7d65_curiosity.X/dist/default/production/harmony_bootloader.bin onto the SD Card.

7. Insert the SD card into SD CARD connector on the target board.

8. Reset or Power cycle the device. Green LED will be turned-on to indicate that harmony bootloader code is running on the target.

9. Press the Switch USER on the Host curiosity board to trigger programming of the application binary.

10. Once the programming is complete, Green LED on the Host curiosity board will be turned on indicating success.

11. If above step is successful then target curiosity board will be reset. Upon re-start, the harmony bootloader will jump to the user application.

12. Green LED should start blinking on the target board and you should see below output on the console:

13. Press and hold the Switch USER and then press Reset button or Power cycle the device on the target board to force trigger bootloader at startup.

14. Press Reset button or Power cycle the device on the host board and repeat steps 9-12 once.

    - This step is to verify whether bootloader is triggered by switch press at reset on the target board

Additional Steps (Optional)

- To bootload any other application refer to the Configuring an application to be bootloaded for MPUs

Rev: C