[NOTE] Things nice to have

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome.
steved
Posts: 429
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 3 times
Been thanked: 28 times

Re: [NOTE] Things nice to have

Postby steved » Wed Aug 16, 2017 1:46 pm

Thargon wrote:I know, but that is still quite cumbersome imo. I would hope that there is a better way than using explicit compiler directives, like

Simplification is only a few #defines away; for example I have:

Code: Select all

#define CACHE_ALIGN         __attribute__((aligned (32))) __attribute__((section(".ram0")))
#define CACHE_ALIGN_ZERO    __attribute__((aligned (32))) __attribute__((section(".bss")))
#define CACHE_NONE          __attribute__((section(".ram3")))

The section names need to lead to definitions in the scatter file.

You then use them in much the way you envisaged:

Code: Select all

CACHE_NONE uint8_t shortMessageBuffers[SHORT_MESSAGE_COUNT][SHORT_MESSAGE_MAX_LEN + 2] = { { 0 } };


I'd certainly like to see some standard Chibi memory-related definitions; possibly by type of memory rather than anything else (e.g. cached/non-cached, EEPROM, fast/slow etc)


Return to “Development and Feedback”

Who is online

Users browsing this forum: No registered users and 4 guests