| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| mmentink 
 
 
 Joined: 06 Sep 2005
 Posts: 0
 
 
 
			    
 
 | 
			
				| place and execute program in user defined memory block |  
				|  Posted: Tue Sep 06, 2005 6:27 am |   |  
				| 
 |  
				| Hello guys, 
 I'm trying to implement a wireless system, that needs to be upgraded wireless.
 
 For that, I came up with this solution:
 
 A kind of "bootloader" connects with the server and downloads a user program. After downloading the program, it places the code (C code) on a specific memory position, to where it jumps and executes.
 
 For this, I need to be able to tell the compiler that the code should be executed (and formatted) from a certain position.
 
 C does have Malloc and Calloc, and things like Long jump, but how do I use that to place functions in a certain memory block??
 
 I'm programming using CCS PCW 3.160 for a Pic18F252
 
 Any help would be greatly appreciated.
 
 greets,
 
 Matthijs
 |  | 
	
		|  | 
	
		| Mark 
 
 
 Joined: 07 Sep 2003
 Posts: 2838
 Location: Atlanta, GA
 
 
			      
 
 | 
			
				|  |  
				|  Posted: Tue Sep 06, 2005 9:15 am |   |  
				| 
 |  
				| Search the forum for bootloader and #org |  | 
	
		|  | 
	
		| Ttelmah Guest
 
 
 
 
 
 
 
			
			
			
			
			
			
			
			
			
 
 | 
			
				|  |  
				|  Posted: Tue Sep 06, 2005 9:35 am |   |  
				| 
 |  
				| And just add, that 'Malloc, and Calloc', have nothing to do with program memory allocation. They are data memory allocation commands... 
 Best Wishes
 |  | 
	
		|  | 
	
		| Mark 
 
 
 Joined: 07 Sep 2003
 Posts: 2838
 Location: Atlanta, GA
 
 
			      
 
 | 
			
				|  |  
				|  Posted: Tue Sep 06, 2005 11:07 am |   |  
				| 
 |  
				| On a pic, data and program memory space are separate.  Program memory cannot be run from data memory. |  | 
	
		|  | 
	
		|  |