Friends, I need help:
I´m using a bootloader that is located in address 0x00 to 0xFFF so need to compile my programs to start in 0x1000, is this possible ?
I read the MikroC help, about diretive org, and it tell to specifie each function start address but, this is impractical.
Thanks and best regards,
Marcelo
org diretive: how to start program at pre determinated adr
Re: org diretive: how to start program at pre determinated a
Hi,
You can use something like this :
Regards,
Filip.
You can use something like this :
Code: Select all
void main() org 0x1000 {
....
}
Filip.
Re: org diretive: how to start program at pre determinated a
Ok but this only defines the start address for function main, other functions the Mikroc put "below" this address overwriting my bootloaderfilip wrote:Hi,
You can use something like this :Regards,Code: Select all
void main() org 0x1000 { .... }
Filip.
thanks
Marcelo
Re: org diretive: how to start program at pre determinated a
Try following on top of your main file:
Code: Select all
#pragma orgall 0x1000
Re: org diretive: how to start program at pre determinated a
this don´t work on mikroc may be in mikroc pro but, i don´t have pro version, can you test it in mikroc pro ?sasa72 wrote:Try following on top of your main file:Code: Select all
#pragma orgall 0x1000
thank
Re: org diretive: how to start program at pre determinated a
It creates HEX file correctly - starting from 0x2000. Since Intel HEX file is a byte based, that is real position 0x1000 in MCU ROM (word based).
Re: org diretive: how to start program at pre determinated a
Ok, I´m using MPLab import->view program memory to certify the memory contents, which version did you use to do this: MikroC or MikroC PRO ?sasa72 wrote:It creates HEX file correctly - starting from 0x2000. Since Intel HEX file is a byte based, that is real position 0x1000 in MCU ROM (word based).
thanks
Marcelo
Re: org diretive: how to start program at pre determinated a
HEX is created with latest mC PRO (5.01).
Re: org diretive: how to start program at pre determinated a
Ok, I tested in MIkroC PRO and works but I need to use MikroC "normal"
thanks
Marcelo
thanks
Marcelo
Re: org diretive: how to start program at pre determinated a
AFAIK, mikroC "normal" is an obsolete and abandoned product. If you have no specific reason to use it, it is highly recommended to switch to "PRO".
Another more complex solution may be to relocate your HEX file - disassemble and assemble with required ORG (with or without MPLAB).
Another more complex solution may be to relocate your HEX file - disassemble and assemble with required ORG (with or without MPLAB).