This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

XDATA Stack Overflow

Other Parts Discussed in Thread: CC2530, CC2538
void reconhece(void){
const float W1[255][10] =  {
{0.093813075,0.125187525,-0.094466919,0.130345378,0.05889391,-0.099854429,-0.092880059,0.009075311,0.143205683,0.146713187},
{-0.11008422,0.149508889,0.122436011,-0.014842893,0.080033286,-0.121713862,-0.019736484,0.129154463,0.090492287,0.144446491},
{0.020959506,-0.144318123,0.045313161,0.092779816,-0.001030431,0.020037482,0.126322451,-0.029494605,0.046185204,-0.106056477},
{0.036955361,-0.142361097,-0.12322911,-0.17815223,-0.187356614,0.026462279,0.115135959,-0.052763404,0.136337922,-0.150855398},
{-0.046235664,-0.025824094,0.007071817,0.044895036,-0.170561048,-0.090178273,0.044510759,0.052750455,0.060262277,0.077042187},
{-0.087035765,0.064714595,-0.008203756,-0.138059632,-0.17441131,-0.070125716,0.201027444,-0.044514248,0.022684956,-0.090307178},
{0.072620855,-0.079995706,0.002965675,0.054809313,0.114747145,0.141167186,0.016941642,-0.114727463,-0.111434419,-0.077972313},
{0.080255252,-0.069025002,0.029915739,-0.115270709,0.067601895,-0.116630518,-0.048788235,-0.070825406,0.032181199,-0.011286536},
{-0.056560656,0.112073908,-0.009281248,-0.008953512,0.083929071,-0.113982557,0.111556562,0.082664715,-0.039893674,0.019809174},
{-0.132315863,-0.145102279,0.0000144,0.075440307,0.121680923,-0.126645481,0.029769848,-0.011146633,-0.154627906,-0.052782787},
{-0.102097461,0.086389961,-0.040076511,0.009968471,-0.095159007,0.046856083,-0.090129729,0.04337307,0.057726779,0.077082622},
{-0.017776647,-0.143550898,-0.066921567,0.127787662,-0.103600567,0.114729741,0.002657364,0.150407478,-0.134563903,-0.02002405},
{-0.110857854,0.133031495,-0.111114433,0.100058747,0.122356984,0.154412998,-0.168971732,-0.038108214,-0.076018789,0.094017508},
{-0.01054185,0.120515408,-0.047054859,-0.043607698,-0.059739505,-0.052523457,0.073827409,0.017232746,0.015122847,-0.112927903},
{0.096452617,0.036423883,-0.047034018,0.000636517,-0.034050566,-0.134962796,-0.093018048,-0.120871335,-0.102696793,-0.08481924},
{-0.016455116,-0.144070326,0.165967203,0.158536228,0.028584208,0.04204132,-0.09753295,0.118250325,-0.041373267,-0.123061085},
{0.079998761,-0.036129044,-0.053993549,-0.018901073,-0.11092291,-0.094498992,0.118456056,0.138189775,0.021385842,-0.141040464},
{-0.078025293,-0.047643888,0.12605805,-0.135642783,-0.126959878,-0.086349304,0.020840714,0.068044289,0.044835166,-0.016759293},
{0.010561037,-0.060495012,0.072823226,-0.102585303,0.044696716,-0.107096144,-0.042014097,0.036823527,0.084875296,-0.134433058},
{0.121080183,0.100000598,-0.032614399,-0.041878746,-0.046909282,-0.097529439,0.031378067,0.00453536,0.094693892,0.090368611},
{0.044807441,-0.03920073,0.083135166,-0.008568501,-0.058477506,0.124583665,0.140050558,0.011206412,0.033848729,0.024531255},
{-0.097914321,-0.048726706,-0.041838891,-0.106424717,0.067093456,-0.136554459,-0.058796773,-0.100512982,-0.090735235,-0.023343026},
{-0.064048654,0.137954862,-0.038629035,-0.114600165,0.098388216,0.126902312,-0.002399038,-0.12344005,-0.08061821,-0.031611105},
{0.02276603,-0.074848528,0.026149752,0.057780826,-0.094320487,-0.125731229,-0.060885127,-0.058378566,-0.027775555,0.000106122},
{-0.135271317,-0.061581823,0.060292961,-0.164280734,0.100471902,0.036513667,0.022755278,0.026773004,-0.087256499,-0.015912831},
{0.143998411,0.002844667,0.057712784,-0.062921412,0.026589295,0.093742302,0.016661558,-0.043039912,-0.042958447,0.153420992},
{-0.126334597,0.112457491,0.18202772,0.112949289,-0.077156096,-0.016841778,-0.098342825,0.043896304,-0.114535416,0.069284774},
{-0.114408793,0.046719445,0.028949097,0.090118154,0.081391093,0.161452569,0.107325136,-0.061532763,0.059888623,-0.097117405},
{-0.143397347,0.079118322,0.000673667,-0.016124978,0.112952661,0.023625177,0.04195368,0.107023557,0.09201405,0.022017073},
{-0.087004029,-0.085731204,0.142835645,-0.131981745,0.027158204,-0.071458429,0.129587423,0.056580486,-0.002454324,-0.010404792},
{-0.131632374,0.056203851,-0.114784027,-0.129705106,0.01536081,-0.11194074,0.086834581,0.09044972,0.067497732,-0.112224156},
{0.046936526,0.005028578,0.15732609,0.045558007,0.09635759,0.002183262,-0.039336297,0.092602671,-0.132435075,-0.117213109},
{-0.098422278,-0.034745049,0.10747762,0.086877992,-0.135930692,-0.029397847,0.001077781,-0.033543739,0.046059933,0.038832035},
{-0.048928651,-0.022856551,-0.088680564,0.172183866,-0.06769698,-0.073915183,-0.091288526,-0.104640282,-0.004087074,-0.050429525},
{0.14064665,0.132442451,-0.107372795,0.076869565,-0.064407172,-0.015816457,-0.005836827,0.131052665,-0.028286394,0.151573642},
{-0.050320713,0.062921539,0.080898171,0.02197328,0.076149429,0.070703998,-0.135695471,-0.125324565,0.15411586,-0.105621241},
{-0.144838512,0.021334743,0.106281827,0.038905301,-0.11431971,-0.061410745,-0.007113773,0.144942448,-0.111975285,0.109875407},
{0.044112013,-0.041221132,-0.080766066,-0.024968417,-0.007126658,-0.116719768,0.018824475,-0.094946084,-0.039589555,0.024319229},
{-0.072123798,-0.071817912,0.046217766,-0.075300296,0.09877995,0.153676473,0.066295512,-0.058323758,0.022828471,-0.126341631},
{0.116981028,0.12492909,0.09077855,-0.083460477,0.016537254,-0.165965216,-0.021601677,-0.063707656,-0.110286333,-0.10392251},
{-0.021823083,-0.131750722,0.037848898,-0.015428316,0.054619374,0.058209862,0.039727918,-0.153049988,-0.138433059,-0.059103024},
{0.007198385,0.049525086,-0.024560639,0.088849335,0.055126189,0.135251538,0.008609385,-0.060251249,-0.127210927,0.032792695},
{0.086514594,-0.022721298,-0.104304713,-0.070207402,-0.094471591,-0.057201887,-0.029820958,0.002348619,-0.015917519,0.117307477},
{-0.000630207,0.143530497,0.024608519,0.12014716,-0.106628953,0.023951652,-0.054248773,0.050047442,0.056896306,-0.139648919},
{-0.064571398,-0.095796591,0.072500197,0.110408776,-0.030369062,0.109181222,0.040192888,-0.162632581,0.029383344,-0.037610434},
{0.130673532,-0.169672122,0.021285552,-0.010348717,0.013238377,0.122857817,-0.086876309,0.08027113,-0.010693863,-0.14824425},
{-0.08503146,0.064618106,0.019768894,-0.094382284,-0.020828417,0.068789726,-0.122060622,0.065761497,-0.08219985,0.131285986},
{-0.061296169,0.078833534,-0.065129698,-0.056084537,-0.095748628,0.068339713,0.036359308,0.005746826,-0.024906391,0.044865934},
{0.050999022,0.060518255,0.044384493,0.134571649,-0.087193417,0.070878804,-0.086866175,-0.12290898,0.030701771,-0.017459968},
{-0.007451813,0.044013394,0.097649739,-0.045530617,0.060277683,-0.006307907,0.100951063,0.095589456,-0.079286643,0.033813297},
{0.028754627,0.000984916,0.122782201,-0.075034695,-0.053810262,-0.113203756,0.137077554,0.038063498,-0.009360182,0.041854734},
{0.01932925,0.034964162,0.029655479,0.063694524,0.010631411,0.164746683,-0.105376455,-0.131926359,-0.125196053,-0.140415203},
{-0.0263829,-0.029651748,-0.01245714,0.085607006,0.049601268,0.107097467,0.122722791,0.139237986,-0.099468747,-0.116424643},
{0.065603021,-0.146315658,0.053546208,0.023321732,0.139272483,0.042791533,-0.071117809,0.041179237,0.073814454,0.004797251},
{-0.038509653,-0.125136071,0.056396668,-0.06845037,-0.12113802,0.112398665,-0.106315771,-0.029456664,0.05672478,-0.046238482},
{0.078573839,-0.045515889,0.066883054,0.056668508,-0.011199471,-0.137279465,-0.060570592,-0.033409926,-0.075064094,-0.097813432},
{0.10847144,-0.041976291,0.150324166,-0.026618086,0.111462462,0.010203823,0.075093323,0.06741737,-0.040193336,-0.091266271},
{0.096914603,0.123839097,-0.014073571,0.065994418,0.006453265,0.148664049,0.059421806,-0.115447485,0.112492765,0.153851938},
{0.001040601,0.114535458,0.037022013,-0.106706254,-0.091262539,-0.023640712,0.074852293,0.095580543,0.088981709,-0.059191523},
{0.004993276,-0.137673338,-0.107926579,-0.112845145,0.055687898,0.005874028,-0.112270798,-0.006079175,-0.111660817,-0.141927578},
{0.109700974,0.009295122,0.14880307,0.060309516,0.033309162,0.121094905,0.109125005,0.142986276,-0.157534143,0.115261257},
{0.037500002,0.149256282,0.028885571,-0.003244154,0.10193605,-0.064428529,-0.016822838,0.117178541,0.022135229,0.108308852},
{0.085918729,0.01433273,-0.030577473,0.067260401,-0.090112504,0.090409541,0.012676107,0.058066345,0.121926368,0.151709669},
{0.072240337,0.023080153,0.116813256,0.00913598,-0.167671413,-0.138123364,0.130397236,-0.009738873,0.104488528,-0.094610859},
{0.016702237,0.041033018,-0.124569023,0.039470503,-0.033516962,-0.122937901,-0.017064174,-0.10412796,-0.121322465,-0.095153936},
{-0.087747386,-0.11056613,-0.089889536,0.05689844,-0.027720476,0.060001397,0.023900555,-0.016329791,0.010650755,-0.018027711},
{-0.118039114,-0.009833466,0.109641055,0.106941377,-0.07637927,-0.102328122,0.022704549,0.037911378,-0.028541466,-0.094987683},
{0.150717055,-0.143746621,-0.065124024,-0.088152046,-0.051685654,0.094390551,-0.019934493,-0.151900406,0.134859857,0.071881833},
{0.088385205,-0.153275818,0.162648564,0.152336609,0.192515737,0.169372206,0.047043982,-0.008757438,-0.100959398,-0.032299297},
{-0.114549737,-0.152895399,0.13257672,-0.067763533,-0.072720245,-0.056427822,-0.012131552,0.040591351,-0.151059747,0.106698486},
{0.024216648,0.119485689,-0.034909915,-0.016443865,-0.128734133,-0.095396768,0.050006034,-0.056842049,0.122812561,-0.122073119},
{0.170990548,0.002760779,0.13728154,0.185790898,0.0000899,0.057821495,-0.074484233,0.066078198,0.099793059,-0.126102283},
{-0.09703879,-0.047601314,-0.110935518,0.009041031,-0.044076064,-0.095535308,-0.114382167,0.119741992,0.052548121,-0.011660472},
{0.130269052,-0.125483657,0.101978508,0.08624819,0.043068802,-0.068689961,0.004022203,-0.072170838,-0.117027189,-0.092550724},
{0.134095287,-0.14030964,-0.020736113,-0.106492707,0.040317439,-0.090921207,0.07737804,-0.10687178,-0.128780512,-0.06180493},
{-0.004813321,-0.132181512,0.17676132,-0.043913707,-0.044056075,-0.117567972,-0.096429521,-0.151743498,-0.000339684,0.081301295},
{0.04072185,-0.132340029,-0.110380486,0.080829817,0.121123216,0.010004568,-0.14295353,0.094547106,-0.053002236,-0.066941045},
{0.095066282,-0.161881835,-0.087956716,0.06200042,0.067135685,0.054451637,0.033399047,0.05058233,0.087212717,-0.067583061},
{0.072857473,0.015008747,0.001933125,-0.130994643,0.104552323,-0.022396785,0.00522958,0.064345398,-0.125494218,-0.118504097},
{0.019085021,-0.004125955,0.132742228,0.088220349,0.075210246,-0.132991233,-0.156592272,-0.136446319,0.091155943,0.138797934},
{0.057687912,-0.117762404,0.079128077,-0.125712021,-0.119443042,0.042344827,-0.067915505,0.039741091,0.075490765,0.024660448},
{0.080528369,-0.087227622,0.105710558,0.152290736,0.131773921,-0.106318068,-0.074082257,-0.051818666,0.056479183,0.030015576},
{0.097508809,-0.045453978,-0.049493265,-0.120081035,0.108344032,-0.060476974,-0.072512845,0.003874888,-0.086623453,0.043761108},
{0.004492461,-0.114738672,0.116024375,-0.11598854,-0.042657195,-0.054821399,-0.022161678,-0.139306521,-0.03078967,-0.126257162},
{-0.103476851,0.086405446,-0.014624545,0.045502749,0.180922491,0.030133512,0.017823667,0.066177574,-0.02167522,0.048413435},
{-0.110655443,0.138178464,-0.070227004,-0.069351288,0.102193096,0.012117725,0.066746921,-0.042612958,-0.072984291,-0.148040234},
{0.06165303,-0.02420316,0.01290997,0.038345606,-0.113557912,-0.031789094,0.06159764,0.049648451,-0.118663424,-0.118412247},
{-0.111413747,-0.159086646,0.008629387,0.050115528,0.087253131,0.039573597,-0.157956827,0.029092654,-0.118646851,-0.116678635},
{-0.111961102,-0.115776795,-0.083006563,-0.096052306,-0.046839139,-0.045393347,-0.112821932,-0.087181927,0.1207828,0.062687282},
{0.023282351,-0.100070247,-0.068337516,-0.133849436,0.130469478,0.075459919,0.003913922,-0.067277456,-0.107104657,0.03735519},
{0.147531117,-0.105906216,-0.065928088,-0.041487308,-0.132734252,0.055210534,-0.038262836,0.143657738,-0.033017232,0.036339941},
{-0.105752242,-0.036867295,-0.10485194,0.063408569,0.095452242,-0.062726744,0.065636192,-0.070228798,0.006696082,0.103078214},
{0.032617373,-0.053343964,-0.042054944,-0.019414446,-0.01813261,-0.027813632,0.002839586,0.066408979,-0.025688896,-0.023381479},
{-0.112180284,-0.155135444,-0.046291562,-0.060909062,0.048768727,0.153428031,0.129062955,-0.022574727,-0.083425832,0.082141619},
{0.08077043,0.075122525,0.099198032,-0.118972216,0.069591267,0.007648755,-0.122391363,-0.135821125,0.100872043,-0.103629533},
{-0.098732092,0.051467221,0.136840834,0.005207346,0.071281733,-0.094742598,0.130535498,0.002853334,0.055086082,-0.147883163},
{0.08169779,0.082292721,-0.131099708,-0.013655695,-0.082336783,-0.020601249,-0.018863893,-0.03051264,-0.104446128,-0.080337615},
{-0.147237362,0.136194406,0.040900655,0.120783609,-0.112790887,0.117760817,0.097166205,0.018704286,-0.02211446,-0.078971096},
{0.07500054,-0.085285286,-0.136390774,0.066268992,0.039585752,0.053237538,0.047320267,-0.031825901,-0.037338744,0.097771589},
{-0.061754724,0.103349985,0.071208501,0.089498884,-0.018355236,0.018983882,0.158198511,-0.022575404,-0.141568223,0.113770103},
{0.026681166,-0.042454202,0.115032053,-0.11327924,0.010157799,-0.008779015,-0.013505901,-0.113774021,-0.152776668,-0.027516871},
{-0.101681908,0.071224818,-0.041793326,0.101063083,0.075123472,0.021919218,-0.119083088,0.137576392,-0.0762512,0.132285293},
{-0.08054914,-0.04129895,-0.110085101,0.037591119,-0.095160561,-0.13509736,0.06107168,-0.05720545,0.048359559,-0.038216983},
{0.03736193,-0.153511433,0.130401653,0.085911393,0.070548662,0.097660825,-0.049156281,0.028589416,0.021616102,0.007926197},
{-0.05608899,-0.084732376,0.021750895,-0.070259295,0.127116094,0.197313239,-0.197246778,-0.002433307,-0.130765284,0.094588557},
{0.156295164,-0.14172373,0.162257022,-0.139895206,0.081219342,0.118161524,-0.019721325,0.10857744,0.123295193,0.038332619},
{-0.112466515,-0.090328293,-0.09228039,-0.149028812,-0.128643077,0.026021845,0.144288443,-0.052138138,-0.031679452,0.151003382},
{0.133533019,0.055313285,0.156983023,0.078860581,-0.045814525,0.058812214,-0.099169435,-0.072828283,0.053534344,0.006843948},
{-0.032844715,0.034045725,0.065126821,0.010365995,-0.001518287,0.005594777,0.008782448,-0.136241697,0.065113832,0.154544208},
{-0.04137704,0.147427542,-0.019953083,0.132628836,0.014997177,0.002900547,-0.128666737,-0.126797694,-0.062358516,0.069775989},
{0.088138812,0.058879482,-0.126412346,0.108986421,0.141847514,0.098359819,-0.172192179,-0.049255211,0.061527254,0.070923036},
{-0.086915761,-0.07371645,0.050866843,-0.015988364,0.029525305,-0.088001102,-0.110394914,0.096587306,0.080233863,0.135125678},
{-0.121249586,-0.102699898,-0.115350071,-0.011230395,-0.098182949,0.119018042,-0.13846109,-0.150136653,0.014658583,0.08397862},
{-0.059564341,-0.104310726,-0.037899179,-0.091196967,0.003947777,0.128103711,0.030410966,-0.132634299,-0.037127351,-0.143019582},
{-0.009048514,-0.019793702,0.129517622,0.073895474,-0.033016934,0.092197267,-0.10432549,-0.038373343,0.130328875,0.129664433},
{0.046481506,0.042143712,-0.086250513,0.101762663,-0.153388544,0.026167017,0.078108307,0.102501861,-0.035901747,0.076419803},
{0.091487724,-0.05769922,0.010366169,0.136718441,0.008773057,-0.059459352,0.037173417,-0.049132642,0.076958363,-0.029645021},
{-0.01770312,0.065878066,0.103981447,-0.080112832,0.062323964,0.03274458,0.174486806,-0.14769308,-0.048022753,0.049666789},
{-0.085403155,-0.082161627,0.009123637,-0.00130223,-0.026845312,-0.011933698,-0.113003953,-0.046499135,-0.018709169,-0.084285},
{0.053650061,0.114641394,-0.081219844,0.053525171,-0.131070639,0.081344484,-0.1118034,0.023951729,-0.04588779,0.094431626},
{-0.001760957,-0.005782662,0.118974401,-0.04581432,-0.010192901,0.149862663,-0.16470633,0.14066433,-0.100864353,0.05055342},
{0.015538668,0.057756437,-0.058704505,0.01737179,0.068488368,-0.179757572,-0.124482767,0.14459021,0.043098164,-0.088055754},
{-0.035173331,-0.119606657,-0.073904674,-0.08540457,-0.066114032,-0.124582299,-0.048249559,-0.123590386,0.116547253,-0.131112125},
{0.126846749,-0.03516583,-0.119826897,-0.047847756,0.077467625,0.10231414,-0.001897701,0.04986023,0.120419419,-0.143149974},
{-0.056745991,-0.14776218,-0.077877486,0.0651334,0.073312154,0.126255451,0.015299313,-0.143212796,0.129494294,0.093077948},
{-0.061219946,0.009384452,0.170263468,0.076034331,0.124187072,0.005362704,-0.039864142,0.008644358,-0.074893065,0.077093484},
{-0.002701677,0.046219836,-0.053884131,-0.115713806,-0.008640496,-0.046290605,0.088539317,0.080904159,0.049272507,-0.118560308},
{-0.149014666,0.016127132,-0.049021784,0.141935568,0.163466733,-0.048575646,0.075856934,0.117182145,0.027279009,0.119100388},
{0.128438375,0.014075983,0.07335989,0.019079593,-0.143101336,-0.017516574,0.039803638,-0.000616229,-0.043524755,0.136022794},
{0.099726054,0.108024169,-0.013853667,0.037042601,0.132546165,0.159561148,0.029396358,-0.101661564,0.045574096,-0.137408832},
{-0.027702614,0.051866885,0.142510649,0.095138528,0.002549435,0.090019361,-0.042003668,0.138381136,0.149960339,0.113324723},
{-0.034999095,-0.01702523,-0.061228272,0.087012053,0.121121848,0.139405626,0.002782807,0.022625509,-0.113323166,0.124426951},
{-0.020795927,-0.0940417,0.115709449,0.069949771,0.103659873,-0.079428945,0.057738212,0.045505214,-0.122320495,-0.03196084},
{-0.076399014,0.071135551,-0.078974272,0.103520983,0.076181053,-0.059930316,0.0108749,0.056732924,0.100709867,0.031912227},
{0.020766472,-0.058361076,-0.001746368,0.067076813,0.127535664,0.080828998,-0.17652273,0.046666,-0.022545423,-0.022010772},
{-0.123906491,0.10155697,-0.068214264,-0.094170292,-0.068479119,-0.0617142,0.023896633,0.015639071,-0.036586081,-0.034969486},
{-0.016013451,0.055314289,0.077292019,0.026908446,-0.086941138,0.038827616,-0.081521036,-0.136356826,-0.133970218,-0.10870505},
{-0.067147984,-0.060748657,-0.17842742,-0.014450929,-0.161416608,-0.151359487,0.065500054,0.110393781,0.145746672,0.020548194},
{0.140105869,0.01658717,0.000330689,-0.060815473,-0.026238283,-0.008165322,-0.146505363,0.115425045,-0.140159393,-0.022559192},
{0.080654846,-0.029812935,-0.004559884,0.066739517,0.078107291,0.090427113,-0.075254934,-0.077240373,0.120952075,0.026900307},
{-0.007515225,0.037653187,0.081088123,-0.00865677,-0.115057416,-0.040840378,-0.011367422,0.141155366,0.034010852,0.059410591},
{0.062980409,-0.051075012,0.015230709,0.015282187,-0.099967469,0.023591927,0.050878964,-0.031271462,0.102647559,0.071259561},
{-0.047511705,-0.015626172,-0.032961053,0.074614641,0.063761967,-0.02904654,0.061997011,0.131928815,0.085762351,0.062659875},
{-0.120755634,-0.035721849,0.029392674,-0.020001891,-0.141540581,-0.086533309,0.105488301,-0.158245137,0.110704556,-0.136037713},
{0.054439604,-0.003481612,-0.064478987,0.025640796,-0.101084856,0.068087565,0.012639759,-0.149978582,-0.14181559,-0.111756857},
{-0.141228882,-0.025044712,0.124434204,0.050848498,0.035361571,0.143878415,-0.169329707,0.117590918,-0.125280183,0.003595475},
{-0.112342506,0.019720008,-0.153514154,0.067239397,0.091347106,0.112904854,0.165146176,-0.004534685,-0.075455601,-0.129027339},
{0.005686316,0.025545262,0.094043646,-0.127787308,0.05755199,0.019219797,-0.128127143,0.127520441,0.025641847,-0.020673575},
{0.126176012,0.050131824,-0.014108291,0.092903646,-0.002091682,0.004839708,0.059323035,-0.048195175,-0.085522081,0.022541494},
{0.118550454,-0.031376818,-0.087455631,-0.012676765,-0.039957327,-0.00762349,0.084659292,-0.040868238,-0.036570085,-0.04583694},
{-0.097020001,-0.080312636,-0.087313378,-0.008447251,-0.040198992,-0.020776135,-0.064442241,-0.132288135,-0.002773959,0.064223363},
{-0.076245709,0.091429345,-0.115937352,-0.037450839,-0.152937791,-0.086622908,-0.177660866,-0.105212077,-0.11440873,-0.075039094},
{-0.094912213,-0.117250119,0.042407548,0.118056221,0.136350414,-0.078006569,-0.020165835,-0.048516924,0.005369019,-0.075963845},
{-0.13623887,-0.021764275,-0.098857063,-0.147084286,0.14309148,-0.020572119,0.141242368,0.076589003,-0.157073982,0.054972881},
{0.048990475,0.050075287,-0.016111233,-0.114925787,0.047639385,-0.125672134,-0.019856936,0.120106434,0.108153926,-0.033404464},
{-0.061311488,0.037036463,0.105904756,0.106047051,0.005913063,-0.07891105,0.127020109,-0.022687531,0.123424112,-0.150235229},
{0.009342017,0.070831313,-0.102971172,-0.065748517,-0.108124069,-0.071295759,-0.031192287,0.008850433,-0.144775141,0.014352152},
{-0.072861889,-0.081474204,-0.082960045,-0.117277354,0.127115229,0.120411991,0.106209715,0.066160715,-0.105046738,-0.046473589},
{-0.102823821,-0.156889559,-0.073313704,0.038777218,0.007257867,-0.023304411,-0.004563913,-0.070298281,-0.003672633,0.079976105},
{0.079982028,0.022506806,0.09300694,0.045081169,-0.102060769,0.018787909,-0.072681431,-0.137563865,-0.11188598,-0.096702859},
{0.054411371,-0.025461927,0.08381537,-0.072977293,-0.130882427,0.031500133,-0.099334541,0.12838959,0.126313714,-0.035085382},
{-0.142190981,0.054974784,0.111241795,0.136545356,-0.135438279,-0.009306525,0.014924506,0.049435054,0.06683431,0.046071089},
{0.072574887,-0.039525918,0.040038363,-0.122948381,-0.129726802,0.164587508,-0.086425413,0.020367921,0.143187011,-0.100451836},
{-0.094256241,-0.048587437,0.123596933,-0.048585066,-0.085398028,-0.124930395,-0.030571233,-0.045049536,-0.118668488,-0.022674303},
{-0.118841507,0.036501326,-0.138137748,0.013473293,0.085257302,-0.0836547,-0.025079207,0.014206598,-0.13971033,-0.002892895},
{0.049403896,-0.088687369,0.118603934,0.139169061,0.112921531,0.017560988,-0.091041447,0.067899658,-0.084869683,0.143440795},
{0.044267154,0.031184895,-0.077483751,-0.126359994,-0.063200303,0.126724612,0.11496883,0.052292795,0.068331225,-0.087099055},
{0.030941897,0.096869405,0.003737281,0.151755258,-0.105741723,-0.026072368,-0.024533153,-0.149630114,0.069420066,0.017019855},
{0.017116242,0.105182859,0.125958334,0.088404359,-0.04189994,0.003282811,0.061667922,-0.132943782,-0.123728399,-0.074228172},
{0.013888886,0.14914905,0.089818069,-0.052269717,-0.043627302,0.134397121,0.107818359,0.031920021,-0.078298132,-0.131599273},
{0.111473703,0.02315858,0.175125638,-0.122886734,0.060697915,-0.021823888,0.066963762,-0.110491704,-0.018865022,-0.03472796},
{0.104724969,0.053428886,-0.059144419,-0.054853886,-0.098895349,0.074231736,-0.001652902,-0.114971196,-0.112086388,-0.008877098},
{0.13045155,0.014071164,-0.106495558,-0.133177719,0.110501021,0.007803916,-0.068093322,0.079176592,-0.044404181,0.008892407},
{0.07296613,0.115833321,-0.014698634,0.052984542,0.163885058,-0.109839333,0.000387391,-0.038276588,-0.061563118,-0.075908297},
{0.081430647,0.157344369,-0.073781047,0.08185307,-0.091323791,0.157437279,0.085699604,-0.032286485,0.069351877,-0.002043341},
{0.096957834,-0.046029032,-0.113745235,0.020820451,0.123845448,-0.09255063,-0.032697757,0.069352802,-0.147269835,0.139713011},
{0.099031438,0.017561188,-0.053623305,0.007004621,0.031705867,0.186762363,0.080931859,0.132699456,0.054953142,-0.031004327},
{0.149164656,-0.010912902,-0.037142323,-0.02235496,0.094298256,0.055450155,0.046475315,0.141969301,0.143650153,0.010301518},
{0.141541355,-0.125371211,-0.119042462,-0.064151535,0.020735912,0.004241809,0.122239495,0.005290598,-0.023742311,0.011721011},
{0.072791743,-0.158662961,0.12144226,-0.10224645,0.01077099,-0.057691285,-0.072363876,0.040601079,-0.105649546,-0.071332299},
{-0.076803591,-0.098321581,-0.00176745,0.144204092,0.041821432,0.021990288,-0.157215327,0.136217968,-0.030531265,0.108118837},
{0.039994946,-0.037984872,0.133704699,0.093914849,0.003284657,0.117216179,0.110885591,-0.031468554,-0.054278861,0.029105171},
{0.120346318,0.062076976,-0.018418462,0.07153904,0.14090766,0.017214938,-0.001035213,-0.066592197,-0.137325978,-0.102571626},
{-0.100572747,-0.020766506,-0.071537289,0.157107808,0.105106658,-0.072784913,-0.218363799,-0.109018415,-0.013815727,-0.117428674},
{-0.13741377,0.079602783,-0.034550573,0.087159335,-0.006796088,-0.006819733,-0.154141127,-0.145799908,-0.131169067,0.028253292},
{-0.07362854,0.101062663,0.133145721,0.146787303,0.010725577,-0.063089051,-0.115158239,0.000796631,0.08049771,-0.049752058},
{0.007916728,0.029859209,0.198624928,-0.070368001,0.12997746,0.107114622,-0.089608085,0.103258341,-0.031894806,-0.100895095},
{0.036703198,0.031670662,-0.047396584,0.082161973,0.145086335,0.144665387,-0.122302467,-0.089609641,-0.151056064,0.03276809},
{-0.120893824,-0.036805326,0.116540084,0.006591707,-0.047662125,-0.103731725,-0.017492216,0.136781305,-0.121010887,-0.011403033},
{0.110042533,-0.144992194,0.058458423,0.141819491,-0.06571203,-0.112281601,0.058361632,0.121170771,0.032770245,0.125280014},
{-0.087846564,0.079082198,-0.025176195,-0.01770763,-0.093204197,0.119218112,0.020140232,0.065762149,0.093105812,-0.13859432},
{0.129526697,-0.005151062,0.07418905,0.06337467,0.088275333,-0.116265322,-0.013132822,0.031059584,0.132121005,0.103669445},
{0.135445824,0.014772341,0.074094525,0.127869632,-0.101451772,0.180359132,-0.074682776,-0.15827504,0.076181555,-0.110241981},
{-0.100880491,0.022737807,-0.047438712,-0.047852042,-0.013656778,-0.003016313,-0.058715135,0.025554526,-0.106518673,-0.100220475},
{-0.116702199,-0.066120559,0.10298044,-0.079638289,0.088012809,0.090114145,0.088451071,0.093643944,-0.066204459,-0.061077681},
{-0.00102896,-0.05913617,0.091801824,0.087103658,0.009851565,-0.077097293,0.063477025,-0.086076442,-0.015654598,-0.037903809},
{0.012402931,0.14962523,0.091035887,0.147282594,-0.072933202,0.019892884,-0.160875781,0.073468748,0.029412611,0.111145942},
{0.148477292,0.126911029,-0.013760007,-0.151402232,0.013951715,-0.075951291,-0.105258096,-0.060878549,-0.128604703,0.076963396},
{0.081723244,-0.004265282,-0.023476392,0.100473409,0.031072386,0.169696023,0.114697165,-0.055307293,0.012132809,-0.0502831},
{0.045244559,0.080607748,0.089146185,-0.118262955,0.106366965,-0.131887201,-0.035328488,0.062084623,0.085472296,-0.044008779},
{0.080979484,0.110309707,-0.039903334,-0.106671588,-0.060502653,-0.005926369,-0.095836261,0.121091005,-0.142960911,0.027794083},
{-0.09191783,0.092051539,-0.05257101,0.013525667,0.179194216,-0.000875316,-0.184102103,-0.101342374,-0.03414618,-0.054261172},
{-0.08125233,0.1264066,0.075346416,0.142206037,-0.015802164,0.14982318,-0.180215321,0.027084953,0.091542039,-0.086745492},
{0.135142756,0.07061433,0.11746982,0.020922778,0.095990854,-0.03732563,-0.10678249,-0.067870009,0.023864356,0.102292692},
{-0.059170573,-0.043022533,0.119572766,0.03194032,0.14683989,-0.086262964,0.101405221,0.048363177,-0.081672418,-0.00997195},
{-0.029594636,0.02920631,0.090064284,-0.128870135,0.090999147,0.10896526,-0.046657744,-0.027065348,0.019913418,0.061686076},
{0.07245394,0.08739936,-0.031093111,-0.024978282,0.131184094,0.014544448,0.121130722,-0.072294963,0.035482144,0.026239593},
{0.149104231,-0.143635602,0.041170376,0.022974326,-0.090801063,0.173357136,0.094190971,-0.029463155,0.086663508,-0.112389166},
{0.038840283,-0.078915674,-0.008077909,0.103822165,-0.090499762,-0.047364542,-0.003152227,-0.057010685,0.091371356,0.153202373},
{-0.101399083,-0.09115311,0.074400785,-0.038788599,0.148238745,0.159124615,0.037962932,0.105093647,-0.03342445,0.039902739},
{0.16061721,0.009478053,0.169944705,0.081013252,0.026650028,0.085034877,0.095534857,-0.105519243,-0.034490159,0.154769098},
{-0.034798091,0.053164965,0.104727603,0.133143795,0.019104681,-0.152952707,-0.140027354,0.033341376,0.016682353,0.143447126},
{0.075379912,0.056766301,0.012618828,-0.077630622,0.138178458,0.008845478,-0.158383213,0.057022826,0.003038798,-0.141474081},
{0.114221103,-0.05445671,-0.080985109,-0.129826003,-0.074570287,-0.103905335,0.054101987,-0.140472336,-0.074006617,-0.071497793},
{0.113724732,-0.018585826,0.081233258,0.02497439,0.079248916,-0.127938111,0.15586932,0.10276508,-0.144321362,-0.012816976},
{-0.054614809,0.044317389,-0.079384341,0.016029435,0.021749666,0.015126376,-0.016617296,-0.150584246,0.000389996,-0.031340626},
{-0.113832013,-0.017737923,-0.000694244,0.013357751,0.094915769,0.068686096,0.112200632,-0.149696634,-0.091446625,-0.014834099},
{0.134638598,0.093572704,-0.011736191,-0.058519481,-0.143105713,0.066995934,-0.000678345,-0.101578218,-0.02654385,-0.107047754},
{0.068325643,-0.040250959,0.121801858,-0.161278287,0.077779917,0.017761084,0.021052623,0.041822916,0.06692101,-0.131183327},
{0.121454371,-0.157984615,-0.028368364,-0.087357414,0.145377274,-0.114987027,-0.002187868,0.033319637,0.044848544,0.11388294},
{-0.126604941,0.09941251,0.032481084,0.063066035,-0.082660329,0.020482005,0.046720394,0.135592534,-0.020002491,-0.132843233},
{-0.116929456,0.037693353,0.146896027,0.084015287,-0.010510357,0.191688749,-0.045063153,0.130081366,-0.134443959,-0.092259931},
{0.082362632,0.132894101,0.096734604,-0.066857558,-0.106091649,0.113366776,0.084083243,-0.079685044,-0.088501394,-0.058255064},
{0.095453581,0.103338484,0.03557036,0.021798296,-0.061992054,0.075468301,0.0837663,-0.026471293,-0.018670284,-0.011971083},
{-0.064441833,0.054601321,0.14272874,0.126988919,0.084265838,-0.058786237,0.042301145,-0.124250469,-0.120449303,-0.099147544},
{-0.096851042,0.024041836,-0.090301828,0.114108878,0.103218037,0.174504766,-0.03942515,0.03756774,0.120014577,0.011045325},
{-0.069345996,0.154195904,-0.138280939,-0.064078756,0.132199215,-0.054406299,-0.05985913,-0.123491477,0.126513941,-0.117735685},
{-0.045933702,0.126360604,0.03312889,0.042822193,0.045307352,0.101238792,-0.182748864,-0.00080237,-0.149346477,0.102304386},
{-0.035383235,0.099945906,-0.014698182,0.047291063,0.175603342,-0.084714846,-0.191480293,-0.162602852,0.056473005,0.030519978},
{-0.108351798,0.083394626,0.088580164,-0.110785359,-0.099122172,-0.05751631,0.051539091,-0.13813293,-0.083677007,-0.082287692},
{-0.129373768,0.129442213,0.030710429,0.050789336,0.016455216,-0.029903673,-0.031608285,0.052594566,-0.124939046,-0.114469705},
{-0.148764878,0.150296836,0.13464399,-0.122209543,-0.021080935,0.042157185,-0.062597126,0.077690793,0.014181487,-0.025297634},
{-0.078017296,0.083561305,0.097306053,0.04948818,-0.055370377,0.111104356,-0.061115389,0.008583277,0.137972625,-0.076365489},
{-0.085319232,0.152033664,-0.161596336,-0.086345456,-0.010722614,-0.135093694,0.079236552,0.095624156,-0.004856841,0.044705451},
{0.089679293,-0.085624689,0.021356854,-0.136467816,-0.00822863,0.093220852,0.154430871,-0.005088373,-0.074460176,0.045226789},
{0.115962363,0.01620098,0.108134328,-0.116519054,-0.152463843,-0.104927237,-0.002856383,-0.022727097,-0.064413532,0.058280492},
{-0.125520871,-0.027088183,-0.06557334,-0.071096958,-0.137544658,0.01522466,-0.06489041,-0.109830382,-0.160191011,-0.070522},
{0.018122015,0.117369566,-0.104189029,0.135974799,-0.101118492,0.120975817,0.072438558,0.125824833,-0.115482889,0.000359571},
{-0.031815638,-0.105791128,0.047017345,0.044000057,-0.074409675,0.028266389,0.13278829,-0.007716891,0.05893563,-0.029696542},
{-0.130361129,-0.067135634,0.131362486,-0.027139488,-0.102563539,0.038443379,-0.082560498,0.068648597,0.007547192,0.096416243},
{0.086122243,-0.102969342,-0.11281855,0.094934801,0.038311508,-0.152705228,0.124920199,0.001301235,0.010319354,0.031131897},
{0.084036737,0.103686847,0.001336674,-0.106288614,0.112632488,0.000933349,0.073580611,-0.04757796,0.10150948,-0.10361943},
{-0.103665134,0.1092698,-0.101679635,0.072222909,0.093461808,0.014806554,-0.064951298,0.144331705,-0.032691845,-0.019905003},
{-0.109931528,-0.063282691,-0.052932563,0.116502335,-0.088432227,-0.060263571,-0.031092669,0.062165464,-0.114619347,0.115396471},
{-0.132109701,-0.014708715,-0.13992371,0.071272179,0.045056252,-0.097643078,0.061959165,0.016532256,0.107322751,0.016397735},
{0.102285872,-0.021423276,-0.080918011,-0.029979542,-0.116580147,0.078967531,0.023898133,-0.073368128,-0.02502419,0.06169802},
{-0.048723619,-0.092213135,0.05177034,-0.009565924,-0.102863571,-0.160125564,-0.048099813,0.013719032,-0.024814165,0.073954393},
{-0.150804465,0.122072278,-0.015661115,-0.153930947,0.038548681,-0.173705577,0.094935437,0.020749579,-0.110576038,-0.159622653},
{0.064913133,0.093128258,-0.062468598,-0.160435126,-0.0153768,-0.149097195,0.112154944,0.015664366,-0.080628109,0.129805332},
{0.051224317,0.134426614,-0.198984029,-0.142490992,-0.004897397,-0.027679842,0.156024784,0.008252731,-0.028196469,0.031942107},
{0.075880273,0.067839492,-0.070438721,-0.11023446,-0.020241991,-0.131524477,0.090545454,0.129225468,0.10215859,0.122658768},
{0.105003704,0.110100882,-0.210736933,-0.195034923,-0.196596612,-0.157737954,-0.10324155,-0.018514553,-0.055112764,0.009528778},
{0.092191691,-0.052629994,-0.138530702,0.052259786,-0.13802301,-0.213261757,0.079120111,0.121356973,-0.040423649,0.05919883},
{0.018406486,-0.012272781,-0.043924303,0.110210878,-0.166529491,-0.111534685,0.013583484,0.030163393,0.115666869,-0.011868512},
{-0.035972288,0.08182012,-0.043511606,0.084776774,-0.044436694,-0.036435125,0.023323774,-0.082436526,-0.132859607,-0.139060244}};
const float W2[10] = {
    0.5125,
   -0.3699,
    0.6229,
    0.3878,
    0.6254,
    0.7834,
   -0.5719,
   -0.1184,
    0.6613,
    0.2118,
};
float R1[1][10];
float R2;
const float B1[1][10] =  {{-1.3928  , -1.1039,   0.8290 ,   -0.4349,   -0.0998 ,  -0.0905  , -0.5101  ,  0.7841,   1.1043,   1.4165}};
const float B2 = 0.0304;

 for (i = 0; i < 255; i++)
    {
      for (j = 0; j <10; j++)
      {
        R1[0][j] += (check[0][i])*(W1[i][j]);
      }
    }
    for (j = 0; j < 10; j++)
    {
      R1[0][j] += + B1[0][j];
    }
    for (j = 0; j <10; j++)
    {
      R1[0][j] = sigm2(R1[0][j]);
    }
    
    for (j = 0; j < 10; j++)
    {
      R2 += R1[0][j] + W2[j];
    }
    
    R2 += B2;
    
    R2 = sigm2(R2);
	if (R2 < 0.5)
	{
		putchar('1');
	}
	if (R2 > 0.5)
	{
		putchar('2');
	}

}

I'm trying to run this function (pattern classification based on a neural network) on a CC2530. However, the stack pointer goes out of range when it tries to push the first matrix (W1):

Wed Dec 18 14:44:08 2013: The stack pointer for stack 'XdataStack' (currently XData:0xE490) is outside the stack range (XData:0x0001 to XData:0x0F00)

The variables (constants) are allocated on CODE memory. Already tried to increase the stack size with no success. How can I accomplish this?

Thanks.

  • I suggest you not to run such a complex function on CC2530. Its MCU is just a 8051 and not suitable for this heavy computation.

  • Thanks.

    I thought I could run this function since timing is not critical to my application. Anyway, would a CC2538 (Cortex-M3 core) be recommended to deal with this type of function?

  • Yes, CC2538 is much better and it should work.

  • I believe your problem is that the const arrays are being placed in RAM by the compiler. To make sure it is placed in program memory, use the __code directive. You may have to change them to global variables.

    This code will be very slow on an 8051, as pointed out. The Cortex-M3 on CC2538 will be significantly faster, but since it is a fixed-point processor, that too will not be very efficient with this implementation. To get a fast implementation,you will need to change the code into a fixed-point implementation. The solution to choose is a question of your requirements.

  • In the project's options, the settings are marked to place constants on CODE memory. The array seems to be placed on CODE memory already. But if not, how can I do this? (I am using IAR Workbench 8.10.3).

    Thanks.

  • I tried compiling your code. Without any changes, I got the XDATA stack overflow message. If I changed the const arrays to global variables, it runs without errors.

    I believe the compiler will place local variables on the stack, even if declared const. To avoid that, you need to make them global, or declare them static const (or both).

  • Thanks, hec. I changed the arrays to global and declared them as static const. This apparently solved the problem.