/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / Need idiot's guide to compiling custom CircleOS 4.1

Username:     
Password:     
             

Forum
  • Index
  •  » circleOS
  •  » Need idiot's guide to compiling custom CircleOS 4.1

# 1   2011-01-26 13:13:11 Need idiot's guide to compiling custom CircleOS 4.1

albert.bos@c-it.nl
New member
Registered: 2009-06-09
Posts: 2

Need idiot's guide to compiling custom CircleOS 4.1

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.

Offline

 

# 2   2011-01-27 07:30:07 Need idiot's guide to compiling custom CircleOS 4.1

yrt
Administrator
From: Grenoble-France
Registered: 2008-06-11
Posts: 520
Website

Re: Need idiot's guide to compiling custom CircleOS 4.1

Hi Albert,

I'm sorry but the project was correctly build and tested before posted, and there is no need to change any file to get working the Cirle-OS.
Which version of KitARM do you use ?
I tried now with current version (1.30) and effectively I got the same link error : it seems that the new version of GCC embedded with the last KitARM has changed the code size !
I will post a new version soon.

Thanks for your report,
Yves

Offline

 

# 3   2011-01-27 09:20:24 Need idiot's guide to compiling custom CircleOS 4.1

albert.bos@c-it.nl
New member
Registered: 2009-06-09
Posts: 2

Re: Need idiot's guide to compiling custom CircleOS 4.1

Hi Yves,

That would explain it. Looking forward to the new sources.

So far I have changed line 192 of to:
    FLASH    (rx) : ORIGIN = 0x08000000, LENGTH = 32K-256  // changed from 24K-256

line 86 of circle_platform.h to:

   #define FA_TABLE             (0x08008000)   // changed from 0x08006000

and line 25 of FAT_startup.c to:
    long unsigned table [ 1 ] = {0x08008000};  // changed from 0x08006000

I still can't get an example to run and think it might be the fat.elf file? How do I compile a new fat.elf? The FAT_startup.c and FAT.ld are in the project folder, but I don't see any option or project file to build the fat.elf?

Cheers,
Albert.

Offline

 

# 4   2011-01-27 11:01:57 Need idiot's guide to compiling custom CircleOS 4.1

yrt
Administrator
From: Grenoble-France
Registered: 2008-06-11
Posts: 520
Website

Re: Need idiot's guide to compiling custom CircleOS 4.1

Albert,

It is not simple and nor safe to work with the FAT.
The Primer2 flash is divided into 2 parts : debuggable (code limited to 24 Kb, that generates your error) and non-debuggable code.
The simplest way to fix your problem is to move some code to non-debuggable area with the macro "NODEBUG" defined in circle_platform.h as " __attribute__ ((section(".non_debuggable_code")))".

I have prepared a new official version.

Yves

Offline

 

# 5   2011-01-27 13:07:30 Need idiot's guide to compiling custom CircleOS 4.1

yrt
Administrator
From: Grenoble-France
Registered: 2008-06-11
Posts: 520
Website

Re: Need idiot's guide to compiling custom CircleOS 4.1

The CircleOS version 4.11 is on line.

Offline

 

  • Index
  •  » circleOS
  •  » Need idiot's guide to compiling custom CircleOS 4.1

Board footer