2011-09-14 06:24 AM
Hi all,
I am busy modifying my code so that I can utilize a custom bootloader. My application code is running and compiling with no problems on its own. The problem begins when I try to shift the start address of the code and interrupt vector to 0x9090 and 0x9000 respectively. The symptom is a list of linker errors of the following format - &sharperror clnk Release\sr.lkf:78 Release\request.o: section boundary crossing (.text:0014) I have followed the instructions in AN2659 which only requires to change the addresses of the code and interrupt vector in the project's settings (settings->Linker Input) I have checked the MAP file of the compiled version before the shift and there is no code space issue (the code is around 36K and I am using a 64K processor). Any explanation/assistance would be much appreciated. Thanks, Noam. #cosmic-link-linking-stvd #bootloader #cosmic2011-09-15 12:47 AM
2011-09-15 12:57 AM
Thanks for your response Luca,
Can you elaborate how do I change the memory model? By the way, looking at the s19 file of the compiled code before the shift, I can see that data is written to addresses greater than 0x10000.... Thanks, Noam.2011-09-15 02:07 AM
Hi again,
Very weird/interesting thing - I have changed the C compiler optimization from ''Minimize code size (+compact)'' to ''Speed Optimization (+fast)'' and the code is now compiling and linking fine at 0x9000 start address.... (I left the other optimizations unchanged - +split and -oc). Does it make sense to anyone? Thanks, Noam.2011-09-16 01:13 AM
2011-09-16 07:05 AM
Hi again Luca and thanks for the elaborated response!
I have been using Stack Long (modsl) memory model all along... I have searched throughout the code for any @near calls and there aren't any... Does that means that I have to go and physically add @far before any function definition/call? From what I have read in the manual, when defining Stack Long, the calls are defaulted to @far... You have mentioned different libraries, I haven't seen any mentioning on that... Hope to get further assistance from you! Cheers, Noam.2011-09-16 07:33 AM
Noam
I saw that error when my code first went over into the next section. If you look in ''Project Settings'' The ''C Compiler'' tab & category ''Output'' if either ''Functions do not cross section (-gnc)'' or ''Functions do Not Cross Boundarie (+nocross)'' are checked you can get this error. My current project will get this error if checked but runs fine otherwise. As long as you are compiling with ''+modsl'' you should be OK as there are no memory management registers that would need to change when crossing a page boundary jdf.