Pumpkin, Inc.

Pumpkin User Forums

Can't compile Salvo for PIC12F675

For issues specific to Microchip's PICmicro® MCUs, including compilers (e.g. HI-TECH PICC & PICC-18, Microchip MPLAB®-C18) and IDEs (e.g. Microchip MPLAB®).

Can't compile Salvo for PIC12F675

Postby phil » Wed Jan 28, 2009 6:31 am

Hello

I'm trying to get SALVO to compile (using HiTech PIC C compiler V8.01 PL3)
for PIC12F675. The compiler is coming up with an error at the
linking stage, however no information. Can you advise if there is
something I should be doing? I've stripped out most of my code and am
doing a basic SALVO configuration using source below:

SOURCE = main.c hardware.c delay.c mem.c qins.c util.c init.c inittask.c
sched.c timer.c

FYI the Salvo config file is below. I've succesfully compiled for 16 and
18 bit cores, however this is a real problem for me

Has anyone had any experience with this?

Thanks in advance.

#ifndef __SALVOCFG_H__
#define __SALVOCFG_H__

#define OSBYTES_OF_DELAYS 1 // 1
//#define OSENABLE_MESSAGES TRUE
//#define OSENABLE_BINARY_SEMAPHORES TRUE
//#define OSBYTES_OF_EVENT_FLAGS 1
#define OSEVENT_FLAGS 0
#define OSENABLE_EVENT_FLAGS FALSE
#define OSEVENTS 0
// 0
#define OSLOC_ALL
bank1 //persistent
#define OSTASKS 3
//#define OSTIMER_PRESCALAR 5
#define OSCLEAR_WATCHDOG_TIMER()
//asm("nop")
//#define OSUSE_INLINE_TIMER TRUE

//#define OSDISABLE_TASK_PRIORITIES TRUE

#define OSTARGET OSPIC12

#endif /* #ifndef __SALVOCFG_H__ */

phil
 
Posts: 12
Joined: Mon Dec 12, 2005 12:00 am

Re: Can't compile Salvo for PIC12F675

Postby phil » Wed Jan 28, 2009 8:45 am

It's this line which is halting the linker.

#define OSLOC_ALL bank1 persistent

Does any one know why this is?

Thanks

phil
 
Posts: 12
Joined: Mon Dec 12, 2005 12:00 am

Re: Can't compile Salvo for PIC12F675

Postby phil » Wed Jan 28, 2009 9:06 am

The line:

#define OSLOC_ALL bank1 persistent

halts the linker and so does:

#define OSENABLE_EVENT_FLAGS FALSE

Any help would be appreciated.

Thanks

phil
 
Posts: 12
Joined: Mon Dec 12, 2005 12:00 am

Re: Can't compile Salvo for PIC12F675

Postby aek » Sun Feb 01, 2009 8:16 am

Compiling for the smaller parts can be a challenge -- with the PIC12, what usually happens is that the total size of the Salvo objects is bigger than a single bank, and you get those weird overflow errors. The solution is to control which objects are located in which banks. So you need to use more of the OS_LOC config options, spread across multiple banks. This App Note http://www.pumpkininc.com/content/doc/appnote/an-6.pdf details fitting Salvo into a PIC12C509 ...

Also, probably no need to use the persistent keyword in this case.

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Can't compile Salvo for PIC12F675

Postby phil » Mon Feb 02, 2009 1:17 am

Yes,I'm getting to compile and link. I think you're right. I'll experiment a little more with placement in the banks, but it is producing a hex file. And it works.

Thanks for the quick response

phil
 
Posts: 12
Joined: Mon Dec 12, 2005 12:00 am

Re: Can't compile Salvo for PIC12F675

Postby phil » Mon Feb 02, 2009 2:35 am

Andrew,

Thanks for replying. I've succeeded in getting Salvo to compile (with event flags, task priorites, 3 tasks!) Doesn't leave much room for much else, but proves it does work on small ROM and RAM footprint devices

THe line below is still halting the linker.

#define OSLOC_ALL bank1 persistent

From an app note I read this is the default configuration of Salvo for this PIC, so I'm not sure what's going on.

Thanks

Phil

phil
 
Posts: 12
Joined: Mon Dec 12, 2005 12:00 am

Re: Can't compile Salvo for PIC12F675

Postby aek » Mon Feb 02, 2009 12:42 pm

I don't understand -- can you compile AND link?

Rather than using OSLOC_ALL, use OSLOC_ECB, OSLOC_TCB, OSLOC_TICK, etc. and dump the persistent qualifier.

What you probably need to do is "spread' Salvo's objects across bank0 and bank1, in order for them all to fit. With only OSLOC_ALL, the linker is trying to fit all of them into the specified bank (bank1), and they're probably too big to fit.

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm


Return to PICmicro MCUs

Who is online

Users browsing this forum: No registered users and 2 guests

cron