Re: [Flashforth-devel] Fwd: Re: C function with more parameters in W0-W7
Brought to you by:
oh2aun
From: Mikael N. <mik...@fl...> - 2015-06-09 07:38:10
|
Nope, I did not see that comment. It is of course reasonable to init data segments when you link to C-code. I had unchecked that option just to save same some code space for pure FF compilations. Note that FF also uses a flash area for the EEPROM emulation. For 128 Kb and larger devices it is placed at 0x10000-0x10fff in flash. You could place the c-code and libs at 0x11000 and up. There is also some unused flash space in 0x10000 - RAMSIZE upto 0xffff. For smaller devices the EEPROM emulation is placed inside the FF core dictionary area. On 09.06.2015 10:08, om1zz wrote: > Have you read my note in the Ctest.c header? :) > > After some experimenting I found out following trick (my current > undrestanding how it works): > > 1. you have to enable "Init data segments" in the xc16-ld settings > 2. it puts crt0 at the beginning > 3. after that it places all calls to .external libs/functions > 5. after that it puts FF.s > 6. it jumps from crt0 at the point in FF.s you marked as ".text" > (COLDLIT/WARMLIT) > 7. then it runs through the FF.s as usual. > > I have got both floats (single lib) and Ctest (9degree test function > with double lib) placed in the segment from 0x0200 to 0x2000 and FF.s > from 0x2000 up (see your map file). > > Of course, that is ok for 128kB flash parts (43kWords), but we need > to place all the external functions somewhere above 196kB flash, as > it > is my understanding FF can only address "lower 64kWords" (what is > still quite a lot for a forth when you can call external functions > out > of it). With a 512kB dspic33EP flash parts it could be an interesting > combination. > > When using double (64bit), ie. in the Ctest.c 9degree demo, you must > enable "Use 64-bit double" in xc16-gcc settings, otherwise the double > will work as a float only (even when declared as a double). > |