I plan to compile and run a custom CircleOS 4.1 for my project (don't ask why, I have my reasons and this is a given).
The problem is that the original downloaded sources of 4.1 (project file Primer2_Circle.rprj) will compile but will not build due to a linking error: "[loads of error tekst] region `FLASH' overflowed by 540 bytes"
Apparently as I read in the forum everyone stumbles over this problem.
First of all I find it unbelievable that the source codes are provided in such a form that they WILL NOT compile-link and run as is without needing altering/tinkering! Who's bright idea was that? And when is it going to be remedied?
Now to my main questions:
I have searched the forum and found that I need to change the allowable size in the file FLASH(rx) line of 'Primer2_Circle.ld' :
MEMORY
{
/* !!! WARNING: you cannot change this without changing Circle_platform.h and startup accordingly !!! */
RAM (xrw) : ORIGIN = 0x2000D800, LENGTH = 10K
FLASHB1 (rx) : ORIGIN = 0x08000000, LENGTH = 0
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 24K-256
/* !!! WARNING: you cannot change this without changing Circle_platform.h and startup accordingly !!! */
FLASHDATA (r) : ORIGIN = 0x08000000+512K-120K, LENGTH = 120K
EXTMEMB0 (rx) : ORIGIN = 0x00000000, LENGTH = 0
EXTMEMB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
EXTMEMB2 (rx) : ORIGIN = 0x00000000, LENGTH = 0
EXTMEMB3 (rx) : ORIGIN = 0x00000000, LENGTH = 0
}
to something like:
MEMORY
{
/* !!! WARNING: you cannot change this without changing Circle_platform.h and startup accordingly !!! */
RAM (xrw) : ORIGIN = 0x2000D800, LENGTH = 10K
FLASHB1 (rx) : ORIGIN = 0x08000000, LENGTH = 0
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 32K-256
/* !!! WARNING: you cannot change this without changing Circle_platform.h and startup accordingly !!! */
FLASHDATA (r) : ORIGIN = 0x08000000+512K-120K, LENGTH = 120K
EXTMEMB0 (rx) : ORIGIN = 0x00000000, LENGTH = 0
EXTMEMB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0
EXTMEMB2 (rx) : ORIGIN = 0x00000000, LENGTH = 0
EXTMEMB3 (rx) : ORIGIN = 0x00000000, LENGTH = 0
}
Compile and build now succeeds and I can flash it to the primer2.
However, when I try to compile&run one of the primer2 examples (after having updated the reference in the project file to the new Prime2_Circle.elf) the example will compile-link-and flash, but it will not run. With the original Prime2_Circle.elf it will run.
Apparently more needs to be done to get the source codes working correctly. The warnings in the code fragments above indicate likewise, but do not specifiy what is exactly meant by 'this' (following line, preceding line or segment between the two warniongs???) and neither what needs actually to be done to 'Circle_platform.h and startup ' (which startup???).
What am I missing and does anyone know precisely which files/lines/code need to be modified to precisely-what to get a working circleos 4.1 project?
Pointers to the quagmuires of other posts are not very illuminating as these mostly refer to older versions as far as I can see and there a a number of differences between the versions. A simple kitchen recipe style answer to get a working build in 5 minutes would be most welcome now.
And maybe some kind soul (administrator) could then upload a WORKING (as-is without needing mods) source code archive so that every newcomer does not need to waste countless hours trying to solve the same problem as others time and again? By my definition it is a bug and needs rectifying.
Cheers,
Albert.