This is my first time to flash the AOSP build on the device. I just followed Google's instructions to download and build the Android source code. Since I have a Nexus 7 (2013), so I chose the target to "aosp_flo-userdebug" before starting to build. Then I ran "make" to build, and the building was successful.
After that I rebooted the device and went into the bootloader, flashed the device by the command:
$ fastboot -w flashall
The flash succeeded. Then after the device rebooted, it just got stuck on the Google's logo screen and never continued. If I flash it back to the factory image, it can continue booting. So I think maybe there are some mistakes I made during the building or flashing that causes the problem. But I don't know how to find the problem.
I also tried to flash only system.img by:
$ fastboot flash system system.img
But it's still the same result. Hope someone can give me some suggestions. Thanks.
PS: the build version is 5.1