+## 4. Troubleshooting
+
+### 4.1. Checking Your Configuration
+
+Aside from environment variables and parameters you establish through
+running the `aglsetup.sh` script, you can ensure your build's configuration
+is just how you want it by examining the `local.conf` configuration file.
+
+You can find this configuration file in the Build Directory (e.g.
+`$TOP_DIR/build/conf/local.conf`).
+
+In general, the defaults along with the configuration fragments the
+`aglsetup.sh` script applies in the `local.conf` file are good enough.
+However, you can customize aspects by editing the `local.conf` file.
+See the
+"[Customizing Your Build](4_Customizing_Your_Build.md)"
+section for common configurations you might want to consider.
+
+**NOTE:** For detailed explanations of the configurations you can make
+in the ``local.conf`` file, consult the
+[Yocto Project Documentation](https://www.yoctoproject.org/docs/).
+
+A quick way to see if you have the `$MACHINE` variable set correctly
+is to use the following command:
+
+```sh
+grep -w -e "^MACHINE =" $AGL_TOP/build/conf/local.conf
+```
+
+Depending on the Renesas board you are using, you should see output
+as follows:
+
+```sh
+MACHINE = "h3ulcb"
+```
+
+or
+
+```sh
+MACHINE = "m3ulcb"
+```
+
+or
+
+```sh
+MACHINE = "h3-salvator-x"
+```
+
+If you ran the `aglsetup.sh` script as described in the
+"[Making Sure Your Build Environment is Correct](./5_3_RCar_Gen_3.md#4-making-sure-your-build-environment-is-correct)"
+section earlier, the "agl-devel", "agl-demo", "agl-netboot", "agl-appfw-smack", and
+"agl-localdev" AGL features will be in effect.
+These features provide the following:
+
+* A debugger (gdb)
+* Some tweaks, including a disabled root password
+* A SFTP server
+* The TCF Agent for easier application deployment and remote debugging
+* Some extra system tools such as USB and bluetooth
+* Support for the AGL demo platform
+* Network boot support through TFTP and NBD protocols
+* [IoT.bzh](https://iot.bzh/en/) Application Framework plus
+[SMACK](https://en.wikipedia.org/wiki/Smack_(software)) and
+[Cynara](https://wiki.tizen.org/Security:Cynara)
+* Support for local development including `localdev.inc` when present
+
+### 4.2. Check the Script's Log:
+
+Running the `aglsetup.sh` script creates the `setup.log` file, which is in
+the `build/conf` folder.
+You can examine this log to see the results of the script.
+For example, suppose the graphics drivers were missing or could not be extracted
+when you ran the script.
+In case of missing graphics drivers, you could notice an error message
+similar to the following:
+
+```text
+[snip]
+--- fragment /home/working/workspace_agl_master/meta-agl/templates/machine/h3ulcb/50_setup.sh
+/home/working/workspace_agl_master /home/working/workspace_agl_master/build_gen3
+The graphics and multimedia acceleration packages for
+the R-Car Gen3 board can be downloaded from:
+https://www.renesas.com/en-us/solutions/automotive/rcar-demoboard-2.html
+
+These 2 files from there should be store in your'/home/devel/Downloads' directory.
+ R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-weston8-20200923.zip
+ R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-weston8-20200923.zip
+/home/working/workspace_agl_master/build_gen3
+--- fragment /home/working/workspace_agl_master/meta-agl/templates/base/99_setup_EULAconf.sh
+--- end of setup script
+OK
+Generating setup file: /home/working/workspace_agl_master/build_gen3/agl-init-build-env ... OK
+------------ aglsetup.sh: Done
+[snip]
+```
+
+If you encounter this issue, or any other unwanted behavior, you can fix the error
+mentioned, remove the `$AGL_TOP/build` directory, and then re-launch the
+`aglsetup.sh` again.
+
+Here is another example that indicates the driver files could not be extracted from the downloads directory:
+
+```text
+~/workspace_agl/build/conf $ cat setup.log
+--- beginning of setup script
+--- fragment /home/working/workspace_agl/meta-agl/templates/base/01_setup_EULAfunc.sh
+--- fragment /home/working/workspace_agl/meta-agl/templates/machine/h3ulcb/50_setup.sh
+~/workspace_agl ~/workspace_agl/build
+ERROR: FILES "+/home/working/Downloads/R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-weston8-20200923.zip+" NOT EXTRACTING CORRECTLY
+ERROR: FILES "+/home/working/Downloads/R-car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-weston8-20200923.zip+" NOT EXTRACTING CORRECTLY
+The graphics and multimedia acceleration packages for
+the R-Car Gen3 board BSP can be downloaded from:
+<https://www.renesas.com/us/en/application/automotive/r-car-h3-m3-documents-software>
+
+These 2 files from there should be stored in your
+'/home/working/Downloads' directory.
+ R-Car_Gen3_Series_Evaluation_Software_Package_for_Linux-weston8-20200923.zip
+ R-Car_Gen3_Series_Evaluation_Software_Package_of_Linux_Drivers-weston8-20200923.zip
+ERROR: Script /home/working/workspace_agl/build/conf/setup.sh failed
+[snip]
+```
+
+### 4.3. Updating the Board's Firmware
+
+Follow these steps to update the firmware:
+
+1. **Update the Sample Loader and MiniMonitor:**
+
+ You only need to make these updates one time per device.
+
+ Follow the procedure found on the
+ eLinux.org wiki to update to at least version 3.02,
+ which is mandatory to run the AGL image
+ ([R-car loader update](https://elinux.org/R-Car/Boards/Kingfisher#How_to_update_of_Sample_Loader_and_MiniMonitor)).
+
+2. **Update the Firmware Stack:**
+
+ You only need to update the firmware stack if you are
+ using the Eel or later (5.0) version of AGL software.
+
+ M3 and H3 Renesas board are AArch64 platforms.
+ As such, they have a firmware stack that is divided across: **ARM Trusted Firmware**, **OP-Tee** and **U-Boot**.
+
+ If you are using the Eel (5.0) version or later of the AGL software, you must update
+ the firmware using the **[h3ulcb] [R-car h3ulcb firmware update](http://elinux.org/R-Car/Boards/H3SK#Flashing_firmware)**
+ or **[m3ulcb] [R-car m3ulcb firmware update](https://elinux.org/R-Car/Boards/M3SK#Flashing_firmware)** links from the
+ [Embedded Linux Wiki](https://www.elinux.org/Main_Page) (i.e. `elinux.org`).
+
+ The table in the wiki lists the files you need to flash the firmware.
+ You can find these files in the following directory: