cristhian zarate

co-processor offset out of range

Discussion created by cristhian zarate on Mar 31, 2016

This is a copy of my post in Stack Overflow: http://stackoverflow.com/questions/35926880/errors-in-codewarrior-co-processor-offset-out-of-range

 

I'm trying to run a fuzzy inference system (FIS) application on a Freescale Kinetis K70F120M development board using CodeWarrior.

I wrote an Interpreter software that reads two plain text files (one that contains a Fuzzy Model and the other with patterns to be recognized) and writes a C++ application that can be uploaded to a development board to operate based on data read by sensors.

All the information contained in the FIS C++ application is written by the Interpreter, there's no chance I miscalculated the dimensions of a vector because the amount of elements were counted from the data contained in the files.

I've managed to run a FIS example application on the board but when I try to run the actual application I need to run I get the following 71 errors:

Description Resource Path Location Type
C:\Users\CRISTH~1\AppData\Local\Temp\ccLOvcxh.s co-processor offset out of range
  Prueba FALLAS 2
  line 8696, external location: C:\Users\CRISTH~1\AppData\Local\Temp\ccLOvcxh.s
  C/C++ Problem

 

C:\Users\CRISTH~1\AppData\Local\Temp\ccLOvcxh.s co-processor offset out of range
  Prueba FALLAS 2
  line 8697, external location: C:\Users\CRISTH~1\AppData\Local\Temp\ccLOvcxh.s
  C/C++ Problem

 

...

 

C:\Users\CRISTH~1\AppData\Local\Temp\ccLOvcxh.s co-processor offset out of range
  Prueba FALLAS 2
  line 15897, external location: C:\Users\CRISTH~1\AppData\Local\Temp\ccLOvcxh.s
C/C++ Problem

 

mingw32-make: *** [Sources/main.o] Error 1
Prueba FALLAS 2
  C/C++ Problem

This is the code I'm trying to run:

 

#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; 

 

This CodeWarrior Project was created in the CodeWarrior IDE v.10.6.4 as a new Bareboard Project:
Device to be used: MK70FN1M0 processor (K70F 120 MHz Family)
Project Type: Application
Connection to be used: Open Source JTAG
Language: C++
Floating Point: Hardware (-mfloat-abi=hard) vs. (-fp vfpv4)
I/O Support: Debugger Console
ARM Build Tools: GCC
Rapid Application Development: None
Start with perspective designed for: current perspective

I'm building the project with the FLASH configuration and debugging as "Prueba FALLAS 2_FLASH_OSJTAG".
I'm running CodeWarrior on Windows 7.

Please help me find what's preventing the code from running on the board, I'd really appreciate your help.
Please let me know if there is some information missing needed for the resolution of the problem.

Thank you!

 

Update #1: I've removed the code concerning the generation of the "ClassNeuron" and "RuleNeuron" objects and the patternArray vector including the functions that make use of that vector, so the remaining application is only creating the 50 "Universe" objects. After doing that I proceeded to remove a deliberate number of Universe objects to try to find out if there is a memory limit related issue, but wether it is 15 or 26 objects, I get a random amount of errors of the type described above (even 0 errors). I need to run my application with that exact quantity of objects (50 Universes, 10 Classes, 32 Rules & the 50x60 Pattern Array).

I suspect that the problem has something to do with the amount of objects the code creates, but I'm not sure if there is a FLASH memory limit set by CodeWarrior when the project is compiled. Nevertheless, I'm pretty sure that these errors have nothing to do with array handling, for I have enterely removed any reference to the patternArray from the project and, still, if I were doing something wrong with arrays, the CodeWarrior IDE should have given me some kind of clue on that.

Outcomes