Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Re-locating Microchip C30 library assembly code

Status
Not open for further replies.

engr.waqas

Full Member level 3
Joined
Jul 21, 2009
Messages
172
Helped
13
Reputation
26
Reaction score
10
Trophy points
1,298
Location
karachi,Pakistan
Activity points
2,342
I am working on a PIC24F bootloader . I want to keep the flash(MCU's internal memory) erase and write functions in the bootloader section so they don't get erased or affected with the rest of the code.

I am using Microchip C30 built-in library functions. How can I add assembly source files, flash_helper.s and flash_helper2.s to my C code?

How can I locate these codes to a specific location in program memory instead of .libc section? Do the following piece of code in flash_helper.s and flash_helper2.s files need to be edited?

.ifdef ffunction
.section .libc.flash_helper123456,code
.else
.section .libc,code
.endif
 

You can simply add the files to the 'Source Files' list in the project window. (If you are using MPLAB)
To locate the code in memory, you need to edit the linker file.

Look at a few Microchip app notes for bootloaders to get an idea of how to edit the linker file.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top