我正在尝试使用CodeWarrior在飞思卡尔Kinetis K70F120M开发板上运行模糊推理系统(FIS)应用程序。
我写了一个解释器软件,它读取两个纯文本文件(一个包含模糊模型,另一个包含要识别的模式),并编写一个C ++应用程序,可以上传到开发板上进行操作传感器读取的数据。
FIS C ++应用程序中包含的所有信息都是由解释器编写的,我不可能错误地计算向量的维数,因为元素的数量是根据文件中包含的数据计算的。
我已经设法在主板上运行FIS示例应用程序,但是当我尝试运行实际应用程序时,我需要运行,我得到以下71个错误:
说明资源路径位置类型
C:\ Users \ CRISTH~1 \ AppData \ Local \ Temp \ ccLOvcxh.s协处理器偏移超出范围
Prueba FALLAS 2
行8696,外部位置:C:\ Users \ CRISTH~1 \ AppData \ Local \ Temp \ ccLOvcxh.s
C / C ++问题
C:\ Users \ CRISTH~1 \ AppData \ Local \ Temp \ ccLOvcxh.s协处理器偏移超出范围
Prueba FALLAS 2
直线8697,外部位置:C:\ Users \ CRISTH~1 \ AppData \ Local \ Temp \ ccLOvcxh.s
C / C ++问题
...
C:\ Users \ CRISTH~1 \ AppData \ Local \ Temp \ ccLOvcxh.s协处理器偏移超出范围
Prueba FALLAS 2
线15897,外部位置:C:\ Users \ CRISTH~1 \ AppData \ Local \ Temp \ ccLOvcxh.s
C / C ++问题
mingw32-make:*** [来源/ main.o]错误1
Prueba FALLAS 2
C / C ++问题
这是我正在尝试运行的代码:
#include "derivative.h"
#include "network.h"
int main() {
Network ReporteDeFallasCEC;
const int NInputs = 50, NClasses = 10, NRules = 32;
ReporteDeFallasCEC.initialize();
ReporteDeFallasCEC.setClassNeurons(NClasses);
ReporteDeFallasCEC.setRuleNeurons(NRules, 0, Network::Pruning());
Universe input1;
input1.setLimits(0, 100);
input1.addFuzzySet(FuzzySet("vs", 0, 17.52, 35.04));
input1.addFuzzySet(FuzzySet("s", 9.3, 29.65, 50));
input1.addFuzzySet(FuzzySet("m", 23.82, 45.24, 66.67));
input1.addFuzzySet(FuzzySet("l", 50, 66.67, 83.33));
input1.addFuzzySet(FuzzySet("vl", 66.67, 83.33, 100));
ReporteDeFallasCEC.addVariable(input1);
Universe input2;
input2.setLimits(0, 100);
input2.addFuzzySet(FuzzySet("vs", 0, 24.75, 49.51));
input2.addFuzzySet(FuzzySet("s", 5.45, 27.72, 50));
input2.addFuzzySet(FuzzySet("m", 33.33, 5, 6.67));
input2.addFuzzySet(FuzzySet("l", 50, 66.67, 83.33));
input2.addFuzzySet(FuzzySet("vl", 66.67, 83.33, 100));
ReporteDeFallasCEC.addVariable(input2);
//...here goes the remaining "universe" objects
Universe input50;
input50.setLimits(0, 100);
input50.addFuzzySet(FuzzySet("vs", 0, 22.79, 45.57));
input50.addFuzzySet(FuzzySet("s", 0, 34.55, 100));
input50.addFuzzySet(FuzzySet("m", 20.59, 43.63, 66.67));
input50.addFuzzySet(FuzzySet("l", 42.4, 68.49, 95.99));
input50.addFuzzySet(FuzzySet("vl", 66.67, 83.33, 100));
ReporteDeFallasCEC.addVariable(input50);
ClassNeuron InterferenciaDeGas;
ClassNeuron TuberiaDesancladaConGolpeDeFluido;
ClassNeuron RoturaDeVarilla;
ClassNeuron FugaEnLaValvulaFijaDePie;
ClassNeuron FugaEnLaValvulaViajera;
ClassNeuron BarrilDeLaBombaDoblado;
ClassNeuron BuenLlenadoConTuberiaAnclada;
ClassNeuron AgujeroEnElBarrilDeLaBomba;
ClassNeuron AnclaDeTuberiaEnMalFuncionamiento;
ClassNeuron BarrilDeLaBombaGastado;
RuleNeuron FLRule65248697 = RuleNeuron();
FLRule65248697.setNumInputsNeurons(NInputs);
FLRule65248697.setNumClasses(NClasses);
FLRule65248697.setAntecedent(0, 0);
FLRule65248697.setAntecedent(1, 0);
FLRule65248697.setAntecedent(2, 0);
FLRule65248697.setAntecedent(3, 0);
FLRule65248697.setAntecedent(4, 0);
FLRule65248697.setAntecedent(5, 0);
FLRule65248697.setAntecedent(6, 0);
FLRule65248697.setAntecedent(7, 0);
FLRule65248697.setAntecedent(8, 0);
FLRule65248697.setAntecedent(9, 0);
FLRule65248697.setAntecedent(10, 0);
FLRule65248697.setAntecedent(11, 2);
FLRule65248697.setAntecedent(12, 2);
FLRule65248697.setAntecedent(13, 3);
FLRule65248697.setAntecedent(14, 3);
FLRule65248697.setAntecedent(15, 3);
FLRule65248697.setAntecedent(16, 4);
FLRule65248697.setAntecedent(17, 4);
FLRule65248697.setAntecedent(18, 4);
FLRule65248697.setAntecedent(19, 4);
FLRule65248697.setAntecedent(20, 4);
FLRule65248697.setAntecedent(21, 4);
FLRule65248697.setAntecedent(22, 4);
FLRule65248697.setAntecedent(23, 4);
FLRule65248697.setAntecedent(24, 4);
FLRule65248697.setAntecedent(25, 3);
FLRule65248697.setAntecedent(26, 4);
FLRule65248697.setAntecedent(27, 4);
FLRule65248697.setAntecedent(28, 4);
FLRule65248697.setAntecedent(29, 4);
FLRule65248697.setAntecedent(30, 4);
FLRule65248697.setAntecedent(31, 4);
FLRule65248697.setAntecedent(32, 4);
FLRule65248697.setAntecedent(33, 4);
FLRule65248697.setAntecedent(34, 4);
FLRule65248697.setAntecedent(35, 4);
FLRule65248697.setAntecedent(36, 4);
FLRule65248697.setAntecedent(37, 4);
FLRule65248697.setAntecedent(38, 4);
FLRule65248697.setAntecedent(39, 4);
FLRule65248697.setAntecedent(40, 4);
FLRule65248697.setAntecedent(41, 4);
FLRule65248697.setAntecedent(42, 4);
FLRule65248697.setAntecedent(43, 4);
FLRule65248697.setAntecedent(44, 4);
FLRule65248697.setAntecedent(45, 4);
FLRule65248697.setAntecedent(46, 4);
FLRule65248697.setAntecedent(47, 4);
FLRule65248697.setAntecedent(48, 4);
FLRule65248697.setAntecedent(49, 4);
FLRule65248697.setConsecuent(1);
ReporteDeFallasCEC.addRule(FLRule65248697);
RuleNeuron FLRule50510248 = RuleNeuron();
FLRule50510248.setNumInputsNeurons(NInputs);
FLRule50510248.setNumClasses(NClasses);
FLRule50510248.setAntecedent(0, 0);
FLRule50510248.setAntecedent(1, 0);
FLRule50510248.setAntecedent(2, 0);
FLRule50510248.setAntecedent(3, 0);
FLRule50510248.setAntecedent(4, 0);
FLRule50510248.setAntecedent(5, 0);
FLRule50510248.setAntecedent(6, 0);
FLRule50510248.setAntecedent(7, 0);
FLRule50510248.setAntecedent(8, 0);
FLRule50510248.setAntecedent(9, 0);
FLRule50510248.setAntecedent(10, 0);
FLRule50510248.setAntecedent(11, 0);
FLRule50510248.setAntecedent(12, 0);
FLRule50510248.setAntecedent(13, 0);
FLRule50510248.setAntecedent(14, 2);
FLRule50510248.setAntecedent(15, 4);
FLRule50510248.setAntecedent(16, 4);
FLRule50510248.setAntecedent(17, 4);
FLRule50510248.setAntecedent(18, 4);
FLRule50510248.setAntecedent(19, 4);
FLRule50510248.setAntecedent(20, 4);
FLRule50510248.setAntecedent(21, 4);
FLRule50510248.setAntecedent(22, 4);
FLRule50510248.setAntecedent(23, 4);
FLRule50510248.setAntecedent(24, 4);
FLRule50510248.setAntecedent(25, 3);
FLRule50510248.setAntecedent(26, 4);
FLRule50510248.setAntecedent(27, 4);
FLRule50510248.setAntecedent(28, 4);
FLRule50510248.setAntecedent(29, 4);
FLRule50510248.setAntecedent(30, 4);
FLRule50510248.setAntecedent(31, 4);
FLRule50510248.setAntecedent(32, 4);
FLRule50510248.setAntecedent(33, 4);
FLRule50510248.setAntecedent(34, 4);
FLRule50510248.setAntecedent(35, 4);
FLRule50510248.setAntecedent(36, 4);
FLRule50510248.setAntecedent(37, 4);
FLRule50510248.setAntecedent(38, 4);
FLRule50510248.setAntecedent(39, 4);
FLRule50510248.setAntecedent(40, 4);
FLRule50510248.setAntecedent(41, 4);
FLRule50510248.setAntecedent(42, 4);
FLRule50510248.setAntecedent(43, 4);
FLRule50510248.setAntecedent(44, 4);
FLRule50510248.setAntecedent(45, 4);
FLRule50510248.setAntecedent(46, 4);
FLRule50510248.setAntecedent(47, 4);
FLRule50510248.setAntecedent(48, 4);
FLRule50510248.setAntecedent(49, 4);
FLRule50510248.setConsecuent(2);
ReporteDeFallasCEC.addRule(FLRule50510248);
//...here goes the remaining "RuleNeuron" objects
RuleNeuron FLRule2056998 = RuleNeuron();
FLRule2056998.setNumInputsNeurons(NInputs);
FLRule2056998.setNumClasses(NClasses);
FLRule2056998.setAntecedent(0, 0);
FLRule2056998.setAntecedent(1, 0);
FLRule2056998.setAntecedent(2, 0);
FLRule2056998.setAntecedent(3, 0);
FLRule2056998.setAntecedent(4, 0);
FLRule2056998.setAntecedent(5, 0);
FLRule2056998.setAntecedent(6, 0);
FLRule2056998.setAntecedent(7, 0);
FLRule2056998.setAntecedent(8, 0);
FLRule2056998.setAntecedent(9, 0);
FLRule2056998.setAntecedent(10, 0);
FLRule2056998.setAntecedent(11, 1);
FLRule2056998.setAntecedent(12, 1);
FLRule2056998.setAntecedent(13, 1);
FLRule2056998.setAntecedent(14, 1);
FLRule2056998.setAntecedent(15, 2);
FLRule2056998.setAntecedent(16, 2);
FLRule2056998.setAntecedent(17, 3);
FLRule2056998.setAntecedent(18, 3);
FLRule2056998.setAntecedent(19, 4);
FLRule2056998.setAntecedent(20, 3);
FLRule2056998.setAntecedent(21, 4);
FLRule2056998.setAntecedent(22, 3);
FLRule2056998.setAntecedent(23, 3);
FLRule2056998.setAntecedent(24, 4);
FLRule2056998.setAntecedent(25, 0);
FLRule2056998.setAntecedent(26, 0);
FLRule2056998.setAntecedent(27, 0);
FLRule2056998.setAntecedent(28, 0);
FLRule2056998.setAntecedent(29, 0);
FLRule2056998.setAntecedent(30, 0);
FLRule2056998.setAntecedent(31, 0);
FLRule2056998.setAntecedent(32, 0);
FLRule2056998.setAntecedent(33, 1);
FLRule2056998.setAntecedent(34, 1);
FLRule2056998.setAntecedent(35, 1);
FLRule2056998.setAntecedent(36, 1);
FLRule2056998.setAntecedent(37, 2);
FLRule2056998.setAntecedent(38, 2);
FLRule2056998.setAntecedent(39, 2);
FLRule2056998.setAntecedent(40, 2);
FLRule2056998.setAntecedent(41, 3);
FLRule2056998.setAntecedent(42, 3);
FLRule2056998.setAntecedent(43, 3);
FLRule2056998.setAntecedent(44, 4);
FLRule2056998.setAntecedent(45, 4);
FLRule2056998.setAntecedent(46, 4);
FLRule2056998.setAntecedent(47, 4);
FLRule2056998.setAntecedent(48, 3);
FLRule2056998.setAntecedent(49, 4);
FLRule2056998.setConsecuent(3);
ReporteDeFallasCEC.addRule(FLRule2056998);
const int nPatterns = 60;
double patternArray[nPatterns][NInputs] = {
{ 6.60, 9.70, 12.2, 4.60, 5.70, 8.70, 12.9, 7.60, 11.8, 7.90, 24.9, 44.3, 55.0, 63.6, 71.3, 75.0, 76.8, 80.9, 84.50, 86.50, 90.70, 91.40, 95.00, 97.30, 93.80, 69.20, 82.60, 95.80, 98.90, 97.20, 97.70, 97.80, 96.90, 97.50, 94.50, 93.50, 95.80, 92.50, 93.60, 94.20, 92.00, 90.20, 91.60, 90.20, 91.50, 91.80, 90.70, 93.90, 96.10, 95.70 },
{ 7.70, 5.50, 4.50, 0.60, 1.70, 5.90, 6.70, 6.70, 8.60, 10.1, 5.60, 5.30, 8.40, 24.3, 57.2, 79.8, 88.0, 90.8, 91.10, 91.90, 92.40, 91.80, 91.60, 91.40, 95.70, 62.20, 94.10, 96.40, 91.60, 92.40, 94.00, 97.40, 97.70, 97.80, 96.10, 94.40, 94.40, 96.00, 98.10, 99.30, 94.40, 94.50, 96.30, 96.80, 94.20, 94.50, 96.60, 98.70, 97.10, 97.30 },
//...here goes the remaining pattern rows
{ 1.95, 3.10, 2.00, 3.20, 1.90, 3.70, 5.70, 5.00, 2.10, 3.50, 3.30, 2.05, 2.95, 2.40, 2.70, 3.80, 4.10, 3.30, 4.700, 5.100, 5.300, 5.900, 8.600, 14.30, 38.70, 87.40, 94.80, 96.00, 97.00, 97.40, 98.40, 98.80, 98.10, 98.90, 96.50, 92.00, 83.80, 75.00, 67.80, 69.00, 77.00, 87.70, 94.90, 96.00, 95.80, 95.60, 95.70, 93.80, 87.60, 38.80 }, };
double pattern[NInputs];
for (int i = 0; i < nPatterns; i++) {
std::cout << "Patron " << i + 1 << ": [ ";
for (int j = 0; j < NInputs; j++) {
pattern[j] = patternArray[i][j];
std::cout << patternArray[i][j];
if (j != NInputs - 1) {
std::cout << ", ";
}
}
std::cout << " ]" << "\n";
int clase = ReporteDeFallasCEC.classificate(pattern);
std::cout << "\nClase [ " << clase << " ]\n\n";
}
//std::cin.get();
return 0;
}
此CodeWarrior项目是在CodeWarrior IDE v.10.6.4中创建的,作为新的Bareboard项目:
使用的设备:MK70FN1M0处理器(K70F 120 MHz系列)
项目类型:申请
要使用的连接:开源JTAG
语言:C ++
浮点:硬件(-mfloat-abi =硬)与(-fp vfpv4)
I / O支持:调试器控制台
ARM构建工具:GCC
快速应用开发:无
从为当前视角设计的视角开始
我正在使用FLASH配置构建项目并调试为“Prueba FALLAS 2_FLASH_OSJTAG”。
我在Windows 7上运行CodeWarrior。
帮助我找到阻止代码在主板上运行的内容。
更新#1: 我删除了有关生成“ClassNeuron”和“RuleNeuron”对象的代码以及包含使用该向量的函数的patternArray向量,因此剩下的应用程序只创建了50个“Universe”对象。在这之后,我继续删除故意数量的Universe对象,试图找出是否存在与内存限制相关的问题,但是它是15或26个对象,我得到了上述类型的随机错误数量(甚至0错误)。 我需要使用确切数量的对象(50个Universe,10个类,32个规则和50x60模式阵列)运行我的应用程序。
我怀疑问题与代码创建的对象数量有关,但我不确定在编译项目时CodeWarrior是否设置了FLASH内存限制。不过,我很确定这些错误与数组处理无关,因为我已经从项目中删除了对patternArray的任何引用,但是,如果我对数组做错了,那么CodeWarrior IDE应该给出我对此有一些线索。
帮助我解决这个问题,因为很难找到关于此事的信息,即使在恩智浦(freescale)社区也是如此。
更新#2: 如以下相关问题所述,此错误实际上是编译器错误,请向我确认:
这是我在恩智浦(前飞思卡尔)社区的帖子:co-processor offset out of range
我将代码移到了Kinetis Design Studio中的一个项目中。它编译没有错误,我可以调试应用程序,直到董事会内存不足的时候,然后我应用了一些优化更改,一切都很顺利。
答案 0 :(得分:0)
由于它表明它可能与数组大小有关,我建议先检查数组初始化。
错误co-processor offset out of range
与您的任何变量无关,但有数组变量double patternArray[nPatterns][NInputs]
。这些元素的数量是否正确?