How can i place assembly routines in boot sector?

This forum handles questions and discussions concerning Microchip’s 16-bit compilers, assemblers, linkers and related tools.

How can i place assembly routines in boot sector?

Postby JPortici » Thu Jul 29, 2021 8:28 am

crossposting from the other forum
my target device is dsPIC33EV256GM106

i have several assembly routines (including progmem check, decrypt, key storage) that i want to put in the protected boot sector.

Boot sector is enabled by configuration bits BSS2 = ON and FBSLIM less than 1FFF, and if they were C routines i'd just add __attribute__((boot(n))) and the linker would place them in boot memory and populate the vector space jump list with the appropriate branch instruction.
Also, i noticed that a section .boot_n is present in the map file output

However, i found no instructions on how to do it for assembly functions wirtten in a .S module
if i add the boot(m) attribute in the C signature there is no effect
if i place a function in .boot_m rather than in .text the linker complains that boot_m is a section in data space and i can't place code there

PS: i know that there is a russian forum that has some resident dsPIC assembly wizards, but for the life of me i can't find it.
googling "microchip dspic russian forum" is not giving the expected results as one can imagine :roll:
JPortici
 
Posts: 5
Joined: Tue Jul 19, 2016 9:40 am
PIC experience: Professional 1+ years with MCHP products

Return to MPLAB XC16

Who is online

Users browsing this forum: No registered users and 3 guests

cron