??? 03/26/07 13:33 Read: times |
#135890 - TUSB3410 8052-like bootloader problem |
Hi,
have this problem, using KEIL demo CA51's compiller KIT I'm trying to program my TUSB3410 that has 8052 core. This device is pre-programmed with a bootloader that downloads source code from HOST PC via USB and executes it in its RAM. Bootloader is for the whole enumeration process and downloading my microcode to its RAM, than it releases control to program downloaded to RAM. I'm making simple program that makes my diode twinkle on port P3.0. sbit LED1 = P3 ^ 0; VOID main(VOID) { DISABLE_WATCHDOG; while(1) { LED1 = 0; delay( 5); LED1 = 1; delay( 5); } } and what is strange, it is obvious that i'll have there "jump" instructions 'cause I'm making some loops. I remind of my code beeing executed in RAM, so compiller has to take care and add offset to jump instruction's destination address because this code will be placed in RAM not ROM. Bootloader will download my code to RAM, but if there's a jump instruction it's destination address must be fixed with ROM's lenght offset to avoid ProgCounter jumping to ROM areas. I believe it is arranged by choosing in KEIL the Target DEVICE as TUSB3410 and setting option in linker's menu: USE MEMORY LAYOUT FROM TARGET DIALOG. Everything works fine, diode twinkles, but if I change TARGET DEVICE to other TUSB device with smaller or larger ROM space - after compilation ma program is still working properly. If somebody has some experience with program code being executed in RAM and did something in KEIL and uVision IDE, will appreciate any help. Cyrul |
Topic | Author | Date |
TUSB3410 8052-like bootloader problem | 01/01/70 00:00 | |
The RAM is assigned to the bottom of code space![]() | 01/01/70 00:00 |