Sunday, July 9, 2023

User interface test verification part 10 - death battle with everybody else's software in order to run mine

GETTING THROUGH THE PROCESS WITH A BOOTABLE SD CARD

I had to resolve many discrepancies between the various guides on the official Rocketboard.org as well as others. Some mention a filter script that must be run on the output of Qsys/Platform Designer, others do not. Some imply that the preloader builder (bsp generation programs) are included in the SoC EDS (System on Chip Embedded Development Suite), while others have me explicitly download code from various locations including Github. Similarly, the U-boot code has multiple sources. 

When I followed one set of recommendations the make command failed with a warning that I had to read the documentation for generating it for new chips but not the Cyclone V SoC. I don't know what versions are appropriate and of course need to be sure the versions of these piecemeal fetched bits of code are compatible with each other. 

Here is an example of the quality standards of the SoC tools. This is from the Intel website covering error messages using one of the tools necessary to create a bootable Linux image.

Description

When you are generating the device-tree source file (.dts) for an SoC HPS hardware design, you might see a large number of spurious error messages. The following list shows some of messages produced by sopc2dts:

sopc2dts --input soc_system.sopcinfo --output soc_system.dts --board

soc_system_board_info.xml

Failed to find h2f_lw_reset

Failed to find f2h_reset

Component hps_0 of class altera_hps is unknown

Component hps_0_fpga_interfaces of class altera_interface_generator is unknown

Component hps_0_hps_io of class altera_hps_io is unknown

Component hps_0_clk_0 of class hps_clk_src is unknown

Component hps_0 of class altera_hps is unknown

Component hps_0_fpga_interfaces of class altera_interface_generator is unknown

.

.

.

DTAppend: Unable to find parent for compatible. Adding to root

DTAppend: Unable to find parent for leds. Adding to root

DTAppend: Unable to find parent for pmu0. Adding to root

Resolution

No workaround is necessary. You can safely disregard the warning messages and proceed to compile your device tree sources normally.

Ignore the heap of warning messages from the tool. Trust us, it worked okay. Hmmmmm.

Eventually I made it through to the point where I would build the Linux kernel. I selected the oldest production version of the source on the Altera github section to maximize the chance that it will work with Cyclone V. Doing the build brought up a problem that after googling turned out to be code problems in that Linux version that needed some changes to be made in a couple of source modules to overcome. It was a linking problem for the device tree compiler, essentially duplicate variable names being pulled into one final module. Judicious application of 'extern' is the 'patch' I found. 

Later however I ran into an issue with the build process. The recipes and comments suggest that all I need is to include the keyword assignment of ARCH=arm but there are many different Arm architectures. This was highlighted when the kernel failed to build because some instructions it wanted to use were not part of the default Arm architecture. These are indeed supported on the Cortex A9 cores on my board. 

If this was a simple makefile, adding -march= with the code for the A9 would fix things, but building Linux is a convoluted mess of makefiles and other scripts. Finding a place to add that where it will take effect for all compiled modules is the challenge. Couldn't find any direct documentation for this. It will be the subject of tomorrows day of unnecessary labor, as I have other things to do for the rest of today. 


No comments:

Post a Comment