- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to update the software for a firmware chipset, and I'm having trouble understanding how variables are passed between C and assembly. When I try to compile, I get these errors:
https://gist.github.com/anonymous/d79f8f9734865a3ec1fe
These variables are defined in global.h here:
https://gist.github.com/anonymous/d81de7895838eaa41361
Also, lib/timer8_1int.asm is pretty short, so here it is:
https://gist.github.com/anonymous/848875129e7cf16e110f
Thank you for your time.
I'm using PSoC Designer 5.4 to write and compile this code, if that helps anyone.
Solved! Go to Solution.
- Labels:
-
PSoC 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You will have to declare the other missing variables for the timer to remove some more errors.
I would suggest you to change the library include part in your project, file main.c to
*************************************************************************************
* Copyright Triangle MicroSystems, Inc. 2003
*************************************************************************************/
#include <m8c.h>
#include <PSoCAPI.h> // This is essential!!
#include <math.h>
#include <FlashBlock.h>
#include "prototype.h"
#include "global.h"
#include "const.h"
#include "table.h"
/**************** Start Boot Loader Code ****************/
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You defined the variables in global.h, but did you declare in another file?
We could help you more if you post the complete project.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Answer is quite the same: In Designer -> Help -> Documentation there are the manuals for the C-Compiler and the assembly. There you will find explanations about naming and linkace for C-interface to asm. Posting a complete project goes: Designer -> File -> Archive Project and attaching the resulting .zip file here.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just realized the project I posted has some changes I had been working on. Here is the original untouched set. The only difference between the two are the addition of
char timer_heart_beat;
char timer_damp_pos;
char timer_sample_freg;
at the beginning of main.c to fix 3 of the errors.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You will have to declare the other missing variables for the timer to remove some more errors.
I would suggest you to change the library include part in your project, file main.c to
*************************************************************************************
* Copyright Triangle MicroSystems, Inc. 2003
*************************************************************************************/
#include <m8c.h>
#include <PSoCAPI.h> // This is essential!!
#include <math.h>
#include <FlashBlock.h>
#include "prototype.h"
#include "global.h"
#include "const.h"
#include "table.h"
/**************** Start Boot Loader Code ****************/
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, Bob thanks for the reply.
I have replaced the original included libraries to the set you posted, but that didn't seem to fix any errors yet. Right now I'm only having trouble getting timer_1msec, timer_10msec, and timer_100msec defined in the file Timer_1INT.asm, or so it would seem from the errors displayed.
!ERROR {linker} file 'timer8_1int.o': undefined symbol '_timer_1msec'
!ERROR {linker} file 'timer8_1int.o': undefined symbol '_timer_10msec'
!ERROR {linker} file 'timer8_1int.o': undefined symbol '_timer_100msec'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I said in my last post: "You will have to declare the other missing variables for the timer to remove some more errors."
So, as you did with
char timer_heart_beat;
char timer_damp_pos;
char timer_sample_freg;
I suggest you to initialize those vars with zero.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Bob,
Thank you for your patience. I am very new to writing code and many references still fly over my head.
Declaring the variables with "char" at the beginning of main.c made everything compile! Thank you for your help. I am still foggy, though, on how to initialize these variables with a 0. I am not sure if that is still necessary at this point, but any more tips would be greatly appreciated.
Thank you again for taking a look.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just use a syntax like
char timer_heart_beat = 0; // timer_heart_beat to zero
Bob