Assigning variable to EEPROM - error?

Go To Last Post
10 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

------ Build started: Project: EMPeevaDev, Configuration: Debug AVR ------
Build started.
Project "EMPeevaDev.cproj" (default targets):
Target "PreBuildEvent" skipped, due to false condition; ('$(PreBuildEvent)'!='') was evaluated as (''!='').
Target "CoreBuild" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "E:\EMPeevaDev\EMPeevaDev\EMPeevaDev\EMPeevaDev.cproj" (target "Build" depends on it):
	Task "RunCompilerTask"
		Shell Utils Path C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils
		C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\make.exe all --jobs 4 --output-sync
		.././level3.c: In function 'ReadConfiguration':
E:\EMPeevaDev\EMPeevaDev\EMPeevaDev\level3.c(664,1): error: 'config_fsk_mark_carrier' undeclared (first use in this function)
E:\EMPeevaDev\EMPeevaDev\EMPeevaDev\level3.c(664,1): error: (Each undeclared identifier is reported only once
E:\EMPeevaDev\EMPeevaDev\EMPeevaDev\level3.c(664,1): error: for each function it appears in.)
E:\EMPeevaDev\EMPeevaDev\EMPeevaDev\level3.c(665,1): error: 'config_fsk_space_carrier' undeclared (first use in this function)
E:\EMPeevaDev\EMPeevaDev\EMPeevaDev\level3.c(666,1): error: 'config_psk_carrier' undeclared (first use in this function)
E:\EMPeevaDev\EMPeevaDev\EMPeevaDev\level3.c(667,1): error: 'config_psk_phase_1' undeclared (first use in this function)
E:\EMPeevaDev\EMPeevaDev\EMPeevaDev\level3.c(668,1): error: 'config_psk_phase_0' undeclared (first use in this function)
		.././level3.c: In function 'WriteConfiguration':
E:\EMPeevaDev\EMPeevaDev\EMPeevaDev\level3.c(780,1): error: 'config_psk_carrier' undeclared (first use in this function)
E:\EMPeevaDev\EMPeevaDev\EMPeevaDev\level3.c(781,1): error: 'config_psk_phase_0' undeclared (first use in this function)
E:\EMPeevaDev\EMPeevaDev\EMPeevaDev\level3.c(782,1): error: request for member 'config_psk_phase_1' in something not a structure or union
E:\EMPeevaDev\EMPeevaDev\EMPeevaDev\level3.c(782,1): error: too few arguments to function '__eewr_byte_m64'
E:\EMPeevaDev\EMPeevaDev\EMPeevaDev\level3.c(783,1): error: 'config_fsk_mark_carrier' undeclared (first use in this function)
E:\EMPeevaDev\EMPeevaDev\EMPeevaDev\level3.c(784,1): error: 'config_fsk_space_carrier' undeclared (first use in this function)
		make: *** [level3.o] Error 1
		Building file: .././level3.c
		Invoking: AVR/GNU C Compiler : 4.3.3
		"C:\WinAVR-20100110\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG -DF_CPU=16000000  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.132\include"  -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall  -mmcu=atmega64  -c -std=gnu99 -MD -MP -MF "level3.d" -MT"level3.d" -MT"level3.o"   -o "level3.o" ".././level3.c"
E:\EMPeevaDev\EMPeevaDev\EMPeevaDev\Debug\Makefile(100,1): error: recipe for target 'level3.o' failed
		make: *** Waiting for unfinished jobs....
		Building file: .././level4.c
		Invoking: AVR/GNU C Compiler : 4.3.3
		"C:\WinAVR-20100110\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG -DF_CPU=16000000  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.132\include"  -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall  -mmcu=atmega64  -c -std=gnu99 -MD -MP -MF "level4.d" -MT"level4.d" -MT"level4.o"   -o "level4.o" ".././level4.c"
E:\EMPeevaDev\EMPeevaDev\EMPeevaDev\Debug\Makefile(100,1): error: recipe for target 'level4.o' failed
		.././level4.c: In function 'ParseMessage':
E:\EMPeevaDev\EMPeevaDev\EMPeevaDev\level4.c(800,1): error: expected '}' before 'else'
		.././level4.c: At top level:
E:\EMPeevaDev\EMPeevaDev\EMPeevaDev\level4.c(1121,1): error: expected identifier or '(' before 'else'
E:\EMPeevaDev\EMPeevaDev\EMPeevaDev\level4.c(1124,1): error: expected identifier or '(' before '}' token
		make: *** [level4.o] Error 1
	Done executing task "RunCompilerTask" -- FAILED.
Done building target "CoreBuild" in project "EMPeevaDev.cproj" -- FAILED.
Done building project "EMPeevaDev.cproj" -- FAILED.

Build FAILED.
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

The above is the build output of my project. I had introduced five new variables to be stored in the eeprom. But looks like its giving me a declaration error(s) apart from the others.

 

 

I had declared the variables in another source file associated with the project. I am pretty sure I am doing some blunder here.

 

Amateur programmer.
Believe when I tell you that my struggle on here is real.

Last Edited: Wed. Nov 15, 2017 - 04:39 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 2

azimmali wrote:
I had declared the variables in another source file associated with the project.

So, do you have any extern declarations of those variables, visible when the compiler compiles the level3.c source file?

 

I'll try to save some time here: If you do not know what an extern declaration is and how it functions, then your first action is to read up on it in your C textbook. (It is getting somewhat ridiculous - While you've claimed to be experienced in C programming, we repeatedly get basic C questions. In fact, we're very slowly teaching you rudimentary C. Why not take a break and read your C book from front to back?)

 

Next, you've claimed you have experienced software engineers close by. Go over and ask them to give you a 15-minute introduction to extern declarations at a whiteboard.

 

Another option, but which would require you to show the actual definitions of those EEMEM variables in your other source, would be for us to give you a short piece of code to insert into leve3.c to solve the problem. So show the definitions and I'll tell you what to type into your editor to hopefully make this problem go away.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Solved: Missed declaration in the header file. :D

Amateur programmer.
Believe when I tell you that my struggle on here is real.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I thought it was associated to eeprom addressing somehow. I never claimed I am experienced in C. Learning on the go.

Amateur programmer.
Believe when I tell you that my struggle on here is real.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am yet to implement these variables in proper algorithms. I am trying to implement a psk  and fsk decoder. I have an incoming signal that is amplitude modulated and I want to identify the decoding based on set of parameters (still undecided). Do you know of any AVR resource that I can check to see if there's an algorithm for the two (I know what both PSK and FSK do)? I looked online - but I can't find any for AVR. Most of them are of linux based modems.

Amateur programmer.
Believe when I tell you that my struggle on here is real.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

azimmali wrote:
I looked online - but I can't find any for AVR.
Why do you think it needs to be specific to the AVR? Sure - when algorithms finally produce an "output" and it needs to stimulate the hardware in some way then there'll be a small layer of architecture specific stuff. But the core of a lot of computational algorithms will be architecture agnostic. (this is the joy of C - something like a JPG decoder for example will work the same whether it's AVR, ARM, x86 or whatever),

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

coming to EEMEM variables and their definitions - they are assigned particular values based on the type of application one wants them to be used for. For example: Some parameters, are used to check the configuration. If the configuration matches a certain type - it executes the process associated with it.

Amateur programmer.
Believe when I tell you that my struggle on here is real.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ok. I will try implementing the algorithm I have written down and will get back, Thanks for the help. :)

Amateur programmer.
Believe when I tell you that my struggle on here is real.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

azimmali wrote:
I never claimed I am experienced in C

I recall you referring to using Keil previous to Atmel Studio and avr-gcc.

 

azimmali wrote:
I looked online - but I can't find any for AVR.

Had a look at these:

https://community.atmel.com/proje...

https://www.avrfreaks.net/forum/f...

?

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I used them for minor edits in the program structure to make an already existing application firmware work based on the hardware requirements. Nothing from scratch like the one I am doing right now.  Sure, I will definitely look into them.

Amateur programmer.
Believe when I tell you that my struggle on here is real.