2006-09-07 10:15 PM
Help for traslation SW in ST7Lite
2006-09-05 08:50 PM
I use ST7Lite19F. The flash is end. I traslate my sw on ST7Lite29F:it has 8K flash memory.
In ST7Lite19 my .prn file is: MY_ZRAM = NO_INIT 0x0080 TO 0x00FE; In ST7Lite29...what's is it? I have write: MY_ZRAM = NO_INIT 0x0080 TO 0x01F7; but when I use my first variable ''volatile unsigned int'' the software freeze and it's locked! :o What's new RAM size? What's the problem?Thanks2006-09-05 09:37 PM
Hi,
MY_ZRAM refers to the zero page variables (below 0xFF). This variables are accessed one one byte, generating quick and small size code. You have to create another segment in your prn file like MY_RAM from 0x100 to 0x17F. For more information, please refer to the Metrowerks linker documentation. Best regards Laurent2006-09-06 12:27 AM
Thanks a lot!!
I have insert: MY_ZRAM = NO_INIT 0x0080 TO 0x00FE; this->MY_RAM from 0x100 to 0x17F. and correct: DEFAULT_RAM, _ZEROPAGE, _OVERLAP INTO MY_ZRAM,MY_RAM; but it's same error: the sw is locked! :-[2006-09-06 12:38 AM
Hi,
This line is wrong : DEFAULT_RAM, _ZEROPAGE, _OVERLAP INTO MY_ZRAM,MY_RAM; you have to split it. For example : _ZEROPAGE, _OVERLAP INTO MY_ZRAM; DEFAULT_RAM INTO MY_RAM; You will have to manage the variable to put in zero page : #pragma DATA_SEG SHORT _ZEROPAGE char NumberOfAccess; //data_often_accessed #pragma DATA_SEG DEFAULT_RAM char StateOfHandler; //data accessed few times Hope this will help you. Don't hesitate to open the Metrowerks documentation ! Best regards Laurent ;)2006-09-06 03:35 AM
Again thanks a lot! ;)
I have change my sw with your advice code. Now compile but...the sw is locked! :-[ The gap: MY_RAM from 0x100 to 0x17F are at 16-bit adressing: I must ALIGN? I dont undestand why it dont run!!! :(2006-09-06 04:48 AM
Hi,
You don't need to align, you can access even and odd address. The CPU handles 8-bit data even if the address is 16-bit long. What do you mean by the software is locked ? What kind of tools do you use to debug ? Best regards Laurent2006-09-06 09:05 PM
Laurent fans club! ;)
I have change prn file with: MY_ZRAM = NO_INIT 0x0080 TO 0x01FE; MY_RAM = NO_INIT 0x0100 TO 0x017F; and PLACEMENT _ZEROPAGE,_OVERLAP INTO MY_ZRAM; DEFAULT_RAM INTO MY_RAM; .... In my define.h I have defined: #pragma DATA_SEG _ZEROPAGE some var....and #pragma DATA_SEG DEFAULT_RAM volatile unsigned int CntPositionMotor[2]; In my application I run 2 motor, after 3 second I memorize my default of motor with: CntPositionMotor[MOTOR_1] = 0xFF00; After memorization I run the 2 motor in reverse direction. I have programmed my demo-board, the SW run, the 2 motor run for 3 second, but when there is the istruction: CntPositionMotor[MOTOR_1] = 0xFF00; It's lock! :o Thanks again for my insistence :-[2006-09-06 09:28 PM
Thanks,
What do you suspect ? Is it the first time this line is executed ? (put a breakpoint on it to check) If yes, you can verify the assembly code generated either with the debugger or in the listing file (.lst) Best regards Laurent2006-09-07 04:38 AM
OK, I have understand: I have end ZERO_PAGE. The link alert me:''ERROR L2009:Out of allocation DEFAULT_RAM...FF'' beacause:
MY_ZRAM = NO_INIT 0x0080 TO 0x00FE; and DEFAULT_RAM, _ZEROPAGE, _OVERLAP INTO MY_ZRAM; Now if I use the new space: MY_RAM = NO_INIT 0x0100 TO 0x01FE; and NEW_RAM INTO MY_RAM this is adressable with 16 bit. I must defined ''far'' my new variable insert in NEW_RAM? I have define: #pragma DATA_SEG NEW_RAM; volatile unsigned int far NewVar1; volatile unsigned int far NewVar2; volatile unsigned int far NewVar3; but...It dont run :-[ Thanks again