Other Parts Discussed in Thread: MSP430F149, MSP430F2416
hello everybody !
I recently discovered a matter in my MSP430X software, but I also made a migration severals months ago, maybe it's the source of my problem. I searched a long time between several datasheets and migration guides, but I didn't find answer, so I came to you!
I'm working on a MSP430F2416 with IAR 4.21.2 in assembly only, and I have made a migration from a MSP430F149 several months ago. I didn't succed to migrate without change on the linker (lnk430F2416.xcl) with the line of CODE definition : -P(CODE)CODE=2100-FFBD,10000-18FFF
IAR give me an error while running linker:
"Error[e104]: Failed to fit all segments into specified ranges. Problem discovered in segment CODE. Unable to place 1 block(s) (0xf6de byte(s) total) in
0x16ebe byte(s) of memory. The problem occurred while processing the segment placement command "-P(CODE)CODE=2100-FFBD,10000-18FFF",
where at the moment of placement the available memory ranges were "CODE:2100-ffbd,CODE:10000-18fff" "
So I created a second segment of code named FARCODE to acces the extend memory :
-Z(CODE)CODE=2100-FFBD
-Z(CODE)FARCODE=10000-18FFF
This way, original code of the MSP430F149 was able to be migrated without change, and extend memory is filled with the new code placed in FARCODE segment. But I recently discovered a problem of interaction between extend (FARCODE) and normal (CODE) memory:
When I use a variable in RAM (that have a location in 16 bits) in a instruction located in extend memory with the same location in 20 Bits, the variable in RAM isn't recognized. In fact the assembly code aims to the right adress but in the extend code !
For instance : my variable named Var1 is located in 0x192D, I create an assembley code in extend memory at the adress 0x01192A with :
movx.b #1, Var1
But my assembly code is:
01192A 184F 43D0 FFFF movx.b #0x1,0x1192D
011930 3C2E jmp End_Test
Var1 is not recognized by the MSP430X, instead of aiming to VAR1 located in RAM (0x00192D), the code aim to the same location but in extend memory (0x11192D).
This can be made with all the location in RAM corresponding to the movx.b instruction: 0x192A ; 0x192B ; 0x192C ; 0x192D ; 0x192E and 0x192F; but the inscruction works well with all other location in RAM memory
Maybe this problem is in relation with the creation of FARCODE?
Please if someone have an idea, let me know.
Thanks a lot
Rudy