OK I think I know what is going on here.
In fact the register _FLBPR is already defined in the MC68HC908MR32.h and MC68HC908MR32.c.
So you have two objects allocated there and the linker takes the first definition (the one of MC68HC908MR32.c).
To fix that I see 3 solutions:
1- make sure the linker takes your definition
To achieve that:
- Open the project in CodeWarrior
- Switch to "Link Order" view
- Make sure your source file comes prior to MC68HC908MR32.c file in the tab.
Just drag it on top of the list.
I am not sure this will work, but it might be worth it to give it a try.
2- Modify definition of _FLBPR in MC68HC908MR32.c
To achieve that:
- Copy the file MC68HC908MR32.c locally to your project source directory
- Edit the file MC68HC908MR32.c and modify the definition as follows:
volatile FLBPRSTR _FLBPR = 0xE8; /* FLASH Block Protect Register */
3- remove the definition from file MC68HC908MR32
To achieve that:
- Copy the files MC68HC908MR32.h & MC68HC908MR32.c locally to your project source directory
- Edit the file MC68HC908MR32.h and remove or comment out the lines:
Code:extern volatile FLBPRSTR _FLBPR @0x0000FF7E;#define FLBPR _FLBPR.Byte#define FLBPR_BPR0 _FLBPR.Bits.BPR0#define FLBPR_BPR1 _FLBPR.Bits.BPR1#define FLBPR_BPR2 _FLBPR.Bits.BPR2#define FLBPR_BPR3 _FLBPR.Bits.BPR3#define FLBPR_BPR4 _FLBPR.Bits.BPR4#define FLBPR_BPR5 _FLBPR.Bits.BPR5#define FLBPR_BPR6 _FLBPR.Bits.BPR6#define FLBPR_BPR7 _FLBPR.Bits.BPR7#define FLBPR_BPR _FLBPR.MergedBits.grpBPR#define FLBPR_BPR0_MASK 1#define FLBPR_BPR0_BITNUM 0#define FLBPR_BPR1_MASK 2#define FLBPR_BPR1_BITNUM 1#define FLBPR_BPR2_MASK 4#define FLBPR_BPR2_BITNUM 2#define FLBPR_BPR3_MASK 8#define FLBPR_BPR3_BITNUM 3#define FLBPR_BPR4_MASK 16#define FLBPR_BPR4_BITNUM 4#define FLBPR_BPR5_MASK 32#define FLBPR_BPR5_BITNUM 5#define FLBPR_BPR6_MASK 64#define FLBPR_BPR6_BITNUM 6#define FLBPR_BPR7_MASK 128#define FLBPR_BPR7_BITNUM 7#define FLBPR_BPR_MASK 255#define FLBPR_BPR_BITNUM 0
- Edit file MC68HC908MR32.c file and comment out the line
volatile FLBPRSTR _FLBPR; /* FLASH Block Protect Register */
CrasyCat