I am writing a very basic “Hello, World” application for the ARM/STM32F4 BSP. However, the size of the generated executable is about 1.9MB, whereas the STM32F446RE I have only has 512KB of flash memory. I am also providing the wscript
, init.c
, and app.c
files for reference.
Followed the manual BSP Build instructions on 2.7. Build Your Application — RTEMS User Manual 7.e8e6f12 (8th March 2025) documentation
Init.c file below
/*
* Simple RTEMS configuration
*/
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_UNLIMITED_OBJECTS
#define CONFIGURE_UNIFIED_WORK_AREAS
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_INIT
#include <rtems/confdefs.h>
Basic.c file below
#include <rtems.h>
#include <stdio.h>
#include <stdlib.h>
rtems_task Init(rtems_task_argument argument)
{
printf("Hello from RTEMS on STM32F446RE!\n");
exit(0);
}
wscript file below.
from __future__ import print_function
rtems_version = "7"
try:
import rtems_waf.rtems as rtems
except:
print('error: no rtems_waf git submodule')
import sys
sys.exit(1)
def init(ctx):
rtems.init(ctx, version=rtems_version, long_commands=True)
def bsp_configure(conf, arch_bsp):
pass
def options(opt):
rtems.options(opt)
def configure(conf):
rtems.configure(conf, bsp_configure=bsp_configure)
def build(bld):
rtems.build(bld)
bld(features='c cprogram',
target='test.exe',
cflags='-Os -ffunction-sections -fdata-sections',
ldflags='-Wl,--gc-sections',
source=['basic.c',
'init.c'])