RTEMS on TMS570

Pavel Pisa pisa at cmp.felk.cvut.cz
Wed Feb 4 17:17:53 UTC 2015


Hello Martin,

On Wednesday 04 of February 2015 14:13:41 Martin Galvan wrote:
> #ifdef HAVE_CONFIG_H
> #include "config.h"
> #endif
>
> #include <rtems/test.h>
>
> #include <bsp.h> /* for device driver prototypes */
>
> #include <stdio.h>
> #include <stdlib.h>
>
> /* forward declarations to avoid warnings */
> rtems_task Init(rtems_task_argument argument);
>
> rtems_task Init(rtems_task_argument ignored)
> {
>   static const double number = 0.000000000000123456789;
>   printf("%f\n", number);
>
>   while(1);
> }
>
> /* NOTICE: the clock driver is explicitly disabled */
> #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
> #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
>
> #define CONFIGURE_MAXIMUM_TASKS            1
> #define CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM
>
> #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
>
> #define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
>
> #define CONFIGURE_INIT
> #include <rtems/confdefs.h>

I have build your code against my last tms570ls3137_hdk_sdram setup

make[omk]: binary-pass in app-martin-1
  CC      martin-1.o
if arm-rtems4.11-gcc --pipe -B/opt/rtems4.11/arm-rtems4.11/tms570ls3137_hdk_sdram/lib/ -specs 
bsp_specs -qrtems    -I /opt/rtems4.11/arm-rtems4.11/tms570ls3137_hdk_sdram/lib/include    -mbig-endian -mthumb -march=armv7-r -mfpu=vfpv3-d16 -mfloat-abi=hard      -I /home/pi/repo/rtems/build/tms570ls3137_hdk_sdram/omk-template/_compiled/tms570ls3137_hdk_sdram/include   -Wall  -O2 -ggdb   -DOMK_FOR_USER -MT 
martin-1.o -MD -MP -MF "martin-1.o.d.tmp"  -o martin-1.o -c /home/pi/repo/rtems/build/tms570ls3137_hdk_sdram/omk-template/app-martin-1/martin-1.c ; 
then mv -f "martin-1.o.d.tmp" "martin-1.o.d" ; else rm -f "martin-1.o.d.tmp" ; exit 1; fi
  LINK    /home/pi/repo/rtems/build/tms570ls3137_hdk_sdram/omk-template/_compiled/tms570ls3137_hdk_sdram/bin/martin-1
arm-rtems4.11-gcc --pipe -B/opt/rtems4.11/arm-rtems4.11/tms570ls3137_hdk_sdram/lib/ -specs 
bsp_specs -qrtems -mbig-endian -mthumb -march=armv7-r -mfpu=vfpv3-d16 -mfloat-abi=hard -I /home/pi/repo/rtems/build/tms570ls3137_hdk_sdram/omk-template/_compiled/tms570ls3137_hdk_sdram/include -Wall -O2 -ggdb    
martin-1.o -L/home/pi/repo/rtems/build/tms570ls3137_hdk_sdram/omk-template/_compiled/tms570ls3137_hdk_sdram/lib   -o /home/pi/repo/rtems/build/tms570ls3137_hdk_sdram/omk-template/_compiled/tms570ls3137_hdk_sdram/bin/martin-1
Compilation finished

There is result of the run from SDRAM when board is setup
by https://github.com/hornmich/tms570ls3137-hdk-sdram initialization code in the Flash

----
Running memory test...passed

Board is ready...
0.000000

After modification to

  static const int number_int = 42;
  printf("%d\n", number_int);

the result is

----
Running memory test...passed

Board is ready...
42

I have rebuild actual RTEMS GIT version with internal TMS570 SRAM version

../../../tms570/rtems/configure --target=arm-rtems4.11 --prefix=/opt/rtems4.11 \
  --enable-rtems-inlines --disable-multiprocessing --enable-cxx \
  --enable-rdbg --enable-maintainer-mode --enable-tests=samples \
  --enable-networking --enable-posix --enable-itron --disable-ada \
  --disable-expada --disable-multilib --disable-docs \
  --enable-rtems-debug \
  --enable-rtemsbsp="tms570ls3137_hdk_intram" \

Again correct results.

The bare "tms570ls3137_hdk" is difficult for us now
because we intentionally do not mix HalCoGen licensed code
and headers with RTEMS and we do not have pure RTEMS
full hardware initialization yet. We have used hack for tests
when HalCoGen generated init sits on address 0x00000 and
actual RTEMS application starts at address 0x40000 and we
forced jump to that application. I have managed more tests
to run that way in the past but more testing left to time
when we have more initialization implemented in RTEMS.

I have tried to check this with actual RTEMS version.
After the unfortunate const removal, Hello.exe and some other
small examples run. Your integer code runs too but float does not.
I have noted some problem pointing to

_Balloc (ptr=0x8003888, k=0) at newlib/libc/stdlib/mprec.c:121

This seems like there is some memory exhaustive leaking bug or something
similar. May it be that some section which should go to RAM stays
in the Flash and pointer to allocated block cannot be noted?

The Ticker.exe does not run too, probably uses float to print.
Complex demos like Unlimited runs as expected - i.e. reports fail when
memory is exhausted

  a38', failure, unsatisfied.
   FAIL3 : not enough tasks created -
           task created = 38, required number = 55

I am not sure what is the problem and I have been of the TMS570 till now
but I expect that there would be some progress on our side now.

I am sending minimal parch to correct cobnst problem in RTEMS TMS570 mainline BSP
as follow-up.

Best wishes,

              Pavel


More information about the devel mailing list