I'm working through the User Guide for the LS1028A BSP on a LS1028ARDB reference board. (Document Number: LS1028ABSPUG, Rev. 0.3, 04/2019) I'm new to NXP products, but experienced with Linux and embedded processors. I'm completely unfamiliar with NXP products, so I'm working through section 3.1, LS1028A Quick Start.
I've successfully worked through section 3.1.3, Download and assemble LS1028A BSP images. I had a lot of problems with step 3, most due to the web proxy required by my local IT environment (I will post my problems and solutions in another thread so others don't have to suffer through, if I get a chance.) But another big stumbling block was the second to last command, flex-builder -i merge-component -a arm64, would fail with what looked like a Makefile failing to find a Linux modules and/or headers directory structure where it expected them to be. I found a number of posts on these forums detailing similar problems. The most common answer was to perform the merge manually, but that seemed to ignore the root cause of the problem. I was able to solve this by first running flex-builder -c linux -a arm64, which I believe downloaded and built a Linux kernel. After this, the flex-builder -i merge-component -a arm64 command was successful, and I was able to complete all steps in section 3.1.3. (I notice later that in section 3.2 of the User Guide, the Linux build command is documented, although with no indication that it's needed to succeed with section 3.1.3.) One suggestion I have is that the User Guide provide indication of what a the successful execution of each command looks like, so that a novice like myself can tell if there was a problem. My first run through these steps, I wasn't paying close attention, so I thought it was successful. It wasn't until later steps started failing that I went back, noticed some errors that scrolled past, fixed them, and eventually saw that a sucessful step usually prints [Done] in green text.
Now I am working on section 3.1.4, Deploy LS1028A BSP image on board. I am only trying to get experience with this process, so I don't have a particular deployment approach in mind. But as a first attempt I am trying to boot from the removable SD card, while also leaving the factory-installed configuration alone. When powered on, my board reports: Board: LS1028AE Rev1.0-RDB, Version: A, boot from NOR . I have not changed the DIP switches from default.
I got through step 8 of section 22.214.171.124, Option 1 - Deploy LS1028A BSP images using removable storage device . with no apparent errors, but I later noticed that in step 4, the command flex-installer -b bootpartition_arm64_lts_4.14.tgz -r build/images/rootfs_ubuntu_bionic_arm64_201910031619.tgz -d /dev/sdX (run on the host PC) does not include a -f firmware_... argument.
In step 9, when I try to Program/update the composite firmware to FlexSPI NOR flash (or eMMC / SD card) , I power on the board, drop to the uboot shell and run the command for SD Card per the given table and associated note about what file name to use: load mmc 0:2 a0000000 firmware_ls1028ardb_uboot_sdboot.img . The result was ** File not found firmware_ls1028ardb_uboot_sdboot.img ** .
So I go back to the host computer to see if that file even existed in the flexbuild directory. It does not. I poke around a bit and find that later in the User Guide that I can either download the firmware (per section 126.96.36.199) or build it myself (per section 3.2). I choose the latter, and run the command flex-builder -i mkfw -m ls1028ardb -b sd. Further on in section 3.2, I see the command to include the newly created firmware into the SD card: flex-installer -f firmware_ls1028ardb_uboot_sdboot.img -d /dev/mmcblk0.
So I bring the SD card back to the LS1028ARDB board, repeat the power on and uboot interrupt procedure, and again attempt the command load mmc 0:2 a0000000 firmware_ls1028ardb_uboot_sdboot.img . The result is unchanged: ** File not found firmware_ls1028ardb_uboot_sdboot.img ** .
After more investigation, I see that the flex-installer command direct dumps the firmware_*.img directly to the SD card device, rather than place it in a partition. This explains why the load command fails; there is no file with that name on the card.
So next I try several things. First, I ignore the load failure and press on with the next Quick Start commands relevant to SD booting, which are mmc rescan; mmc dev 0; mmc write a0000000 8 0x25000 and qixis_reset sd . This locks up the board, and when I power cycle, the board first attempts to boot off the the SD (MMC read:...) but is followed by Wrong Image Format for bootm command and then ERROR: can't get kernel image!". Fortunately it then immediately boots off the internal default images (Trying load from EMMC ..) which is successful.
When I put the SD card back in the host PC, I see that the first partition (/dev/mmcblk0p1 aka "EFI") that was created by the flex-install command is now corrupt. I assume the mmc write a0000000 8 0x25000 command done above is the culprit. So I recreate the entire SD card with the corresponding flex-install command, once again boot the board back into the uboot prompt, and run only these commands:
mmc rescan; mmc dev 0; qixis_reset sd
This does not lock up the board, but instead causes a reboot. The MMC read... is no longer followed by errors, mmc0 is listed as the current device, uboot finds a boot script, and a kernel on the MMC (SD device), and the kernel starts booting. After the kernel messages, I'm greeted with Welcome to Ubuntu 18.04.3 LTS! (where previously it said QorIQ SDK (FSL Reference Distro).)
It's downhill from there, because the Linux startup sequence fails and dumps me into emergency mode. Something to do with systemd-fsck apparently. But that's a problem for tomorrow....