Using the command:
xflash --loader ..\flashLoader\loader.o --factory bin\release\nbFactory.xe 0x10000 --boot-partition-size 458752 --noinq -o factory.bin
gives an error:
loader.xc: Error: Undefined reference to 'xpsig'
Error: F03010 Failed to compile
where the port 'xpsig' is referred to in the code below that is reading the input port.
Am I missing some parameters somewhere with tools version 13.2, as this used to work with the development tools version 11?
Any hints appreciated about how to get a xflash custom loader that samples an input port to "compile",
--philip
Code: Select all
# include "xs1.h"
# include "platform.h"
int keptVersion;
unsigned int keptAddress;
in port xpsig = on tile[0]: XS1_PORT_4A;
int bootFactory;
void init(void) {
int signal;
keptAddress = 0;
bootFactory = 0;
clearbuf(xpsig);
// read the state of the gpio cp3 line
xpsig: > signal;
// if the signal is asserted, then note a boot from factory is requested.
if ((signal & 1) == 1) bootFactory = 1;
}
int checkCandidateImageVersion(int v) {
// this is a good version if we don't yet have an address
// or if we are not booting from factory and the version is
// greater than or equal to the kept version.
return (keptAddress == 0) || (!bootFactory && v >= keptVersion);
}
void recordCandidateImage(int v, unsigned int address) {
// we don't record the version if the kept address is still 0
// as this is assumed to be the factory image version
// and is therefore independent of the "upgrade" versions.
if (keptAddress != 0) {
keptVersion = v;
}
// record the candidate address.
keptAddress = address;
}
unsigned int reportSelectedImage(void) {
// return what we found, should be at least one as the factory image
// will be recorded.
return keptAddress;
}