AnsweredAssumed Answered

Quick Start for DSC: ftfl.h not working

Question asked by Ljubomir Kopac on Jan 15, 2018

I am trying to add eeprom function to my project with MC56F82313 and assisted by DSC56800EX_Quick_Start_r2.6. I am trying to use ftfl.h (by following example program flash_e2prom.c) but it doesn't work.

The problem is obviously in the base address of FTFL registers (0x1c780) which is beyond 0xffff limit. In arch.h file these "far" registers are put in specific structure "ArchIOFar" but it is not recognised by the compiler. At the line "ioctl(FTFL, FTFL_INIT, NULL);" it returns an error "Ftfl is not a member of class 'struct'".

I tried to overcome it by replacing definition in ftfl.h: "#define FTFL (&ArchIO.Ftfl)" with a new definition: "#define FTFL (&ArchIOFar.Ftfl)". Now compiler errors disspeared but there are new linker errors:

"...is too far away for a R_56800E_WORD16 relocation, which has a range from 0 to 131070 bytes"

BTW, 0x1c780 is lower than 131070!

Is there a way to solve this in QS? Would it be better to try with Processor Expert?

 

Many tanks for help, Ljubomir 

Outcomes