Please confirm this detail.
Yes, the -llibrary option causes xcc to look for liblibrary.a. Confirmed in XCC command line manual.
Do experiment to see if the tool complains about missing library files with your passed parameters.
Also, does --verbose help for any of these command line tools?
My loader compile does not generate any complaints. It seems to run, as the output file myloader.o is generated, with or without an appended -lquadflash. The latter makes sense, as I understand the xcc with -o does not link, so will not bother to look for a library to link with. In response to
Code: Select all
xcc -c myloader.xc -o myloader.o -target=XUF216-512-TQ128-C20 -v
I received the following output:
~/XMOS/xTIMEcomposer/Community_14.3.3/targets/XUF216-512-TQ128-C20/XUF216-512-TQ128-C20.xn:27 Warning: XN11206 Oscillator is not specified for USB node.
"~/XMOS/xTIMEcomposer/Community_14.3.3/libexec/xcc1llvm" -isystem "~/XMOS/xTIMEcomposer/Community_14.3.3/target/include/xc" -isystem "~/XMOS/xTIMEcomposer/Community_14.3.3/target/include" -isystem "~/XMOS/xTIMEcomposer/Community_14.3.3/target/include/clang" -D__xcore__ -D__XS2A__ -DXCC_VERSION_YEAR=14 -DXCC_VERSION_MONTH=3 -DXCC_VERSION_MAJOR=1403 -DXCC_VERSION_MINOR=3 -D__XCC_HAVE_FLOAT__ "-D_PLATFORM_INCLUDE_FILE=\"/tmp/ccO9ag0B.h\"" "-D_XSCOPE_PROBES_INCLUDE_FILE=\"/tmp/ccaa9TP3.h\"" -Wuseful -march=xs2a -o "/tmp/ccwwojEv.s" "myloader.xc"
xas -march=xs2a -o "myloader.o" "/tmp/ccwwojEv.s"
Same with or without the appended -lquadflash.
I added --verbose to the xflash command:
Code: Select all
xflash ../../FlashLEDFastV10/bin/FlashLEDFast.xe --loader myloader.o --upgrade 1 ../../FlashLEDSlowV10/bin/FlashLEDSlow.xe --verbose
It generated a couple screens worth of output which I put below. One thing that stands out for me is the Stage2_loader part at the very end:
Stage2_Loader::Compile : xcc -Wno-bidirectional-buffered-port -Xmapper --dontenablesodlinks -Xmapper --nochaninit -Xmapper --noinitialtidy -Xmapper --image-base -Xmapper 0x40080 -Xmapper --image-size -Xmapper 0x3ff80 -Xmapper --wno110 -Xmapper --wno226 -Xmapper --wnoXN -std=c99 -O2 -x xn "target-xn-v0-e9da95d8" -x xc s2l-n0-b156549e -lstage2loader -lswitchsetup -lsqiaccess -lquadspi -x none myloader.o -lxcc -o s2l-n0-6fb0b4c6.
It is directly after this that the error messages are thrown and the process aborts:
myloader.xc: Error: Undefined reference to 'fl_connectToDevice'
myloader.xc: Error: Undefined reference to 'fl_readDataPage'
Error: F03010 Failed to compile second stage bootloader
Seems to me the issue is the Stage2_Loader bit is missing a "-lquadflash", but I do not see any way to force that to happen. I do not know how to parse the xflash output to run the process manually, either.
Do you have to use command line tools or is there a GUI version for Linux that could be applied? GUI tool may ease the use of the referenced library.
I am using command line for this as that is what is used in all the examples provided by xmos. When I use the GUI to do the flash, and use the XFlash Options tab to add options to the command to execute the custom loader inclusion, the output in the console is the same as the command line method, including no success and same final error messages.
In the "Design and manufacture systems with flash memory" note from xmos they show a custom loader using an extern reference to readFlashDataPage(). The only statement in the text regarding this is "The loader provides the function readFlashDataPage".
My basic issue is, it is unclear to me how this provision is accomplished.
Complete output from verbose xflash command:
Code: Select all
XFlash_Options::ListDevices : xgdb --batch -q --ex listdevices devl-289cc23b
XFlash_Application found _start :40000 on Node 0
XFlash_Application found _DoSyscall :40ad4 on Node 0
XFlash_Application found _DoException :400a4 on Node 0
XFlash_Application found _start :40000 on Node 0
XFlash_Application found _DoSyscall :404b4 on Node 0
XFlash_Application found _DoException :400a4 on Node 0
XFlash_Application : Attempting to Compress Binary Data
libcompressor marker 1=181
libcompressor marker 2=187
libcompressor marker 3=158
libcompressor best marker length 3 2 2
libcompressor best marker length 3 2 3
libcompressor best marker length 3 2 4
libcompressor DoCompression_Compress took : 58ms
libcompressor compile command=xcc -nostartfiles -Xmapper --bootstyle=forsim -x assembler-with-cpp "decompressor-76341a34" -x xn "target-xn-v0-e9da95d8" -o decompressor-37c6ebdf
libcompressor validating decompressor decompressor-37c6ebdf
libcompressor launching simulator decompressor-37c6ebdf --disable-syscalls --max-cycles 100000000
libcompressor simulator starting @0x40000
libcompressor simulator terminate @0x7ff58
libcompressor decompressor validated
XFlash_Application on Node : 0 compressed from : 10736 bytes to : 7948 bytes (25.97%)
libcompressor marker 1=59
libcompressor marker 2=62
libcompressor marker 3=91
libcompressor best marker length 3 2 2
libcompressor best marker length 3 2 3
libcompressor best marker length 3 2 4
libcompressor best marker length 3 2 5
libcompressor best marker length 4 2 4
libcompressor best marker length 4 2 5
libcompressor DoCompression_Compress took : 17ms
libcompressor compile command=xcc -nostartfiles -Xmapper --bootstyle=forsim -x assembler-with-cpp "decompressor-c9a5b71f" -x xn "target-xn-v0-e9da95d8" -o decompressor-771deab7
libcompressor validating decompressor decompressor-771deab7
libcompressor launching simulator decompressor-771deab7 --disable-syscalls --max-cycles 100000000
libcompressor simulator starting @0x40000
libcompressor simulator terminate @0x7ff58
libcompressor decompressor validated
XFlash_Application on Node : 0 compressed from : 3424 bytes to : 2820 bytes (17.64%)
XFlash_Application found _start :40000 on Node 0
XFlash_Application found _DoSyscall :40228 on Node 0
XFlash_Application found _DoException :400a4 on Node 0
XFlash_Application found _start :40000 on Node 0
XFlash_Application found _DoSyscall :402a0 on Node 0
XFlash_Application found _DoException :400a4 on Node 0
XFlash_Application : Attempting to Compress Binary Data
libcompressor marker 1=11
libcompressor marker 2=12
libcompressor marker 3=15
libcompressor best marker length 3 2 2
libcompressor best marker length 3 2 3
libcompressor best marker length 5 2 5
libcompressor DoCompression_Compress took : 5ms
libcompressor compile command=xcc -nostartfiles -Xmapper --bootstyle=forsim -x assembler-with-cpp "decompressor-c50986d9" -x xn "target-xn-v1-b16f9645" -o decompressor-75cae450
libcompressor validating decompressor decompressor-75cae450
libcompressor launching simulator decompressor-75cae450 --disable-syscalls --max-cycles 100000000
libcompressor simulator starting @0x40000
libcompressor simulator terminate @0x7ff58
libcompressor decompressor validated
libcompressor marker 1=17
libcompressor marker 2=18
libcompressor marker 3=19
libcompressor best marker length 3 2 2
libcompressor best marker length 3 2 3
libcompressor best marker length 4 2 4
libcompressor best marker length 5 3 5
libcompressor DoCompression_Compress took : 5ms
libcompressor compile command=xcc -nostartfiles -Xmapper --bootstyle=forsim -x assembler-with-cpp "decompressor-61dc7018" -x xn "target-xn-v1-b16f9645" -o decompressor-f996050b
libcompressor validating decompressor decompressor-f996050b
libcompressor launching simulator decompressor-f996050b --disable-syscalls --max-cycles 100000000
libcompressor simulator starting @0x40000
libcompressor simulator terminate @0x7ff58
libcompressor decompressor validated
XFlash_Application on Node : 0 compressed from : 896 bytes to : 888 bytes (0.8929%)
XFlash::DoXFlash
XFlash::DoImageProgramming
XFlash::GetDeviceInfo
XFlash_DeviceInfo::GetDeviceInfo_Hardware
XFlash_DeviceInfo::GetDeviceInfo_Hardware_IssueCompileCommand : xcc -Xmapper --dontenablesodlinks -Xmapper --wnoXN -x xc "spiinfo-269ded58" -x xn "target-xn-v0-e9da95d8" -o "spiinfo-16aef464" -lquadflash -D xnPORT_SQI_CS0=PORT_SQI_CS -D xnPORT_SQI_SCLK0=PORT_SQI_SCLK -D xnPORT_SQI_SIO0=PORT_SQI_SIO
XFlash_Utils::BuildRunCommand : xrun --io spiinfo-16aef464
Warning: F03098 Factory image and boot loader cannot be write-protected on flash device on node 0
XFlash::BuildFlashBinaryFile
XFlash_Builder_S2L::BuildStage2Loaders Factory
xflash: Warning: F03148 --quad-spi-clock not given, using default 15.62MHz
xflash: Warning: F03149 QE_REGISTER and/or QE_BIT locations not found in XN file for this flash device. Using default quad_spi_qe_location_status_reg_0 and quad_spi_qe_bit_6.
Stage2_Loader::Compile : xcc -Wno-bidirectional-buffered-port -Xmapper --dontenablesodlinks -Xmapper --nochaninit -Xmapper --noinitialtidy -Xmapper --image-base -Xmapper 0x40080 -Xmapper --image-size -Xmapper 0x3ff80 -Xmapper --wno110 -Xmapper --wno226 -Xmapper --wnoXN -std=c99 -O2 -x xn "target-xn-v0-e9da95d8" -x xc s2l-n0-b156549e -lstage2loader -lswitchsetup -lsqiaccess -lquadspi -x none myloader.o -lxcc -o s2l-n0-6fb0b4c6
myloader.xc: Error: Undefined reference to 'fl_connectToDevice'
myloader.xc: Error: Undefined reference to 'fl_readDataPage'
Error: F03010 Failed to compile second stage bootloader