Tool/software: Code Composer Studio
Hello,
I ported the MSPBoot UART bootloader to the MSP430FR5739. The bootloader is using callback functions which are declared as void pointers.
typedef struct {
void (*RxCallback)(uint8_t); // RX Flag callback
void (*TxCallback)(uint8_t *); // TX Flag callback
void (*ErrorCallback)(uint8_t); // Error callback
}t_CI_Callback;
When the code is compiled with the mspx, large code, large data flags, the compiler seems to think the callback pointers are 20-bit addresses and loads the wrong address.
Memory content:
0x001C04 FF56
0x001C06 RxPacket
0x001C06 001C 0000 0000 1C00 7CE6 7CE6 7CE6 7CE6 7CE6 00E6
The assembly instruction executed to fetch the callback function address is:
MOVA &0x01c04,R15
What is loaded in the R15 register is 0x0CFF56 which is the 4 LSBs of 0x001C06 and the 16-bit callback pointer at 0x001C04.
Can I tell the compiler to use 20-bit callback pointers? or should I only use the small code flag when using function pointers?
Thank you!
Jocelyn Harvey