Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Relocating program start position

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
Zvoc47

Bascom Member



Joined: 02 Apr 2015
Posts: 21

PostPosted: Wed Apr 15, 2015 8:40 pm    Post subject: Relocating program start position Reply with quote

Is it somehow possible to relocate the program start? My debugging program works from 0x000000 to 0x007FFF and I'd like to have users upload programs from 0x008000 which means that their whole programs must start from there. This is my school and contest project as an alternative to the expensive JTAG that other students cannot afford. My debugging program should solve this problem.
About the interrupt vectors, I can handle that. All I have to do is put a JMP instruction after every vector to jump to +0x8000 of its address or I can use an interrupt trapper for debugging purposes. The user's vectors must be at 0x008000.

AVR-GCC can do that, but I'm not sure BASCOM AVR can. BASCOM had that function for 8051 and they disabled it. Is it possible to go around this limitation to somehow compile at 0x008000? Like tweaking the INC/REG files of the microcontroller.

(BASCOM-AVR version : 2.0.7.8 )
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5003
Location: Holland

blank.gif
PostPosted: Wed Apr 15, 2015 9:47 pm    Post subject: Reply with quote

Yes B8051 supports this because the 8051 has a different architecture.
For AVR I could not find a reason to let code start from an address other than 0 or the boot address. You can only run code from flash, not from RAM, and since AVR had no boot vector selection either.....

you could do this :
$bootvector ' put int table into bootloader section so we can use interrupts
Config Intvectorselection = Enabled ' enabled means that the vector table points to the boot section
$loader=&H8000

I did not test it. As i understand it, you need the $romstart directive right?

_________________
Mark
Back to top
View user's profile Visit poster's website
Zvoc47

Bascom Member



Joined: 02 Apr 2015
Posts: 21

PostPosted: Thu Apr 16, 2015 3:08 am    Post subject: Reply with quote

Yeah. User's program goes to 0x8000 while my program is 0x0000 and debugs the user's program.
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5003
Location: Holland

blank.gif
PostPosted: Thu Apr 16, 2015 2:55 pm    Post subject: Reply with quote

if you write to support i can get you a version that supports $romstart. (dont know how quick but it seems simple)
_________________
Mark
Back to top
View user's profile Visit poster's website
Zvoc47

Bascom Member



Joined: 02 Apr 2015
Posts: 21

PostPosted: Fri Apr 17, 2015 3:42 pm    Post subject: Reply with quote

I sent the e-mail.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum