Creating an SD Boot Image
This lab was very straightforward, but I ran into an issue that left me scratching my head for a while.
This lab used the previously created "Test_Peripherals" application to build the SD card boot image. This test application ran with no issues in JTAG debug mode in lab 5.
I walked through the steps of creating the boot image, including adding the PMU firmware. Generated the BIN boot image and loaded it up on the Ultra96-V2 board. The terminal output indicated the program had hung up:
The test hung up on the "psu_csudma" interrupt example test. I figured, ok, maybe I did something wrong in the build. I walked through the steps again and had to do the following because my files no longer automatically showed up (probably because they were already allocated to the existing boot image):
I think the "Clean Project" step caused a second issue, as after a rebuild of the boot image, I no longer saw an output on the terminal. I went back and checked in the BSP, and sure enough, the UART for stdin/stdout showed psu_uart_0. I had set this to psu_uart_1 as instructed in Lab 6, and I know that to be the case, as I would not have seen the "psu_csudma" test hang up in the terminal to begin with. After fixing the BSP and another rebuild, still no luck on the interrupt test.
I went back into debug mode to make sure I hadn't accidentally modified a source file in a way that would cause this. In debug mode, the "Test_Peripherals" application ran with no issues (just as in Lab 5). The debug and release versions of the application use the same source, the only difference being some optimizations for the release version.
Now what? I decided to add debug print statements liberally in the "psu_csudma" interrupt example function. This function is named "XCsuDma_IntrExample" and is called from "testperiph.c". The function is found in "xcsudma_intr_example.c":
As you can see, I added print statements after pretty much any function call to see where the interrupt example function was ending up stuck:
I re-built yet again, and to my surprise, the "Test_Peripherals" application executed completely and did not hang! I saw the output from all my added print statements, but unfortunately didn't grab a screenshot. Why did print statements cause this function not to hang? I have no idea.
I re-built one more time without debug print statements, just to make sure I wasn't crazy. The interrupt example hung once again. Finally, I had to look into the solutions workspace provided for this lab to see if I was doing something wrong. I diffed files related to Test_Peripherals in both my workspace and the solutions workspace:
A-ha! The "testperiph.c" file in the solution workspace had this very test case commented out! I quickly went back through the lab and previous labs to make sure I hadn't missed something. There were instructions to comment out a UART test in the Test_Peripherals application, but I saw nothing about commenting out this test. Looks like the training creators probably saw this same issue, commented the "testperiph.c" file, but forgot to write about it. That or there is some good reason why the interrupt test doesn't work that they forgot to mention. Either way, I finally got to the bottom of it.
-Phil





Top Comments
-
nerdyupdates
-
Cancel
-
Vote Up
0
Vote Down
-
-
Sign in to reply
-
More
-
Cancel
Comment-
nerdyupdates
-
Cancel
-
Vote Up
0
Vote Down
-
-
Sign in to reply
-
More
-
Cancel
Children