Running PASM from c
Bobby1066
Posts: 34
Hi I'm very new to this so the help i want may seem very stupid but I keep getting the following compiler error.
I have #include <propeller.h>
Tried all sorts just don't have the knowledge to work out what is wrong.
/*.................................................................
Start 1Hz PASM (Pulse1Hz.Spin) PUB Pulse_Every_Sec
//.................................................................*/
int startPulse1Hz(unsigned int * par){
extern unsigned int *binary_Pulse1Hz_dat_start;
return cognew(&binary_Pulse1Hz_dat_start,0);
}
int main() // Main function
{
Error returned is
C:\Users\Bobby\AppData\Local\Temp\cceNPXg3.o: In function `_startPulse1Hz':
(.text+0x1): undefined reference to `_binary_Pulse1Hz_dat_start'
collect2: ld returned 1 exit status
Done. Build Failed!
I've never used a forum before so hope what I've done is the correct way to go about it.
Thanks in advance.
Bob
I have #include <propeller.h>
Tried all sorts just don't have the knowledge to work out what is wrong.
/*.................................................................
Start 1Hz PASM (Pulse1Hz.Spin) PUB Pulse_Every_Sec
//.................................................................*/
int startPulse1Hz(unsigned int * par){
extern unsigned int *binary_Pulse1Hz_dat_start;
return cognew(&binary_Pulse1Hz_dat_start,0);
}
int main() // Main function
{
Error returned is
C:\Users\Bobby\AppData\Local\Temp\cceNPXg3.o: In function `_startPulse1Hz':
(.text+0x1): undefined reference to `_binary_Pulse1Hz_dat_start'
collect2: ld returned 1 exit status
Done. Build Failed!
I've never used a forum before so hope what I've done is the correct way to go about it.
Thanks in advance.
Bob
Comments
You can however include PASM code in your C code and call that.
Mike
Have found other references on this forum but no clear examples or explanations.
Hopefully there are others who may help me.
Thank you
Bob
If I remember correctly, the symbol name generated for the PASM code has two underscores prepended to the name, so you need to declare it with a single underscore (the second is automatically added by the C compiler as the standard naming convention).
If still not working, please post the complete source code you are actually using, otherwise it is very complicated to help you.
Best regards,
Marco.
Have tried that and exactly same error?
Here is my C and the PASM I'm trying to run.
Thanks Bob
Thanks for having a look for me. forgot am using SimpleIDE to compile and download
Bob
PS any hints or tip you have about my code would be gratefully received. Always looking to learn.
Well, the code you posted works without errors for me (and without the underscore thing, I was wrong with that, sorry).
I have just added the two sources to a new SimpleIDE project and compiled.
The spin file name is exactly as you typed in the post ? Because the symbol name is derived from the file name and it is case sensitive.
Best regards,
Marco.
Really scratching my head now.
Cant have any typos if it runs for you.
Had to have PASM as another Tab in SimpleIDE
Brill.