Dear all,
i have a problem im sure you can help me and is answered before - but i cant find this solution, so i hope you can give help me out.
My problem in short (as i understand it): i cant seem to write a 20bit address into a 32bit register even if using __data20_write_long . Also the assembler code generated deviates from the code shown in the compiler guide on p.137. I tried the suggested assembler code but it didnt work either.
More details to my problem: I would like to compute a crc32 over the whole programcode beginning at some address on an MSP430FR5994 (256kB). Therefore i would like to use the DMA to handle the CRC32 register, so i would like to write a fitting starting address to the DMAxSA register - which fails.
__data20_write_long((unsigned long) &DMA3SA, (unsigned long) 0x23fff); //or this version taken from the compiler guide __asm(" MOVA #DMA3SA+0, R15\n" " MOVX.W #3FFFh, 0(R15)\n" " MOVX.W #2, 2(R15)\n");
Both code snippets write into the DMA3SA register but only fill it with 0x3fff -> so only the 16bit part is written. The family data sheet says that it can take a 20bit address (how else would one use the DMA on the whole program space). I tried it with the TI-Compiler 20.2.7 and 21.6.0 and 21.6.1 - in all versions only the low 16bits are written into the source register. I dont know if the debugger can read 32bit from a register correctly but the executed code (which doesnt work as expected - starting at 0x4500 and not at 0x3fff) suggest that indeed there is no high byte in the register.
On an other hand, the created code for the __data20_write_long function deviates from the code written in the compiler guide as it only generates "MOV.W" commands. Since my assembler knowledge is nonexistent i dont know if this is relevant.
Hopefully you can help me find a solution.
Best wishes
Tobias
P.S.: In debug mode I can't write the correct value to the register either - is this behavior to be expected?